I have a report where I have a normal selection-screen plus a SELECTION-SCREEN: FUNCTION KEY 1 to display another button.
If user uses this extra button a screen 100 it's called where I have an ALV.
This ALV is using CL_GUI_CONTAINER=>SCREEN0 as parent to display it in fullscreen.
Well, if I hit BACK in this screen 100 I put a LEAVE TO SCREEN 0 but its not returning to the selection screen, instead its returning to the same screen 100 but with the status of the selection-screen, and if I use BACK again then is leaving the program.
I've tried changing the "Next Screen" to blank or 1000 but is not working.
If I change the CL_GUI_CONTAINER=>SCREEN0 with a normal cl_gui_custom_container then all is working fine.
Do you know what can be the problem?
You should avoid using CL_GUI_CONTAINER=>SCREEN0, it's more a trick for demonstration (to have short code/quick coding/avoid creating a dynpro to include controls). What you experience is a consequence of using CL_GUI_CONTAINER=>SCREEN0 and not freeing it (or not giving a dynpro lifetime).
For production programs, you should create dynpro with custom container in it, or linking a docking control to it (for better handling with wide screens).