Call Transaction statement retains the calling program and it's data .After exiting the called transaction ,processing is resumed in the calling program after the call.
Example:
SET PARAMETER ID: 'PLN' FIELD gwa_plancreated-plnnr,
'MAT' FIELD gwa_plancreated-matnr,
'WRK' FIELD gwa_plancreated-werks,
'PAL' FIELD gwa_plancreated-plnal.
CALL TRANSACTION 'QP03' AND SKIP FIRST SCREEN.
LEAVE TO TRANSACTION : The control leaves the calling program permanently and moves to the called transaction.Upon exiting the called transaction, processing is not resumed in the calling program
Example :
Report ztest1.
CALL TRANSACTION 'MM01'.
WRITE 'Hi'.
Output : Hi
This output can be seen by you if you press back/exit/cancel button in MM01 transaction.
Report ztest2.
LEAVE TO TRANSACTION 'MM01'.
WRITE 'HELLO'.
Nothing will be printed on output screen as the program quits the calling program and if you press back/exit/cancel button in MM01 transaction , control comes back to the point from where you started the execution.
SUBMIT : This statement accesses an executable program (report) and control won't come back to the calling program output screen after execution of the called program .
SUBMIT AND RETURN : Using this statement the control comes back to the output screen of calling program after the execution of called program.
Example :
Report ztest.
WRITE / 'Test'.
Report zsubmit.
WRITE / 'Hi'.
SUBMIT ztest.
Output :
Test
Press back button
Control comes back to the point where execution of calling program started without displaying the output screen of calling program.
Report zreturn.
WRITE / 'Hi'.
SUBMIT ztest.
Output :
Test
Press back button
Control comes back to output screen of calling program.
Output :
Hi
No comments:
Post a Comment