Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying Selection screen dynamically

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

Thanks Vaibhav and Ravi

I got the point. I thought we can not use screen in case of selection-screens

0 Kudos

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

0 Kudos

Rashmi,

Don't give a value 0. Do it like screen-invisible = ' '.

Regards,

Ravi

Note : Please mark all the helpful answers