FAQs
How can I define my own F4 Input help processing for a field on the selection screen?
You can use the event AT SELECTION-SCREEN ON VALUE REQUEST FOR <fieldname> for defining your own input help for selection screen fields.
PARAMETER: p_Sample TYPE c LENGTH 10. AT SELECTION-SCREEN ON VALUE REQUEST FOR p_Sample. BREAK-POINT. " don´t forget to remove "Do your processing here...
How can I set the initial values for SELECT OPTIONS at the start of the program?
In the event INITIALIZATION and AT SELECTION-SCREEN OUTPUT you could set the initial values for the selection screen fields. For SELECT OPTIONS you should fill the SIGN, OPTION, LOW, HIGH fields.
Eg: Set the date field with starting day of the month to last day of the month.
SELECT-OPTIONS: s_date FOR sy-datum. INITIALIZATION. s_date-sign = 'I'. s_date-option = 'BT'. date+6(2) = '01'. s_date-low = sy-datum. CALL FUNCTION 'LAST_DAY_OF_MONTHS' EXPORTING day_in = sy-datum IMPORTING last_day_of_month = s_date-high EXCEPTIONS day_in_no_date = 1. APPEND s_date. Initial values can be given at: AT SELECTION-SCREEN OUTPUT. AT SELECTION-SCREEN OUTPUT. s_date-sign = 'I'. s_date-option = 'BT'. date+6(2) = '01'. s_date-low = sy-datum. CALL FUNCTION 'LAST_DAY_OF_MONTHS' EXPORTING day_in = sy-datum IMPORTING last_day_of_month = s_date-high EXCEPTIONS day_in_no_date = 1. APPEND s_date.
How can we change screen fields on run time?
The parameters and radio button selection at Selection screen can be changed as below...
parameters: p_mypar TYPE C LENGTH 15, rd1 TYPE flag RADIOBUTTON group g1 default 'X' MODIF ID ID1 , rd2 TYPE flag RADIOBUTTON group g1 MODIF ID ID2 , rd3 TYPE flag RADIOBUTTON group g1 MODIF ID ID3. AT SELECTION-SCREEN output. PERFORM sub_Output. FORM sub_Output. IF p_mypar = ''. LOOP AT SCREEN. IF screen-group1 = 'ID1' OR screen-group1 = 'ID2' OR screen-group1 = 'ID3' . screen-input = '0'. MODIFY SCREEN. ENDIF. ENDLOOP. ENDIF. ENDFORM.