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: 

LOOP AT SCREEN calling repeatedly

kirankumark2
Participant
0 Kudos
202

we have two Quality systems named Q10 and R10 as per our landscape. there is a transaction code named HUPAST. In this transaction we added a Logic to trigger a popup based on on SCREEN-NAME field inside the LOOP AT SCREEN statement using EXPLICIT ENHANCEMENT for one of the screens. In both the systems the POPUP is getting triggered for the LAST iteration of the LOOP statement. once we confirmed in the POPUP in Q10 system the program is coming out of the loop and executing further lines whereas in R10 system after POPUP again LOOP AT SCREEN is continuing repeatedly and it is not ending.

Some body clarify me what causes the repeated execution of LOOP AT SCREEN statement. code is pasted below

LOOP AT SCREEN.
IF GF_PACK+1(1) = 'X'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
CONTINUE.
ENDIF.
CASE SCREEN-NAME.
WHEN 'GF_SCANQUANTITY'.
IF G_FLAG_QUAN IS INITIAL.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
WHEN 'GF_SCANCHARGE'.
IF G_FLAG_CHARGE IS INITIAL.
SCREEN-INPUT = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
WHEN OTHERS.

ENHANCEMENT-POINT LHU_PACKING_STATION106_04 SPOTS ES_SAPLHU_PACKING_STATION.

ENHANCEMENT 1 Z_POPUP_106_04. "active version
CASE SCREEN-NAME.
WHEN 'GF_SCANUNIT'.
IF gs_profile-plant = '3100' OR gs_profile-plant = '2200' OR

gs_profile-plant = '2300' OR gs_profile-plant = '2500' OR

gs_profile-plant = '2510' OR gs_profile-plant = '2520' OR

gs_profile-plant = '2530' OR gs_profile-plant = '2540' OR

gs_profile-plant = '2550' OR gs_profile-plant = '3500' OR

gs_profile-plant = '3510' OR gs_profile-plant = '3600' OR

gs_profile-plant = '3400'.
IF G_FLAG_QUAN IS NOT INITIAL.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
TITEL = 'Quantité'
textline1 = 'Veuillez saisir une quantité manuellement svp'
START_COLUMN = 25
START_ROW = 6.
ENDIF.
ENDIF.
ENDCASE.
ENDENHANCEMENT.
ENDCASE.
ENDLOOP.

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos
108

My first reaction is to NOT use this enhancement option which should be obviously reserved to change SCREEN values, not to do anything else. Are you sure there is no other position anywhere else to place your custom code?

chaouki_akir
Contributor
0 Kudos
108

What is strange is that the behaviour is depending on the system.

Put break-point on instruction CALL SCREEN or SET SCREEN and do step by step debug. You can then give us explanations (may be show us the debugger pile stack)

kirankumark2
Participant
0 Kudos
108

Hi Rossi,

Not only this many Enhancements are exists under this spot and the same is working Fine in Q10 system, in R10 only PBO (Process Before Output is triggering repeatedly)