on 09-28-2022 6:11 AM
I have 2 radio button options..... But if i click SD Invoice number i will show SD Update..... and same shld be for MM Invoice number...... But when i select MM it still shows SD update....... How to dynamically change it? pls help me with this issue...
Pls refer this code.....
SELECTION-SCREEN : BEGIN OF BLOCK c1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : r1 RADIOBUTTON GROUP rad1 USER-COMMAND u1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(25) text-015 FOR FIELD r1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : r2 RADIOBUTTON GROUP rad1.
SELECTION-SCREEN COMMENT 3(25) text-016 FOR FIELD r2 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : END OF BLOCK c1.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_invnum FOR zsd_vf01-vbeln MODIF ID a OBLIGATORY.
PARAMETERS : rem_upd(100) TYPE c MODIF ID a OBLIGATORY.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
SELECT-OPTIONS : s_inv1 FOR zmm_vf01-vbeln MODIF ID b OBLIGATORY.
PARAMETERS : rem_upd1(100) TYPE c MODIF ID b OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR
AT SELECTION-SCREEN OUTPUT.
IF r1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'A'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'B'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF r2 = 'X'.
LOOP AT SCREEN.
if screen-group1 = 'B'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'A'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
Hi,
following adapted code works in my case:
IF r1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'A'.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'B'.
screen-active = '0'.
screen-invisible = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF r2 = 'X'.
LOOP AT SCREEN.
if screen-group1 = 'B'.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'A'.
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
I just added the invisible-flag additionally. But from my point of view you have to disable the obligatory-flag for the fields in the blocks as otherwise SAP does not allow to change the screen when using a radio-button without entering some data in the obligatory fields. I would suggest to check in START-OF-SELECTION if the user has entered some data in the selection parameter and if not raise an error, so you can avoid the obligatory-flag.
I hope this helps you 🙂
Kind regards
Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you jzaehringer it worked......
User | Count |
---|---|
101 | |
9 | |
7 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.