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?

Former Member
0 Likes
1,081

Hi all,

i ahve a check box at selection screen.

if it is 'X', i have to enable a parameter.

if i unchecked it...i need to disable it.

help me..

vkr.

8 REPLIES 8
Read only

paruchuri_nagesh
Active Contributor
0 Likes
1,039

hi

try this

REPORT demo_sel_screen_param_modif.

PARAMETERS: test1(10) TYPE c MODIF ID sc1,

test2(10) TYPE c MODIF ID sc2,

test3(10) TYPE c MODIF ID sc1,

test4(10) TYPE c MODIF ID sc2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'SC1'.

screen-intensified = '1'.

MODIFY SCREEN.

CONTINUE.

ENDIF.

IF screen-group1 = 'SC2'.

screen-intensified = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

reward if u find use ful

regards

Nagesh.Paruchuri

Read only

Former Member
0 Likes
1,039

hi

loop at screen.

if screen-name eq PARAMETER

if check_box eq 'X'.

screen-input = 1.

else.

screen-input = 0.

endif.

endloop.

Hope this helps you.

Regards,

Prasant

*reward if useful

Read only

Former Member
0 Likes
1,039

if p_chkbox = 'X'.

loop at screen.

if screen-group1 = 'G1'. " assign group G1 to that parameter which need to be *disabled by using MODIF ID G1 while declaring......

screen-invisible = '1'. " if needed to u....

screen-input = '0'. "if needed to u....

modify screen.

endif.

endloop.

endif.

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,039

Hi

IF U want hide that parameter do like this

LOOP AT SCREEN.

IF screen-name = 'po_name'.

screen-active = 0.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDLOOP.

If u want to hide the selection screen text also then debug the code capture the screen names corrosponding to that parameter and give all the screen names in the if condition.

If u r checking for multiple screen names then remove EXIT statement.

Regards,

Vinod.

Read only

0 Likes
1,039

Sorry forgot to mention event.

Code will come under AT SELECTION SCREEN OUTPUT.

Read only

Former Member
0 Likes
1,039

Hello,

LOOP AT SCREEN.

All fields of the current screen are stored in the system table SCREEN with their attributes. The LOOP AT SCREEN statement places this information in the header line of the system table. If you want to change the attributes, you must put back the changed header line with MODIFY SCREEN. However, you can only do this in the PBO module of a screen.

If you use this statement for step loop processing, the information (and any changes) apply only to the current steploop line. Outside step loop processing, the information for a step loop field applies to the complete column.

You can also modify fields in the loop processing of a table control using this loop statement. Unlike a step loop, modifications before the loop have no effect, since the system gets the initial values for the columns from the column table of the table view.

Step loop fields should never be changed after the corresponding step loop processing has been performed.

You can use the CONTINUE statement to leave the current loop pass prematurely and continue with the next loop pass.

eg :

loop at screen.

if screen-name = p_name

if p_box = 'X'.

screen-input = 1.

else.

-


endif.

endloop.

Regards,

LIJO JOHN

Read only

Former Member
0 Likes
1,039

Hi,

Check the below code.

selection-screen begin of block blk1 with frame.

PARAMETERS: ONE as checkbox default 'X' user-command rusr.

selection-screen end of block blk1.

selection-screen begin of block blk2 with frame.

parameters : USER LIKE USR02-BNAME DEFAULT SY-UNAME modif id Z1.

selection-screen end of block blk2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'Z1'. "Name field

IF one = 'X'.

SCREEN-INPUT = 1.

ELSE.

SCREEN-INPUT = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,039
hi VKR,

 chk this

REPORT ychatest2.

PARAMETERS : p_chk default 'X' USER-COMMAND abc.
PARAMETERS : p_matnr LIKE mara-matnr.

AT SELECTION-SCREEN OUTPUT.

  IF p_chk EQ 'X'.
    LOOP AT SCREEN.
      IF screen-name EQ 'P_MATNR'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-name EQ 'P_MATNR'.
        screen-input = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.