‎2012 Mar 02 5:34 AM
Dear Experts,
I'm new to Abap and have a question concerning screen navigation: in my program I have a selection screen 0100 (created with SELECTION-SCREEN BEGIN OF SCREEN 100...., and called with CALL SELECTION-SCREEN 100) then, when pressing Execute (F8) the logics works and present the result via WRITE statements.
Up to here, no problems.
Now I would like that, when I press 'Back' (F3), I'm returning to the selection screen, for new selections. Instead, if I press 'Back' I'm going really back to the SE38 transaction, for instance, and then I need to run the program again to have a new selection.
This is maybe a basic question, but I already searched on the internet without success, and I'm really frustrated not being able to find a solution to this.
Hope you can help me.
Best regards,
Jepi
‎2012 Mar 02 5:54 AM
‎2012 Mar 02 6:15 AM
Now I would like that, when I press 'Back' (F3), I'm returning to the selection screen, for new selections. Instead, if I press 'Back' I'm going really back to the SE38 transaction, for instance, and then I need to run the program again to have a new selection.
This is maybe a basic question, but I already searched on the internet without success, and I'm really frustrated not being able to find a solution to this.
In your PF status for 'BACK' do
case sy-ucomm.
when 'back'.
leave to screen 0.
‎2012 Mar 02 6:26 AM
Hi,
Create a module with AT-EXIT COMMAND.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
Regards,
Danish.
‎2012 Mar 02 7:48 AM
Dear all,
Thank you for replying.
@ Danish: Could you please tell me where shall I create the module?
Do I have to create a new screen, say 200, and there write the result from the program, and in its flow logic add the module with AT-EXIT COMMAND?
Thanks again.
JF
‎2012 Mar 02 6:39 AM
Hi,
By writing "leave to screen 0100." will help you solve this problem.
Hope this helps.
Regrads,
Gaurav.
‎2012 Mar 02 7:11 AM
Well since it is an executable program i guess you cannot use GUI statuses or Exit module. Well normally if you hit the back button it should return to the program. may be some small logic error in your program if you can post your program here we could check.
‎2012 Mar 02 8:18 AM
Hi ,
in same screen write module like below
PROCESS AFTER INPUT.
MODULE BACK AT EXIT-COMMAND.
in include program.
module back.
CASE SY-UCOMM.
WHEN u2018BACKu2019.
LEAVE TO SCREEN 100.
ENDCASE.
‎2012 Mar 02 10:02 AM
Hi Kalyan,
Thank you for answering.
In reality, the screen 100 flow logic is automatically created and has already a MODULE %_BACK AT EXIT-COMMAND.
Maybe, have I to create a new screen, say 200, and there put my new flow logic?
Thanks again
JF
‎2012 Mar 02 10:15 AM
Hi,
I think you no need to create another screen.
You can clear the field as you click on BACK button after displaying your results, is that ok for you?
WHEN 'BACK'.
LEAVE TO SCREEN 100.
cx_input = ''. " if a checkbox is there
CLEAR i_input." clear input field as i_input is input field for you
Ben
‎2012 Mar 02 10:22 AM
For Selection Screen you need not call screen as 100 and all( default screen 1000 is present ) , We can use it by declaring parameters , select-options etc directly .If u have to manipulate Selection screen then u can use Selection Screen EVENTS for more screen navigation and calculations.
If you are using multiple selection screens then set navigation using event
At selection-screen output.
set pf-status '100'. "Set fcode for back button as 'BACK'.
at selection-screen
CASE sscrfields-ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
Edited by: Jacob K. George on Mar 2, 2012 11:25 AM