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

optimize performance on loop at screen

Former Member
0 Likes
722

Hiii

on my selection screen i have lot's of condition where when i select one radio button i must grey a field

In my at selection screen on output i have at least 4 loop at screen.

please advise is there a way to optimise or group the loop at screen

a sample of my code is as follow


  IF RB_rep_ut IS NOT INITIAL.  

    LOOP AT SCREEN.
      IF screen-group1 EQ gc_gpb.
        screen-input = gc_zero  .
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

  IF RB_rep IS NOT INITIAL.  

    LOOP AT SCREEN.
      IF screen-group1 EQ gc_gpC.
        screen-input = gc_zero  .
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

  IF s_comp[] IS NOT INITIAL.  
    LOOP AT SCREEN.
      IF screen-group1 EQ gc_gpa.
        screen-input = gc_zero.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

1 ACCEPTED SOLUTION
Read only

former_member242255
Active Contributor
0 Likes
611

you have to do the same way how you are doing...anyway as you are separating the logic based on radio buttons it should not be aproblem as any one of the loop at screen will be executed.

4 REPLIES 4
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
611

As you are using radio buttons so only one of the LOOPs will be processed.

With the select-otion , you have to do this anyway.

Read only

former_member242255
Active Contributor
0 Likes
612

you have to do the same way how you are doing...anyway as you are separating the logic based on radio buttons it should not be aproblem as any one of the loop at screen will be executed.

Read only

0 Likes
611

ok the radio button is fine

but what about the check box


if cb_b1 EQ 'X'.
 loop at screen 
 endloop.
endif.

if cb_b2 EQ 'X'.
 loop at screen 
 endloop.
endif.

if cb_b3 EQ 'X'.
 loop at screen 
 endloop.
endif.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
611

Hi,

Try using it this way:


loop at screen.
  if cb_b1 = 'X'.
  endif.

  if cb_b2 = 'X'.
  endif.

  if cb_b3 = 'X'.
  endif.

  modify screen.
endloop.

Hope this helps you.

Regards,

Tarun