‎2006 Apr 15 6:31 AM
Hi guyz
herez another question
Can we modify selection-screen dynamically as we do in case of screen
What i want to do is
I want to display one parameter as checkbox and when user ticks this box I want to display another one
If we are defining two checkboxes earlier and making one invisible than can we modify selection screen to display another check box
Thanks in advance
‎2006 Apr 15 6:55 AM
Hi Rashmi,
Just have a look at this sample code.
Parameters: chk1 type c as checkbox,
chk2 type c as checkbox modif id 'ID1'.
**then
AT SELECTION SCREEN.
LOOP at SCREEN.
IF screen-group1 = 'ID1'
if chk1 = 'X'.
screen-invisible = ''.
else.
screen-invisible = 'X'.
ENDIF.
modify screen.
ENDIF.
ENDLOOP.
This code may have syntax error, but i think you can do away with them.
**IF this is helpful, reward points
‎2006 Apr 15 6:36 AM
Rashmi,
Yes you can do that.
Attach a MODIF ID with all the fields that you want to modify at runtime. Write the code AT SELECTION SCREEN, to LOOP at SCREEN and make it visible.
Regards,
Ravi
‎2006 Apr 15 6:39 AM
Take a look at this example.
REPORT EVENT_DEMO.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
R2 RADIOBUTTON GROUP RAD1,
R3 RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
R5 RADIOBUTTON GROUP RAD2,
R6 RADIOBUTTON GROUP RAD2.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
IF R1 = 'X'.
MESSAGE W040(HB).
ENDIF.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.
IF R4 = 'X'.
MESSAGE W040(HB).
ENDIF.
‎2006 Apr 15 6:59 AM
Hi Ravi
Using Modif id in case of selection-screen how we will make a field invisible and than again visible as structure sscrfields doesnt have any such component named Invisible so we can not make it visible or invisible by assigning value 0 or 1.
plz correct me if am not in right direction.
‎2006 Apr 15 6:55 AM
Hi Rashmi,
Just have a look at this sample code.
Parameters: chk1 type c as checkbox,
chk2 type c as checkbox modif id 'ID1'.
**then
AT SELECTION SCREEN.
LOOP at SCREEN.
IF screen-group1 = 'ID1'
if chk1 = 'X'.
screen-invisible = ''.
else.
screen-invisible = 'X'.
ENDIF.
modify screen.
ENDIF.
ENDLOOP.
This code may have syntax error, but i think you can do away with them.
**IF this is helpful, reward points
‎2006 Apr 15 7:01 AM
Thanks Vaibhav and Ravi
I got the point. I thought we can not use screen in case of selection-screens
‎2006 Apr 15 2:53 PM
Hi guyz
i tried it
i made second chkbox invisible using screen-invisible = 1.
but its not getting visible in at selection-screen
when i coded screen-invisible = 0.
I am not getting it
plz reply
Thanks in advance
‎2006 Apr 15 3:02 PM
Rashmi,
Don't give a value 0. Do it like screen-invisible = ' '.
Regards,
Ravi
Note : Please mark all the helpful answers