Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HOW TO CALL ANOTHER PROGRAM WITHOUT USING SUBMIT

Former Member
0 Likes
2,864

Hi,

I wanted to call another program from within a program.I used SUBMIT

10 REPLIES 10
Read only

Former Member
0 Likes
2,046

If the other program has the Transaction code.. Use Call transaction statement

Read only

Former Member
0 Likes
2,046

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

Read only

0 Likes
2,046

Hi,

Except SUBMIT you can use CALL TRANSACTIOn to call another program.

Regards,

Sujit

Read only

0 Likes
2,046

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.

Read only

Former Member
0 Likes
2,046

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

Read only

Former Member
0 Likes
2,046

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

Read only

Former Member
0 Likes
2,046

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

Read only

Former Member
0 Likes
2,046

Hi,

Use the function module ISU_M_REPORT_SUBMIT.

Thanks,

Ravi

Read only

Former Member
0 Likes
2,046

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.

Read only

Former Member
0 Likes
2,046

Why not tell us your exact error? We don't know what your code contains.