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

ABAP Program shows a Screen which calls a Function which call another screen

rodrigok
Explorer
0 Kudos
343

Hi,

I wrote a program which shows a screen.

I calls a function which shows its own screen.

When LEAVE TO SCREEN 0 is executes in the function the screen of the program is not shown again.

***

Program:

CALL SCREEN 0100

In PAI: CALL FUNCTION 'XXX'

Function 'XXX'

CALL SCREEN 0101

In PAI: LEAVE TO SCREEN 0

It returns to programa but the screen 0100 is not shown.

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
317

First please debug. Also, what means 0100 is not shown? What is shown? Where do you go after CALL FUNCTION 'XXX'? Make sure a next screen is defined in the attributes of the dynpro 0100, and that you don't execute LEAVE TO SCREEN 0 or SET SCREEN 0 during the PAI of screen 0100. There are lots of other reasons why a screen is not displayed (LEAVE PROGRAM, etc.)

Read only

0 Kudos
304

About your question: "what means 0100 is not shown?"

After LEAVE TO SCREEN 0 the screen 0101 is shown again. Instead of 0100.

Read only

0 Kudos
192

Solved!

In PAI I forgot to purge the ALV Object instance before LEAVE TO SCREEN 0.

So it persisted despite LEAVE TO SCREEN 0.

MODULE pai0101 INPUT.
  IF sy-ucomm EQ 'SAIR'.
      IF grid1 IS NOT INITIAL.
        CALL METHOD grid1->free.
        CLEAR: grid1, g_handler.
      ENDIF.
    LEAVE TO SCREEN 0.
  ENDIF.
ENDMODULE.