ABAP Dynpro: Move CALL SCREEN Outside LOOP AT SCREEN

A custom dynpro can become unresponsive when CALL SCREEN runs inside LOOP AT SCREEN. SAP KBA 3736450 describes this pattern as a possible cause of endless looping without an error message.

Why the structure is problematic

LOOP AT SCREEN iterates the current screen’s elements and their attributes. CALL SCREEN starts a nested screen sequence, interrupting that flow while the screen iteration is still active.

Separate inspection from navigation

Keep LOOP AT SCREEN for reading or changing the current screen’s properties. If an element check determines that another screen is needed, set a flag and evaluate it after ENDLOOP.

Refactor the surrounding control flow where necessary rather than using the SCREEN table as a general-purpose application loop. Preserve the intended PBO/PAI behavior when moving navigation.

Retest the affected action

Repeat the exact user action that previously triggered the loop and verify both the screen transition and return path. Also test cases where the flag is not set.

SAP Help: Setting Attributes Dynamically

SAP Note

SAP Note 3736450

You May Also Like

Leave a Reply?