‎2009 Nov 24 5:30 AM
Salute.
I have a program which contains 3 screens:
1st -- selection screen.
2nd -- my screen, I called it 1002, When I press F8 button on I get on it. I am using cl_gui_alv_grid there with my own buttons. So when I press MY OWN the save button I get the 3d screen
3d -- my own screen with some labels (screen name 1001).
So when i press BACK button on the third screen I want to back on selection screen and skip second screen, but I can't, I think the problem is in the cl_gui_alv_grid because I use custom grid handler:
METHOD handle_user_command.
DATA :
ls_selected TYPE lvc_s_roid,
lt_selected TYPE lvc_t_roid.
CASE e_ucomm.
WHEN 'QSAVE'.
PERFORM save_data.
CALL SCREEN 1001.
WHEN OTHERS.
ENDCASE.
ENDMETHOD. "handle_user_command
Thank You.
Edited by: kernel.panic on Nov 24, 2009 6:31 AM
‎2009 Nov 24 8:11 AM
Hi,
Did you program for the BACK button on the selection screen?
You can find the PBO and PAI for the selection screen.
Code for your button there.
‎2009 Nov 24 5:39 AM
Save Our Environment. Save Yourself.
Hi Kernel,
Try writing code for BACK also, as calling the first screen directly, as you wrote the code for QSAVE.
- I'm not an environmentalist. I'm an Earth warrior.
‎2009 Nov 24 5:46 AM
‎2009 Nov 24 5:49 AM
Save Our Environment. Save Yourself.
Hi Kernel,
Try giving
LEAVE TO SCREEN xxxx.
- I'm not an environmentalist. I'm an Earth warrior.
‎2009 Nov 24 5:54 AM
Hi,
Try this
IF SY-UCOMM EQ 'BACK'.
CALL SELECTION-SCREEN 1000.
ENDIF.
‎2009 Nov 24 5:51 AM
Hi Kernal,
To go back to the First Screen (Selection Scree) use
LEAVE TO SCREEN 0. " This makes the Program to go back from where it had startedor Create a Tcode for your program
CASE e_ucomm.
WHEN 'BACK'.
LEAVE TO TRANSACTION 'YOUR TCODE HERE' . " This will take you back to your Selection Screen
WHEN 'QSAVE'.
PERFORM save_data.
CALL SCREEN 1001.
WHEN OTHERS.
ENDCASE.Cheerz
Ram
‎2009 Nov 24 5:59 AM
Hi Kernel,
try this:
When 'BACK'.
CALL SELECTION-SCREEN <dynnr- ur selection-screen number>.
Regards,
Swarna Munukoti
‎2009 Nov 24 6:23 AM
Thank you for your answers, but
LEAVE TO TRANSACTION 'YOUR TCODE HERE' works but selection screen values not retrieved.
CALL SELECTION-SCREEN 1000. works too, but when I get on the selection screen and press there BACK button it will returned me to the previous screen (1001 in my case)
There is interesting thing: if I use standart SAVE button in the screen 1001 and If I set SET SCREEN 0. in the 1002 screen initialization the BACK button will return me on the selection screen, Exactly what I wanted. But I use custom save button on the grid I think it rewrites the state or something like and operator SET SCREEN 0.doesn't work in that case.
‎2009 Nov 24 6:32 AM
Hi,
Try using:-
SET SCREEN 1000.
LEAVE SCREEN.
Hope this helps you.
Regards,
Tarun
‎2009 Nov 24 6:43 AM
Hi,
CALL SELECTION-SCREEN 1000. works too, but when I get on the selection screen and press there BACK button it will returned me to the previous screen (1001 in my case)
For the back button present in the scelection screen write
Leave Program.
Then it will come out of the screens.
Regards,
Swarna Munukoti
‎2009 Nov 24 6:49 AM
‎2009 Nov 24 7:01 AM
Hi Kernel,
What I mean to say is:
For teh BACK button on 3rd screen write:
CALL SELECTION-SCREEN <dynnr>.
For the BACK button on selection screen write:
LEAVE PROGRAM.
Regards,
Swarna Munukoti.
Edited by: Swarna Munukoti on Nov 24, 2009 8:02 AM
Edited by: Swarna Munukoti on Nov 24, 2009 8:06 AM
‎2009 Nov 24 7:27 AM
‎2009 Nov 24 7:51 AM
BACK button doesn't work on the selection screen if I call selection screen programmatically
‎2009 Nov 24 10:21 AM
Hi,
Yes, when you called back button from selection screen, the PAI of thrid screen is getting called. So it is not wokring
Try this one:
Declare a flag globally: fg_selscrn.
Now in third screen PAI:
when 'BACK'.
if fg_selscrn is initial.
fg_selscrn = 'X'.
CALL SELECTION-SCREEN <dynnr> .
else.
clear fg_selscrn.
LEAVE PROGRAM.
endif.
Regards,
Swarna Munukoti.
‎2009 Nov 24 6:38 AM
‎2009 Nov 24 8:11 AM
Hi,
Did you program for the BACK button on the selection screen?
You can find the PBO and PAI for the selection screen.
Code for your button there.
‎2009 Nov 30 1:25 PM
Before displaying the second screen, you can try using the following statement:
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
By doing this, the control will go back to your selection screen and the you can call the required screen for ALV.
So the sequence will be as follows:
1. Execute the Report
2. Call the screen or Do the Processing
3. Before calling the third screen leave back to list processing and return to screen 0.
4. Call the third screen.
now you press back button the control goes back into the first screen.
‎2009 Dec 01 7:24 AM
Hi.
Just use
when 'BACK'.
leave to screen 0.
this will work fine.
‎2011 Sep 21 3:57 PM
1) To return to the selection screen use this:
LEAVE TO SCREEN 0.
2) To quit the selection screen via the back button:
For the selection screen you have a specific event to handle the quiting of your program.
Use this for exiting the selection screen.
----
AT SELECTION-SCREEN ON EXIT-COMMAND.
----
LEAVE PROGRAM.
The combination of these two did the trick for me.
Best regards,
Tom.