Application Development and Automation 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: 
Read only

Loop at Screen and Modify Screen

Former Member
0 Likes
46,637

Can some one take up an example and explain the concepts of "Loop At Screen" and "Modify Screen"? Your replies are highly appreciated and suitable points will be awarded.

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
15,964

Below MD1 is the Modif ID.

Loop at screen.

If screen-group1 = 'MD1'.

screen-active = 0.

modify screen.

endif.

endloop.

double click on screen to get more options and press F1 to get detail help.

9 REPLIES 9
Read only

amit_khare
Active Contributor
0 Likes
15,965

Below MD1 is the Modif ID.

Loop at screen.

If screen-group1 = 'MD1'.

screen-active = 0.

modify screen.

endif.

endloop.

double click on screen to get more options and press F1 to get detail help.

Read only

former_member195698
Active Contributor
Read only

Former Member
15,964

Novice,

have a look:

PARAMETERS: p_file1 TYPE c RADIOBUTTON GROUP a DEFAULT 'X'
USER-COMMAND uc01,
p_date TYPE c RADIOBUTTON GROUP a.

PARAMETERS: p_pres TYPE c RADIOBUTTON GROUP b MODIF ID 001,
p_appl TYPE c RADIOBUTTON GROUP b MODIF ID 001.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
IF screen-group1 EQ '001'.
IF p_file1 EQ 'X'.
screen-active = '1'.
ELSE.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

Amit.

Read only

0 Likes
15,964

Thanks for the reply. Example looks quite good. Please pardon my ignorance, could you clarify my doubts inline.

PARAMETERS: p_file1 TYPE c RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND uc01,

p_date TYPE c RADIOBUTTON GROUP a.

* Why is that when we remove the User-command, the screen isn't changing, where is uc01 being called or checked?

PARAMETERS: p_pres TYPE c RADIOBUTTON GROUP b MODIF ID 001,

p_appl TYPE c RADIOBUTTON GROUP b MODIF ID 001.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 EQ '001'.

*Does declaring two blocks of parameters create two screen objects? What will be the value of screen-group if it has not been defined, as in the case of first paramter block

IF p_file1 EQ 'X'.

screen-active = '1'.

ELSE.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Edited by: SAP Novice on Jul 1, 2008 7:38 PM

Read only

0 Likes
15,964

Novice,

now i would suggest you please take SAP help by pressing F1 on User-command.

am sure you will have more elaboratly.

Amit.

Read only

0 Likes
15,964

Thanks Amit.

Is there any one else here who could possibly answer my questions below?

PARAMETERS: p_file1 TYPE c RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND uc01,

p_date TYPE c RADIOBUTTON GROUP a.

** Why is that when we remove the User-command, the screen isn't changing, where is uc01 being called or checked?*

PARAMETERS: p_pres TYPE c RADIOBUTTON GROUP b MODIF ID 001,

p_appl TYPE c RADIOBUTTON GROUP b MODIF ID 001.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 EQ '001'.

*Does declaring two blocks of parameters create two screen objects? What will be the value of screen-group if it has not been defined, as in the case of first paramter block?

IF p_file1 EQ 'X'.

screen-active = '1'.

ELSE.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

0 Likes
15,964

Event will be triggered on selection of the radio button only if you attach "user - command" to the Parameter.

So unless you assign some command like "uc01" event will not be triggered and the code written in "at selection screen output" will not be executed.

You can check the triggered command from the field SY-UCOMM. (Click the radio button and check the value of sy-ucomm during debugging. the value wil be "UC01")

Screen Group '001' in the above example is used to group the fields together so as to change properties in a group or handle the fields in some manner together..

Read only

0 Likes
15,964

Hope this will work . try declaring selection screen and at selection screen.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-002.
PARAMETERS: pr_all  AS CHECKBOX DEFAULT 'X' USER-COMMAND uc01,
            pr_pen  AS CHECKBOX USER-COMMAND uc02,
            pr_appr AS CHECKBOX USER-COMMAND uc02,
            pr_rej  AS CHECKBOX USER-COMMAND uc02.
SELECTION-SCREEN END OF BLOCK b2.


AT SELECTION-SCREEN.
  lv_sy-ucomm = sy-ucomm.


AT SELECTION-SCREEN OUTPUT.
  CASE lv_sy-ucomm.
    WHEN 'UC01'.
      CLEAR: pr_pen,pr_appr,pr_rej.
    WHEN 'UC02'.
      CLEAR : pr_all.


    WHEN OTHERS.
  ENDCASE.


Read only

0 Likes
15,964

I don't understand how it answers the question!?