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

SUBMIT VIA JOB MESSAGE TYPE 'E'

Hi!

Please help me, I can't use submit via background job, because he can't handle message errors of type 'E'. When this kind of message occurs, all background processing stops and I get a report screen with this message in the status bar.

Is there any solution?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 15, 2005 at 01:07 PM

    Are you saying that you want to continue processing even though you may have a critical error? Please expand on your requirement.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 15, 2005 at 05:32 PM

    Let me understand this. You have a program A from which you submit a program B in the background and if in program B an error is raised, your program A execution stops. Is this true?

    Did you do a job close in your code. Here is a sample program ZTEST1 that submits another program ZTEST2 in the background. If there is an error message thrown out in ZTEST2, the job submitted is cancelled, with the job log showing the error message. The processing of ZTEST1 continues even after that.

    I don't know why yours is not. Please let us know.

    <u>Program ZTEST1</u>

    REPORT ztest1 .
    
    PARAMETERS: p_matnr1 LIKE mara-matnr.
    
    DATA: v_jobcount LIKE tbtcjob-jobcount,
          v_jobname  LIKE tbtcjob-jobname.
    
    START-OF-SELECTION.
    
      v_jobname = 'TESTJOB'.
    
    *-- open the job
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = v_jobname
           IMPORTING
                jobcount         = v_jobcount
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *-- submit the report
      SUBMIT ztest2 WITH p_matnr2 = p_matnr1
                    USER sy-uname VIA JOB v_jobname
                  NUMBER v_jobcount AND RETURN.
    *-- close the job
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                jobcount             = v_jobcount
                jobname              = v_jobname
                strtimmed            = '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
                OTHERS               = 8.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    
      WRITE:/ 'Job submitted successfully.'.

    <u>Program ZTEST2</u>

    REPORT ztest2 MESSAGE-ID zz.
    
    
    PARAMETERS: p_matnr2 LIKE mara-matnr.
    
    
    DATA: itab LIKE mara OCCURS 0 WITH HEADER LINE.
    
    START-OF-SELECTION.
    
      SELECT * INTO TABLE itab FROM mara
                              WHERE matnr = p_matnr2.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Invalid material number'.
      ENDIF.
    
      LOOP AT itab.
        WRITE:/ itab-matnr.
      ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you for your attention. I'm already found solution for this problem.

      The question was how to get error message type 'E' from report called through SUBMIT VIA JOB. Everytime when this message occurs in report we got full terminate(right after SUBMIT VIA JOB) of the calling module(especially in RFC-call). So after all we got clear log and open job. But I need to handle all errors from report in a normal way, after 'JOB_CLOSE'. How could it be? I don't know.

      But I found my own solution. I wrote additional FM where I put my SUBMIT VIA JOB. And then I replaced my SUBMIT-call with FM-call with addition "STARTING NEW TASK..." and "PERFORMING return_info ON END OF TASK". Where in return_info form I get all message errors(even type 'E') from message text of the exceptions COMMUNICATION_FAILURE and SYSTEM_FAILURE of the RECEIVE command.

      After all of this, I want to say, that it was a really big trick, but IT WORKS! I'm really happy. 😊

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.