Advertisement
Guest User

Просмотр данных по умолчанию для транзакции FF67

a guest
Jul 1st, 2013
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 4.62 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *& Report  ZBN_FF67DEF_CHECK
  3. *&---------------------------------------------------------------------*
  4. *& Проверка данных по умолчанию для транзакции FF67
  5. *& Исправление при необходимости. Должно быть WVAR_ART = 4 для всех пользователей
  6. *& Служебная программа, только для однократного запуска по необходимости
  7. *&---------------------------------------------------------------------*
  8.  
  9. report  zbn_ff67def_check.
  10.  
  11. tables: usr02.
  12.  
  13. select-options: so_bname for usr02-bname.
  14. parameters: p_updart as checkbox.
  15.  
  16. tables febmka.
  17. data: novaluta_flag.
  18. data: nofdis_flag.
  19.  
  20. data: lt_usr02 type standard table of usr02 with header line.
  21.  
  22. data: begin of gs_report,
  23.         bname type usr02-bname,
  24.         vari_start type febmka-vari_start,
  25.         kont_int type febmka-kont_int,
  26.         debi_mid type febmka-debi_mid,
  27.         kred_mid type febmka-kred_mid,
  28.         wvar_art type febmka-wvar_art,
  29.         novaluta_flag(1) type c,
  30.         nofdis_flag(1) type c,
  31.       end of gs_report.
  32.  
  33. data: gt_report like gs_report occurs 0 with header line.
  34.  
  35.  
  36. start-of-selection.
  37.  
  38.   if p_updart = 'X'.
  39.     data: lv_ans(1) type c.
  40.     data: lt_spopli like spopli occurs 0 with header line.
  41.  
  42.     lt_spopli-selflag = '1'. lt_spopli-varoption = 'Продолжить'.      append lt_spopli.
  43.     lt_spopli-selflag = '2'. lt_spopli-varoption = 'Отменить операцию'.   append lt_spopli.
  44.  
  45.     call function 'POPUP_TO_DECIDE_LIST'
  46.       exporting
  47.         textline1 = 'Вы действительно хотите обновить данные?'
  48.         textline2 = 'Будут изменены данные по умолчанию'
  49.         textline3 = 'для транзакции FF67'
  50.         titel     = 'Подтверждение'
  51.       importing
  52.         answer    = lv_ans
  53.       tables
  54.         t_spopli  = lt_spopli
  55.       exceptions
  56.         others    = 99.
  57.  
  58.     case lv_ans.
  59.       when '1'.
  60.         "Do nothing, continue
  61.       when others.
  62.         leave program.
  63.     endcase.
  64.  
  65.   endif.
  66.  
  67.  
  68.   select * from usr02 into table lt_usr02
  69.     where bname in so_bname.
  70.  
  71.   loop at lt_usr02.
  72.  
  73.     import febmka-vari_start
  74.            febmka-kont_int
  75.            febmka-debi_mid
  76.            febmka-kred_mid
  77.            febmka-wvar_art
  78.            novaluta_flag
  79.            nofdis_flag
  80.       from database rfdt(mk) id lt_usr02-bname.
  81.  
  82.     check sy-subrc = 0. "
  83.  
  84.     clear gs_report.
  85.     gs_report-bname         = lt_usr02-bname.
  86.     gs_report-vari_start    = febmka-vari_start.
  87.     gs_report-kont_int      = febmka-kont_int.
  88.     gs_report-debi_mid      = febmka-debi_mid.
  89.     gs_report-kred_mid      = febmka-kred_mid.
  90.     gs_report-wvar_art      = febmka-wvar_art.
  91.     gs_report-novaluta_flag = novaluta_flag.
  92.     gs_report-nofdis_flag   = nofdis_flag.
  93.  
  94.     append gs_report to gt_report.
  95.  
  96.     if p_updart = 'X'.
  97.       if gs_report-wvar_art ne '4'.
  98.         febmka-wvar_art = '4'.
  99.         export febmka-vari_start
  100.                febmka-kont_int
  101.                febmka-debi_mid
  102.                febmka-kred_mid
  103.                febmka-wvar_art
  104.                novaluta_flag                                           "XVALUT
  105.                nofdis_flag
  106.             to database rfdt(mk) id lt_usr02-bname.
  107.       endif.
  108.     endif.
  109.  
  110.   endloop.
  111.  
  112.   data: gr_table  type ref to cl_salv_table.
  113.   data: gr_functions type ref to cl_salv_functions_list.
  114.   data: gr_layout type ref to cl_salv_layout.
  115.   data: ls_key type salv_s_layout_key.
  116.  
  117.   constants: gc_true  type sap_bool value 'X',
  118.              gc_false type sap_bool value space.
  119.  
  120.   call method cl_salv_table=>factory
  121.     importing
  122.       r_salv_table = gr_table
  123.     changing
  124.       t_table      = gt_report[].
  125.  
  126.   gr_functions = gr_table->get_functions( ).
  127.   gr_functions->set_all( abap_true ).
  128.  
  129.   gr_layout = gr_table->get_layout( ).
  130.   ls_key-report = sy-repid.
  131.   gr_layout->set_key( ls_key ).
  132.   gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).
  133.  
  134.   data: lr_columns type ref to cl_salv_columns_table,
  135.         lr_column  type ref to cl_salv_column_table.
  136.  
  137.   lr_columns = gr_table->get_columns( ).
  138.   lr_columns->set_optimize( gc_true ).
  139.  
  140.  
  141.   lr_column ?= lr_columns->get_column( 'NOVALUTA_FLAG' ). lr_column->set_short_text( 'NOVALUTA' ). lr_column->set_visible( gc_false ).
  142.   lr_column ?= lr_columns->get_column( 'NOFDIS_FLAG' ). lr_column->set_short_text( 'NOFDIS' ). lr_column->set_visible( gc_false ).
  143.  
  144.   gr_table->display( ).
  145.  
  146. end-of-selection.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement