Skip to Content

Problem with SUBMIT stmt.

Hi All,

I've two executable programs; prog A and prog B. Prog A uses a SUBMIT stmt to call the prog B.

On debugging, I found that the cursor goes to prog B but not going into the START OF SELECTION event; before that the cursor moves all of a sudden to JOB_SUBMIT stmt and triggers a dump.

The code comes like.. I mapped the internal table t_select properly.. (I belive). Please help.

*-->Open job.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = l_jobname
      IMPORTING
        jobcount         = l_jobcount
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3.
    IF sy-subrc <> 0.
      MESSAGE i047(z2) WITH text-i01.
      LEAVE LIST-PROCESSING.
    ENDIF.

    SUBMIT zotfv01a
         TO SAP-SPOOL
         WITHOUT SPOOL DYNPRO
         VIA JOB l_jobname NUMBER l_jobcount
         WITH  SELECTION-TABLE t_select
         AND RETURN.
    IF sy-subrc = 0.
      MESSAGE s047(z2) WITH text-s01.
    ENDIF.

*-->Close Job.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = l_jobcount
        jobname              = l_jobname
        strtimmed            = c_x
      EXCEPTIONS
        cant_start_immediate = 1
        invalid_startdate    = 2
        jobname_missing      = 3
        job_close_failed     = 4
        job_nosteps          = 5
        job_notex            = 6
        lock_failed          = 7
        invalid_target       = 8
        OTHERS               = 9.
    IF sy-subrc <> 0.
      MESSAGE i047(z2) WITH text-i02.

<Added code tags>

If I execute the prog B seperatly on the same variant; it works fine.

Moderator Message: Please use "code" tags to format your code snippet

Edited by: UllasU on Dec 30, 2011 6:39 AM

Edited by: Suhas Saha on Dec 30, 2011 11:12 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 30, 2011 at 05:48 AM

    I found that the cursor goes to prog B but not going into the START OF SELECTION event; before that the cursor moves all of a sudden to JOB_SUBMIT stmt.

    You've submitted the program as a Job, so the program B will start as a background process & you cannot debug it in the same session! Did you check in SM37 the status of the job?

    ... triggers a dump

    Post the details of your dump for better analysis.

    BR,

    Suhas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2011 at 05:53 AM

    Hi friend,

    I think this is because the sequence of executions,

    The sequence is as follows,

    Job_Open

    Job_Submit

    Job_close

    To be more clear about this please see the below link,

    <link-farm removed>

    If your problem still exists please revert back to me i will help you.

    Thanks,

    Sri Hari

    Edited by: Suhas Saha on Dec 30, 2011 11:33 AM

    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.