‎2013 Sep 05 3:22 PM
Hi ,
In my ALV report I have one selection screen and two normal screen.
double click
In this report run like : selection screen---> Screen (1000) ---> screen (2000).
screen (1000)again <,-- Back <--- Back
From screen 1000 to selection screen it giving dump ( from custome controller object ) if I press Back button.
In debug mode I checked, if I click Back button it again come from PAI(1000) to PBO(1000) again.
In PAI module of 1000 I wrote :
LEAVE TO SCREEN 0.
I also try with : set sclection screen and call transaction ,but giving same dump from selection screen.
Please help.
Thanks,
SK
‎2013 Sep 05 4:50 PM
try
Leave to transaction.
leave to screen 0 should work. The issue might be with the selection screen components also.
Does this happen every time you click the back button from screen 1000?
‎2013 Sep 05 5:22 PM
‎2013 Sep 06 6:05 AM
Did you try changing the screen numbers to 100 and 200 as suggested by Eitan? That is a very probable reason.
‎2013 Sep 06 12:32 PM
I have change the screen name like :
double click
In this report run like : selection screen---> Screen (0100) ---> screen (0200).
screen (1000)again <,-- Back <--- Back
But still not working
‎2013 Sep 05 5:01 PM
Hi,
As far as I know screen 1000 is generated from the selection parameters .
So I believe that you need to leave screen 1000 alone .
Create screens 100 and 200 Using the screen painter .
In this example I was doing drill down from screen 100 to screen 200 .
So at some point in screen 100 (Hot spot event on cl_gui_alv_gri) I execute "LEAVE TO SCREEN 200 ."
"MODULE pai_exit AT EXIT-COMMAND" is triger when you set a function as exit.
Some Code :
START-OF-SELECTION .
PERFORM at_start_of_selection .
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
FORM at_start_of_selection .
CALL SCREEN 100 .
ENDFORM . "at_start_of_selection
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Screen 100 and 200 logic:
PROCESS BEFORE OUTPUT.
MODULE at_pbo .
*
PROCESS AFTER INPUT.
MODULE at_pai_exit AT EXIT-COMMAND.
MODULE at_pai_process .
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Modules
MODULE at_pai_exit INPUT.
PERFORM at_pai_exit .
ENDMODULE . "at_pai_exit INPUT
*----------------------------------------------------------------------*
MODULE at_pai_process INPUT .
PERFORM at_pai_process .
ENDMODULE . "at_pai_process INPUT
*----------------------------------------------------------------------*
MODULE pai_exit INPUT.
ok_save = ok_code .
CASE ok_save .
WHEN 'EXIT' .
LEAVE PROGRAM .
WHEN 'BACK' OR 'CANCEL' .
CASE syst-dynnr .
WHEN 0100 .
LEAVE TO SCREEN 0 .
WHEN 0200 .
LEAVE TO SCREEN 0100 .
ENDCASE .
ENDCASE .
ENDMODULE. "pai_exit INPUT
*----------------------------------------------------------------------*
MODULE pai_process INPUT.
ok_save = ok_code.
CASE syst-dynnr .
WHEN 0100 .
ENDCASE .
ENDMODULE. "pai_process INPUT
*----------------------------------------------------------------------*
FORM at_pai_process .
CASE syst-dynnr .
WHEN 0100 .
PERFORM at_pai_process_100 .
ENDCASE .
ENDFORM . "at_pai_process
*----------------------------------------------------------------------*
FORM at_pai_process_100 .
ok_save = ok_code .
ENDFORM . "at_pai_process_100
*----------------------------------------------------------------------*
Regards.
Eitan.
‎2013 Sep 05 5:01 PM
Hi SK ,
Do not use Leave to screen 0.
U can use leave to screen 1000.or call screen 1000.
Thanks & Regard's,
Hiriz..
‎2013 Sep 06 5:32 AM
Hi,
Screen 1000 is for standard selection screen. May be there occur a clash between the screen numbers because of this. Try giving other numbers for two normal screen. Custom screen numbers starting from 9000.
selection screen - 1000 (default one when you design).
first screen - 9001.
second screen - 9002.
PAI of screen 9001.
check the user command. when user command triggered is 'BACK', LEAVE TO SCREEN 0. This directs you to the selection screen.
PAI of screen 9002.
check the user command. when user command triggered is 'BACK', LEAVE TO SCREEN 0. This directs you to the screen 9001.
Regards,
Shahanaz.
‎2013 Sep 06 9:23 AM
Hi,
Don't create Normal screen with screen no 1000 as it is default screen no for selection screen.
Create other than 1000 and use LEAVE TO SCREEN 0 in BACK Button.
Assume 1st screen is selection screen(1000) -> 2nd screen screen no (2000)
if you want to come back to screen 1000 from screen 2000 in PF status of screen 2000 in BACK button write LEAVE TO SCREEN 0.
Points appreciated!!
Thanks & Regards,
Lokesh R
‎2013 Sep 06 12:34 PM
Hi lokesh ,
I have changed my screen sequence as below :
double click
selection screen---> Screen (0100) ---> screen (0200).
<,-- Back <--- Back
But still now it is not working
‎2013 Sep 06 1:30 PM
‎2013 Sep 06 2:21 PM
Hi ,
Can you post your code that deal with the screen flow ?
- Screen flow logic .
- Module code .
- Forms (if used)
Regards.
Eitan.
‎2013 Sep 06 4:52 PM
Selection Screen
----------------------------------
start-of-selection
call screen 01000.
Screen 0100
---------------
PBO.
Module alv_display. " alv display , double click
PAI
-------
CASE SY-UCOMM.
WHEN 'BACK'
LEAVE TO SCREEN 0.
WHEN 'EXIT'
LEAVR PROGRAM.
WHEN 'CANCEL'
LEAVE PROGRAM
SCREEN 0200.
-------------------------
PBO.
Module alv_display1 . " New alv
PAI.
WHEN 'BACK'
CALL SCREEN 0200.
WHEN 'EXIT'
LEAVR PROGRAM.
WHEN 'CANCEL'
LEAVE PROGRAM
‎2013 Sep 06 6:08 PM
Hi ,
I do like to help but it is better to be able to look at actual code .
But things that did caught my eyes:
Regards.
Eitan.
‎2013 Sep 07 7:38 AM
Hi Eitan,
Sorry it's my typeing mistake :
Selection Screen
----------------------------------
start-of-selection
call screen 0100.
Screen 0100
---------------
PBO.
Module alv_display. " alv display , double click
PAI
-------
CASE SY-UCOMM.
WHEN 'BACK'
LEAVE TO SCREEN 0.
WHEN 'EXIT'
LEAVR PROGRAM.
WHEN 'CANCEL'
LEAVE PROGRAM
SCREEN 0200.
-------------------------
PBO.
Module alv_display1 . " New alv
PAI.
WHEN 'BACK'
CALL SCREEN 0100.
WHEN 'EXIT'
LEAVR PROGRAM.
WHEN 'CANCEL'
LEAVE PROGRAM
‎2013 Sep 07 8:57 AM
Is the exit and cancel button working?'
PAI.
WHEN 'BACK'
CALL SCREEN 0100.
Here dont call screen 100.
Instead use either of the following statements
LEAVE TO SCREEN 100.
or
LEAVE TO SCREEN 0.
‎2013 Sep 07 9:06 AM
Hi ,
Things to check:
Are you using:
MODULE at_pai_exit AT EXIT-COMMAND like I do ?
Regards.
Eitan.
‎2013 Sep 07 9:12 AM
‎2013 Sep 07 9:19 AM
Hi ,
Do not be ashamed to copy the code that I posted there is no copyright here.....
‎2013 Sep 12 9:18 AM
Hi Eitan,
At first thaks for ur time and post.
Second thing Your solution is not working for my case .
This problem is now solve .
Thanks you again.
‎2013 Sep 12 12:45 PM
Hi ,
Can you share your solution for the benefit of the common knowledge base ?
Regards.
Eitan.
‎2013 Sep 12 9:43 AM
Hi,
Could you please share the dump screenshot.
Best Regards,
Abirami
‎2013 Sep 13 5:55 AM
hi,
in all screens the event starts with pbo where u see what should be displayed on the screen and after that it goes to the pai when an enter key pressed or a button is pressed to process the output. Once the pai is over again it goes to the pbo and dispay the final result.
If you are using subscreens then the event goes like this. pbo of activated screen , pai of activated screen, pbo of main screen,pai of main screen pbo of activated screen.
if you want to go the screen from which you navigated then give leave to screen 0.