I am trying to toggle(hide) the selection screens based on radio button input. But the code seems not working.
" Radio button block
SELECTION-SCREEN BEGIN OF BLOCK search_block WITH FRAME TITLE text-001.
PARAMETER: rad_flt RADIOBUTTON GROUP rgb DEFAULT 'X',
rad_cus RADIOBUTTON GROUP rgb.
SELECTION-SCREEN END OF BLOCK search_block.
" Selection screen 1
SELECTION-SCREEN BEGIN OF BLOCK flight_block WITH FRAME TITLE text-002.
PARAMETER: carrid TYPE sbook-carrid,
connid TYPE sbook-connid,
fldate TYPE sbook-fldate MODIF ID sc1.
SELECTION-SCREEN END OF BLOCK flight_block.
" Selection screen 2
SELECTION-SCREEN BEGIN OF BLOCK customid_block WITH FRAME TITLE text-002.
PARAMETER: customid TYPE sbook-customid MODIF ID sc2.
SELECTION-SCREEN END OF BLOCK customid_block.
AT SELECTION-SCREEN OUTPUT.
*Toggle the selection screens based on radio buttons
LOOP AT SCREEN.
IF rad_flt = 'X' AND screen-group1 = 'sc2'.
screen-active = 0.
MODIFY SCREEN.
ELSEIF rad_cus = 'X' AND screen-group1 = 'sc1'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
The screen displays all the screens. Not able to track the issue using debugger.
'sc1'
and'sc2'
are written in lower case, but the actual value is all upper case (which is automatically done by SAP). NB: use PARAMETERS (with trailing "S"), PARAMETER is obsolete. Now, if you are saying that clicking a radio button does not trigger an action at SAP, that's how SAP works by default, but you can change the behavior by adding the wordsUSER-COMMAND any_ucomm
. – Sandra Rossi