Skip to Content
0
Former Member
Oct 29, 2007 at 06:38 AM

LOOP AT SCREEN and USER-COMMAND

3484 Views

Hi,experts.

I have a question when I want to modify the screen. My requirement is that: In the selection-screen there are two radio buttons, and four text fields. When I select the first radio button , the last two text fields will become gray; when I select the second radio button , the first two text fields will become gray.

At first , my code is below,but it doesn't work.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: <b>p_rb1 RADIOBUTTON GROUP radi DEFAULT 'X'</b>,

p_rb2 RADIOBUTTON GROUP radi.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: p_txt1(10) MODIF ID sc1,

p_txt2(10) MODIF ID sc1,

p_txt3(10) MODIF ID sc2,

p_txt4(10) MODIF ID sc2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

IF p_rb1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'SC2'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

But after I adding <b>USER-COMMAND UC1 </b> to <b>p_rb1 RADIOBUTTON GROUP radi DEFAULT 'X'</b> , it worked.

But I don't understand how the 'user-command uc1' works.Can you help me? And if you have a better idea , please tell me.

Regards,

feng.