09-19-2008 8:36 AM
Hi Experts,
I have a function module that has its own screen. At the PAI upon pressing Exit or Cancel, I want to go back to the screen of the calling program that uses this function module. I think using the screen number alone of the calling program is not enough.
How can I go back to the screen of the calling program?
<removed_by_moderator>
Thanks,
LM
Edited by: Julius Bussche on Sep 19, 2008 10:46 AM
09-19-2008 8:39 AM
09-19-2008 8:40 AM
09-19-2008 8:47 AM
Hi Leo,
Try using RETURN.
RETURN.
It will take you back to the called program.
Regards
Karthik D
09-19-2008 8:55 AM
hi,
You can export the value 'A' to the memory and then import that in the screen program...
Export value to memory
Import value from memory
If you are using a global variable, which can be seen from both programs, then that's one solution.
The another solution, to use the global SAP memory.
EXPORT myvariable TO MEMORY ID 'MYVARIABLE'.
Then retrieve it like this:
EXPORT myvariable FROM MEMORY ID 'MYVARIABLE'.
09-19-2008 9:12 AM
Hi,
Check the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9db635c111d1829f0000e829fbfe/content.htm
Regards,
Bhaskar
09-19-2008 9:15 AM
09-19-2008 9:22 AM
Hi
Refer this example code which has been given in sap help
REPORT REP1 NO STANDARD PAGE HEADING.
DATA: ITAB TYPE I OCCURS 10,
NUM TYPE I.
SUBMIT REP2 AND RETURN.
IMPORT ITAB FROM MEMORY ID 'HK'.
LOOP AT ITAB INTO NUM.
WRITE / NUM.
ENDLOOP.
TOP-OF-PAGE.
WRITE 'Report 1'.
ULINE.
This program calls the following executable program (report):
REPORT REP2 NO STANDARD PAGE HEADING.
DATA: NUMBER TYPE I,
ITAB TYPE I OCCURS 10.
SET PF-STATUS 'MYBACK'.
DO 5 TIMES.
NUMBER = SY-INDEX.
APPEND NUMBER TO ITAB.
WRITE / NUMBER.
ENDDO.
TOP-OF-PAGE.
WRITE 'Report 2'.
ULINE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'MBCK'.
EXPORT ITAB TO MEMORY ID 'HK'.
LEAVE.
ENDCASE.
Regards,
Sravanthi
09-19-2008 9:45 AM
Hi,
*Define ok_code
DATA: ok_code LIKE sy-ucomm.
*In Module pai...do this....
MODULE pai INPUT.
to react on oi_custom_events:
CALL METHOD cl_gui_cfw=>dispatch.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'BACK'.
LEAVE TO SCREEN 0. "this will take u back to previous screen
WHEN OTHERS.
do nothing
ENDCASE.
CLEAR ok_code.
ENDMODULE.
Hope this helps you.
Regards,
Rashmi
09-19-2008 9:50 AM