<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Catching Errors of a Batch Input in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-of-a-batch-input/m-p/2201087#M470315</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the following to generate a Batch Input:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Generate BI folder (Standard program)

  CONCATENATE text-001 pa_bukrs sy-datum
         INTO jobname
 SEPARATED BY space.

  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = jobname
    IMPORTING
      jobcount         = jobcount
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.

  IF sy-batch IS INITIAL.
    SUBMIT (programa) VIA JOB jobname NUMBER jobcount
            TO SAP-SPOOL AND RETURN IMMEDIATELY ' '
            WITH ds_name = pa_filed
            WITH fl_check = space
            WITH callmode = 'D'
            WITHOUT SPOOL DYNPRO.
  ELSE.
    SUBMIT (programa) VIA JOB jobname NUMBER jobcount
            TO SAP-SPOOL AND RETURN IMMEDIATELY ' '
            WITH ds_name = pa_filed
            WITH fl_check = space
            WITH callmode = 'B'
            WITHOUT SPOOL DYNPRO.
  ENDIF.

  CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
      jobcount             = jobcount
      jobname              = 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 EQ 0.
    MESSAGE i090(z3) WITH jobname.
  ELSE.
    MESSAGE e089(z3) WITH jobname.
  ENDIF.

  SUBMIT rsbdcsub AND RETURN WITH mappe = pasta.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have two questions concerning this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st - What's the difference between callmode 'B' and call mode 'D'? I've tested the two modes and i can see that with mode 'B' when i go to sm35 the batch is there, and if i use mode 'D' nothing is created there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd - I need to know if the job had errors and if so, i need to be able to know the description of the errors and return that information to a internal table in order to display it. Is this possible, if yes, how can i do that in my program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Pedro Gaspar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2007 09:55:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-27T09:55:54Z</dc:date>
    <item>
      <title>Catching Errors of a Batch Input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-of-a-batch-input/m-p/2201087#M470315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the following to generate a Batch Input:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Generate BI folder (Standard program)

  CONCATENATE text-001 pa_bukrs sy-datum
         INTO jobname
 SEPARATED BY space.

  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = jobname
    IMPORTING
      jobcount         = jobcount
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.

  IF sy-batch IS INITIAL.
    SUBMIT (programa) VIA JOB jobname NUMBER jobcount
            TO SAP-SPOOL AND RETURN IMMEDIATELY ' '
            WITH ds_name = pa_filed
            WITH fl_check = space
            WITH callmode = 'D'
            WITHOUT SPOOL DYNPRO.
  ELSE.
    SUBMIT (programa) VIA JOB jobname NUMBER jobcount
            TO SAP-SPOOL AND RETURN IMMEDIATELY ' '
            WITH ds_name = pa_filed
            WITH fl_check = space
            WITH callmode = 'B'
            WITHOUT SPOOL DYNPRO.
  ENDIF.

  CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
      jobcount             = jobcount
      jobname              = 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 EQ 0.
    MESSAGE i090(z3) WITH jobname.
  ELSE.
    MESSAGE e089(z3) WITH jobname.
  ENDIF.

  SUBMIT rsbdcsub AND RETURN WITH mappe = pasta.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have two questions concerning this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st - What's the difference between callmode 'B' and call mode 'D'? I've tested the two modes and i can see that with mode 'B' when i go to sm35 the batch is there, and if i use mode 'D' nothing is created there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd - I need to know if the job had errors and if so, i need to be able to know the description of the errors and return that information to a internal table in order to display it. Is this possible, if yes, how can i do that in my program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Pedro Gaspar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 09:55:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-of-a-batch-input/m-p/2201087#M470315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T09:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors of a Batch Input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-of-a-batch-input/m-p/2201088#M470316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;obviously B creates a session (Batch input folder) and the other call mode is Dialog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the B mode: you can see only after you executed the session the errors or succesfully posted docs in the protocol in SM35.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;D will execute the postings in background immediately. Check in SM37 the "job-log".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;JP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 13:50:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-of-a-batch-input/m-p/2201088#M470316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T13:50:33Z</dc:date>
    </item>
  </channel>
</rss>

