1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
" " TABLES: mara, mard, mspr, eban, aufk, afpo, afih. DATA: gv_ucomm TYPE sy-ucomm. SELECT-OPTIONS: s_mtart FOR mara-mtart. SELECT-OPTIONS: s_matnr FOR mara-matnr. SELECT-OPTIONS: s_mfrpn FOR mara-mfrpn. PARAMETERS: p_alg_1 TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND com1 DEFAULT 'X'. PARAMETERS: p_alg_2 TYPE c RADIOBUTTON GROUP gr1 . PARAMETERS: p_alg_3 TYPE c RADIOBUTTON GROUP gr1. PARAMETERS: p_alg_4 TYPE c RADIOBUTTON GROUP gr1. PARAMETERS: p_alg_5 TYPE c RADIOBUTTON GROUP gr1. SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 . SELECT-OPTIONS: s_werks2 FOR mard-werks MODIF ID sc2, s_lgort2 FOR mard-lgort MODIF ID sc2, s_sobkz2 FOR mspr-sobkz MODIF ID sc2, s_pspnr2 FOR mspr-pspnr MODIF ID sc2. SELECTION-SCREEN END OF BLOCK b2. SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003 . SELECT-OPTIONS: s_ekgrp3 FOR eban-ekgrp MODIF ID sc3, s_matkl3 FOR eban-matkl MODIF ID sc3, s_bsart3 FOR eban-bsart MODIF ID sc3, s_banfn3 FOR eban-banfn MODIF ID sc3, s_bnfpo3 FOR eban-bnfpo MODIF ID sc3. SELECTION-SCREEN END OF BLOCK b3. SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004 . SELECT-OPTIONS: s_auart4 FOR aufk-auart MODIF ID sc4, s_aufnr4 FOR afpo-aufnr MODIF ID sc4, s_projn4 FOR afpo-projn MODIF ID sc4, s_equnr4 FOR afih-equnr MODIF ID sc4. SELECTION-SCREEN END OF BLOCK b4. SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-005 . PARAMETERS: p_req_T TYPE text20 MODIF ID sc5. PARAMETERS: p_req TYPE text20 MODIF ID sc5. SELECTION-SCREEN END OF BLOCK b5. AT SELECTION-SCREEN. " событие срабатывает, когда нажимаем кнопку gv_ucomm = sy-ucomm. AT SELECTION-SCREEN OUTPUT. " Данное событие срабатывает после AT SELECTION-SCREEN " но sy-ucomm очищается, поэтому используем ранее сохраненное значение CHECK gv_ucomm = 'COM1'. lcl_get_data=>user_comand_1( EXPORTING iv_alg_1 = p_alg_1 iv_alg_2 = p_alg_2 iv_alg_3 = p_alg_3 iv_alg_4 = p_alg_4 iv_alg_5 = p_alg_5 ). "Опишем класс CLASS lcl_get_data DEFINITION. PUBLIC SECTION. user_comand_1 IMPORTING iv_alg_1 TYPE abap_bool iv_alg_2 TYPE abap_bool iv_alg_3 TYPE abap_bool iv_alg_4 TYPE abap_bool iv_alg_5 TYPE abap_bool. PRIVATE SECTION. visible_on_off IMPORTING iv_modif TYPE char3 iv_visible TYPE abap_bool. ENDCLASS. CLASS lcl_get_data IMPLEMENTATION. METHOD user_comand_1. visible_on_off( EXPORTING iv_modif = 'SC1' iv_visible = iv_alg_1 ). visible_on_off( EXPORTING iv_modif = 'SC2' iv_visible = iv_alg_2 ). visible_on_off( EXPORTING iv_modif = 'SC3' iv_visible = iv_alg_3 ). visible_on_off( EXPORTING iv_modif = 'SC4' iv_visible = iv_alg_4 ). visible_on_off( EXPORTING iv_modif = 'SC5' iv_visible = iv_alg_5 ). ENDMETHOD. METHOD visible_on_off. DATA lv_invisible TYPE c. DATA lv_active TYPE c. DATA lv_output TYPE c. DATA lv_input TYPE c. IF iv_visible = abap_true. lv_invisible = 0. lv_active = 1. lv_output = 1. lv_input = 1. ELSE. lv_invisible = 1. lv_active = 0. lv_output = 0. lv_input = 0. ENDIF. LOOP AT SCREEN. IF screen-group1 = iv_modif. screen-invisible = lv_invisible. screen-active = lv_active. screen-output = lv_output. screen-input = lv_input. MODIFY SCREEN. ENDIF. ENDLOOP. ENDMETHOD. ENDCLASS. |