Динамическое определение текстов
Для полей селекционного экрана можно динамически (программно) задавать текста:
1 2 3 4 5 |
PARAMETERS: p_carrid TYPE s_carrid. INITIALIZATION. %_p_carrid_%_app_%-text = 'SelText'. |
Альтернативный вариант:
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 |
*----------------------------------------------------------------------* * Selection Screen Class definition *----------------------------------------------------------------------* CLASS lcl_selscr DEFINITION. PUBLIC SECTION. CLASS-DATA: f_date_text TYPE char30. CLASS-METHODS: set_text IMPORTING if_name TYPE char8 if_type TYPE char1 if_text TYPE char30, change_screen. PRIVATE SECTION. CLASS-DATA: t_text TYPE STANDARD TABLE OF rsseltexts. ENDCLASS. "lcl_selscr DEFINITION *.... Selection Screen SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa. PARAMETERS: p_so RADIOBUTTON GROUP rd1 DEFAULT 'X' USER-COMMAND usr1, p_cre RADIOBUTTON GROUP rd1, p_deb RADIOBUTTON GROUP rd1. PARAMETERS: p_date TYPE datum. SELECTION-SCREEN: END OF BLOCK blk1. *.... Initialization INITIALIZATION. aaa = 'Select an option to continue'. *.... At Selection-Screen Output AT SELECTION-SCREEN OUTPUT. * text for Radiobuttons lcl_selscr=>set_text( if_name = 'P_SO' if_type = 'P' if_text = 'Sales Order' ). lcl_selscr=>set_text( if_name = 'P_CRE' if_type = 'P' if_text = 'Credit memo' ). lcl_selscr=>set_text( if_name = 'P_DEB' if_type = 'P' if_text = 'Debit memo' ). * determine the text for the P_DATE CASE 'X'. WHEN p_so. lcl_selscr=>f_date_text = 'Sales Order Entry Date'. WHEN p_cre. lcl_selscr=>f_date_text = 'Credit Memo Entry Date'. WHEN p_deb. lcl_selscr=>f_date_text = 'Debit Memo Entry Date'. ENDCASE. lcl_selscr=>set_text( if_name = 'P_DATE' if_type = 'P' if_text = lcl_selscr=>f_date_text ). * Change the Selection Screen lcl_selscr=>change_screen( ). *.... Start of selection START-OF-SELECTION. WRITE: 'Date Text', lcl_selscr=>f_date_text. *----------------------------------------------------------------------* * Selection Screen Class definition *----------------------------------------------------------------------* CLASS lcl_selscr IMPLEMENTATION. METHOD set_text. DATA: la_text LIKE LINE OF t_text. la_text-name = if_name. la_text-kind = if_type. la_text-text = if_text. APPEND la_text TO t_text. ENDMETHOD. "set_text METHOD change_screen. CALL FUNCTION 'SELECTION_TEXTS_MODIFY' EXPORTING program = sy-cprog TABLES seltexts = t_text. ENDMETHOD. "change_screen ENDCLASS. "lcl_selscr IMPLEMENTATION |
Ну или воспользоваться такой обёрткой.