a month ago
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.
a month ago
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.)
a month ago
About your question: "what means 0100 is not shown?"
After LEAVE TO SCREEN 0 the screen 0101 is shown again. Instead of 0100.
a month ago - last edited a month ago
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.