‎2008 Jul 11 7:35 AM
Hi,
I wanted to call another program from within a program.I used SUBMIT
‎2008 Jul 11 7:36 AM
If the other program has the Transaction code.. Use Call transaction statement
‎2008 Jul 11 7:37 AM
I wanted to call another program from within my program.I used SUBMIT but it was giving some runtime error.I wanted to know if there was any other method without using SUBMIT
‎2008 Jul 11 7:47 AM
Hi,
Except SUBMIT you can use CALL TRANSACTIOn to call another program.
Regards,
Sujit
‎2008 Jul 11 7:58 AM
Hi Shah,
I think the program you are having in the submit statemant is not available or not active. Check the status of that program. And another thing is that you check your Export and Import statements properly & check the types of the variables you are passing . Because sometimes it goes for a dump.
To call another program you have to use SUBMIT only. As far as I know this is the direct way to call a program Just make the checks mentioned above and your problem is solved.
Regards,
Swapna.
‎2008 Jul 11 7:41 AM
Hi
If you want to comeback to the calling program then use :
*SUBMIT ..... AND RETURN.*IF you do not want to comeback to the calling program than use :
*LEAVE PROGRAM*Hope this will helpful to you.
With Regards
Nikunj Shah
‎2008 Jul 11 7:41 AM
Hiii!
Check out this sample code.
Actually they are two programs just copy paste them in different programs
REPORT z_abap_memory.
DATA:
w_carrid TYPE spfli-carrid,
BEGIN OF fs_spfli,
carrid LIKE spfli-carrid,
connid LIKE spfli-connid,
fltime LIKE spfli-fltime,
END OF fs_spfli.
DATA:
t_spfli LIKE
TABLE OF
fs_spfli.
SELECT-OPTIONS:
s_carrid FOR w_carrid.
START-OF-SELECTION.
PERFORM get_spfli.
PERFORM disp_spfli.
AT LINE-SELECTION.
IF sy-lsind EQ 1.
EXPORT t_spfli TO MEMORY ID 'ABC'.
SUBMIT z_ABAP_MEMORY1 AND RETURN.
ENDIF.
FORM get_spfli .
SELECT carrid
connid
fltime
FROM spfli
INTO TABLE t_spfli
WHERE carrid IN s_carrid.
ENDFORM. " get_spfli
* NEXT PROGRAM
REPORT z_abap_memory1.
DATA:
BEGIN OF fs_spfli,
carrid LIKE spfli-carrid,
connid LIKE spfli-connid,
fltime LIKE spfli-fltime,
END OF fs_spfli,
fs_fl LIKE fs_spfli.
DATA:
BEGIN OF fs_flight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
END OF fs_flight.
DATA:
t_spfli LIKE
TABLE OF
fs_spfli.
DATA:
t_fl LIKE t_spfli.
DATA:
t_flight LIKE
TABLE OF
fs_flight.
IMPORT t_spfli FROM MEMORY ID 'ABC'.
t_fl = t_spfli.
SELECT carrid
connid
fldate
FROM sflight
INTO TABLE t_flight
FOR ALL ENTRIES IN t_spfli
WHERE carrid = t_spfli-carrid
AND connid = t_spfli-connid.
LOOP AT t_flight INTO fs_flight.
WRITE: / fs_flight-carrid,
fs_flight-connid,
fs_flight-fldate.
ENDLOOP.
Regards
Abhijeet Kulshreshtha
Edited by: Abhijeet Kulshreshtha on Jul 11, 2008 8:41 AM
‎2008 Jul 11 7:48 AM
Hi Shah,
There are two ways to call a transaction without using submit.
Call Transaction tcode
Check this link for Call Transaction
http://members.tripod.com/sap_abap/call_tra.htm
Leave to transaction tcode
Check this link for Leave to transaction tcode
http://www.geocities.com/siliconvalley/campus/6345/leave_03.htm
Hope this helps you.
Regards,
Chandra Sekhar
‎2008 Jul 11 7:49 AM
‎2008 Jul 11 7:55 AM
Hi,
Create a transaction code for program 2 ,
and call the t-code in program 1 using " call transaction t-code'.
hope this will work for you.
‎2008 Jul 11 1:56 PM
Why not tell us your exact error? We don't know what your code contains.