2009 Jan 19 6:00 AM
Hi Expert..
Is it possible to know the previous screen number? From which screen this present screen has called ? just similar to u201CLEAVE TO SCREEN 0u201D. I want to know the last screen number.
Could you please suggest how I will able to get that screen number ?
Thanks in advance.
Regards
Satrajit.
2009 Jan 19 6:09 AM
Hi
An alternative is to take a variable of type sy-dynnr.
And when you leave from screen1 to screen2 at any user command, then assign the current screen number to this variable and control moves to the next screen.
Now you can use this variable on the next screen (presently current screen) to access the previous screen number (from which the present screen was called).
DATA : v_prev_screen TYPE sy-dynnr.
At any user command:-
v_prev_screen = sy-dynnr.
CALL SCREEN 8002. " or LEAVE TO SCREEN 8002
Now on the next screen 8002, you can access the variable v_prev_screen to the previous screen number.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
2009 Jan 19 6:09 AM
Hi
An alternative is to take a variable of type sy-dynnr.
And when you leave from screen1 to screen2 at any user command, then assign the current screen number to this variable and control moves to the next screen.
Now you can use this variable on the next screen (presently current screen) to access the previous screen number (from which the present screen was called).
DATA : v_prev_screen TYPE sy-dynnr.
At any user command:-
v_prev_screen = sy-dynnr.
CALL SCREEN 8002. " or LEAVE TO SCREEN 8002
Now on the next screen 8002, you can access the variable v_prev_screen to the previous screen number.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
2009 Jan 19 6:27 AM
Hi Tarun Gambhir,
Thanks for your opinion to this problem. But here I have to declare a new global variable to access the screen number from the next screen. Without using a global variable, how can I do this ? Please suggest ..
Anyway thanks a lot for your solution.
Regards
Satrajit.