Skip to Content
author's profile photo Former Member
Former Member

How to call one program from another program

Hai,

How to call one program through another program.

Example.

************

I have two programs 1.ZPROG1 2. ZPROG2.

When i execute ZPROG1 at that time it should call ZPROG2.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:09 AM

    Hi,

    use

    SUBMIT, SET PARAMETER ID/GET PARAMETER ID

    commands.

    hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:10 AM

    Hi,

    use SUBMIT ZPROG2 AND RETURN

    in ZPROG1

    Regards

    Pankaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:10 AM

    Hi,

    Use below code :

    SUBMIT <report name>

    VIA SELECTION-SCREEN

    USING SELECTION-SET 'VARIANT1'

    USING SELECTION-SETS OF PROGRAM 'Program name'

    AND RETURN.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:11 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:12 AM

    Hi ,

    u can use submit statement to call a program .

    DATA: text TYPE c LENGTH 10,

    rspar_tab TYPE TABLE OF rsparams,

    rspar_line LIKE LINE OF rspar_tab,

    range_tab LIKE RANGE OF text,

    range_line LIKE LINE OF range_tab.

    ...

    rspar_line-selname = 'SELCRIT1'.

    rspar_line-kind = 'S'.

    rspar_line-sign = 'I'.

    rspar_line-option = 'EQ'.

    rspar_line-low = 'ABAP'.

    APPEND rspar_line TO rspar_tab.

    range_line-sign = 'E'.

    range_line-option = 'EQ'.

    range_line-low = 'H'.

    APPEND range_line TO range_tab.

    range_line-sign = 'E'.

    range_line-option = 'EQ'.

    range_line-low = 'K'.

    APPEND range_line TO range_tab.

    SUBMIT report1 USING SELECTION-SCREEN '1100'

    WITH SELECTION-TABLE rspar_tab

    WITH selcrit2 BETWEEN 'H' AND 'K'

    WITH selcrit2 IN range_tab

    AND RETURN.

    regards,

    Santosh thorat

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 11:17 AM

    hi,

    for calling program,

    e.g.

    SUBMIT YPPDAILYUPDATE

    with pstngdt in temp

    with entdate eq ' '

    with posdate eq 'X'

    with rdata eq 'X'

    with logic eq ' '

    with high eq 'X'

    with trend eq ' '

    AND RETURN

    .

    or

    if u have tcode then,

    CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.

    Regards,

    Arpit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 11:31 AM

    If you want ZPROG1 should continue it's processing after ZPROG2 is finished,

    use

    SUBMIT ZPROG2 and RETURN.

    If you want ZPROG1 should transfer it's control to ZPROG2 and processing should not return to ZPROG1, use

    SUBMIT ZPROG2.

    In case you want to pass other parameters etc using VIA SELECTION-SCREEN and other variant.

    Regards,

    Mohaiyuddin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 11:38 AM

    Hi Uday,

    If your program is executable (Type 1) you can use SUBMIT.If the program has a different type if you use SUBMIT, then the system triggers a runtime error.

    syntax: SUBMIT PROG1.

    PROG1 must be capital, otherwise a runtime error occurs

    Thanks & Regards

    Raj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2008 at 12:03 PM

    hi,

    Let zprog1 be the calling program & zprog2 be the program to be called.

    case 1: u want to call zprog2 from zprog1 and don't want the control to return back to calling program(zprog1) after program zprog2 is executed.

    Syntax (zprog1):

    SUBMIT ZPROG2.

    case 2: u want to call zprog2 from zprog1 and also want the control to return back to calling program(zprog1) after program zprog2 is executed.

    Syntax (zprog1):

    SUBMIT ZPROG2 AND RETURN.

    case 3: u want to transfer some data from one zprog1 to zprog2 while making a call.

    Syntax (zprog1):

    EXPORTING G_DATA1 G_DATA2 TO MEMORY ID 'ANY_NAME'.

    Syntax (zprog2):

    IMPORTING G_DATA1 TO G_DATA11 G_DATA2 TO G_DATA22 FROM MEMORY ID 'ANY_NAME'.

    Regards,

    Amit Gupta

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.