REPORT ZSAPN_INITIALIZATION. TABLES: MARA. "tables decleration for select-options PARAMETERS : P_INPUT TYPE CHAR20. "Inputfied with 20 character length. SELECT-OPTIONS: S_SO FOR MARA-MATNR. "select-options PARAMETERS P_CHK AS CHECKBOX. "check box PARAMETERS P_RAD1 RADIOBUTTON GROUP RB1. PARAMETERS P_RAD2 RADIOBUTTON GROUP RB1.By using the above code we can display the below screen.
Set Default values for parameters using INITIALIZATION
The below example explains you how to set default values using INITIALIZATION event to set default values on selection screen.INITIALIZATION. "This event will trigger first P_INPUT = 'SAPNuts'.
Set default values for Select-Options using  initialization event
Technically select-options are nothing but internal tables with four fields, the four fields are SIGN(Stores I - Inclusive of Defined Values/Range and E - Exclusive of Defined Values/Range, OPTION(Stores EQ - Equal, NE- Not Equal, LT - Lower Than, LE - Lower Equal, GT - Greater Than, GE - Greater Equal, BT - Between, CP - Covers Pattern and NP - Does Not Cover Pattern,LOW(Stores low value), HIGH(Stores high value), the below code is used to set default values for select-options.INITIALIZATION. S_SO-LOW = '1'. S_SO-OPTION = 'BT'. S_SO-SIGN = 'I'. S_SO-HIGH = '100'. APPEND S_SO. " append select-options to screen
Set Default values for check box and radio buttons group
Check box and radio buttons store either X or space, X means selected, space means not selected, use the below code to default check box and radio buttons.INITIALIZATION. P_CHK = 'X'. P_RAD2 = 'X'.
The final code will be
REPORT ZSAPN_INITIALIZATION. TABLES : MARA. "tables decleration for select-options PARAMETERS: P_INPUT TYPE CHAR20. "Input fied with 20 character length. SELECT-OPTIONS: S_SO FOR MARA-MATNR. "select-options PARAMETERS P_CHK AS CHECKBOX. "check box PARAMETERS P_RAD1 RADIOBUTTON GROUP RB1. PARAMETERS P_RAD2 RADIOBUTTON GROUP RB1. INITIALIZATION. P_INPUT = 'SAPNuts'. S_SO-LOW = '1'. S_SO-OPTION = 'BT'. S_SO-SIGN = 'I'. S_SO-HIGH = '100'. APPEND S_SO. P_CHK = 'X'.
Learner Questions
No Questions by learners, be first one to ask ..!!
Was this lesson helpful to you? Yes No 68 People out of 73 think this lesson helpful