Skip to Content

How to fetch the spool of child job in the parent job?

Hi Experts,

Please help me with the below scenario.

Current Scenario:

1. I have a parent program in which i am using SUBMIT command to invoke some other program which deletes some sales orders in the system.

2. Program which has been submitted will run independently and it deletes the sales orders and it wll give an output with the log of the data of whatever the sales orders that been deleted.

Requirement:

Now, I want the log that has been generated by the child program in the parent program so, that I can display it to the user.

Please help me if you have any thoughts on this.

Thanks in advance

Babu Kilari

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 04, 2009 at 08:51 AM

    Hello,

    You have to use EXPORTING LIST TO MEMORY AND RETURN addition with SUBMIT stmt.

    Try like this:

    DATA:
    L_IT_LIST TYPE STANDARD TABLE OF ABAPLIST.
    
      SUBMIT <Child Program Name>
      WITH SELECTION-TABLE LIT_RSPARAMS
      EXPORTING LIST TO MEMORY AND RETURN.                   "#EC CI_SUBMIT
    
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          LISTOBJECT = L_IT_LIST
        EXCEPTIONS
          NOT_FOUND  = 1
          OTHERS     = 2.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'WRITE_LIST'
          TABLES
            LISTOBJECT = L_IT_LIST
          EXCEPTIONS
            EMPTY_LIST = 1
            OTHERS     = 2.
        IF SY-SUBRC <> 0.                                       "#EC *
    *     Do Nothing
        ENDIF.

    Hope this is clear.

    BR,

    Suhas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 04, 2009 at 08:54 AM

    Hi,

    In parent program, on return from the child program. using the job name read the spool and display that in the parent prgm.

    Use in the Child prgm: SUBMIT (v_prog) WITH p_fpath EQ text-004 "parameters if needed

    WITH p_fname EQ v_fname "parameters if needed

    TO SAP-SPOOL

    SPOOL PARAMETERS v_params

    WITHOUT SPOOL DYNPRO

    USER sy-uname VIA JOB v_jobname NUMBER v_jobcount

    AND RETURN.

    once you return to child pass the details of the job to parent program.

    Please close the thread, if solved

    Regards,

    Aditya.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2009 at 04:42 AM

    Thanks Suhas

    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.