<?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 Re: How to handle errors encountered by SUBMIT statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827444#M920403</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;See like you said you encountered with the error in the called program, and you said you cant able to catch error in the called program. asn alos your SUBMIT is in a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible mail the code.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I would like to know whether, It's a Static error or it's a dynamic one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to capture the return code of called program to calling Program.. it's possible..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your case , The Iteration has to be completed irrespective of the error of previous iteration. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can do...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 May 2008 04:12:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-09T04:12:31Z</dc:date>
    <item>
      <title>How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827443#M920402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sap Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a Z program in which I called a standard report program with selection screen using SUBMIT &amp;lt;report program&amp;gt; using ....... and return in a loop and endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As long as error was not encountered it executed ok.&lt;/P&gt;&lt;P&gt;When I ran my Z program in foreground which inturn calls a report program in a loop using SUBMIT keyword, for the first iteration of the loop itself an error was encountered and it is not going through another iterations and after hitting enter in the error screen, then only it is passing through other iterations and executing the report program(called program) from the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is there any way where I can handle/catch error which was encountered in the other program(called program) from the calling program and correct it.  Also the SUBMIT statement wont return any sy-subrc to check whether the call is successful or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your kind help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kalikonda.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 03:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827443#M920402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T03:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827444#M920403</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;See like you said you encountered with the error in the called program, and you said you cant able to catch error in the called program. asn alos your SUBMIT is in a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible mail the code.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because I would like to know whether, It's a Static error or it's a dynamic one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to capture the return code of called program to calling Program.. it's possible..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your case , The Iteration has to be completed irrespective of the error of previous iteration. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can do...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 04:12:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827444#M920403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T04:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827445#M920404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kalikonda kalikonda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look on Submit with JOB options...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See  the documentation below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SUBMIT - job_options&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;... [USER user] VIA JOB job NUMBER n... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition schedules the execution of the program accessed as a background task with the number n in the background request job. The number n for a background request job is supplied by function module JOB_OPEN in function group BTCH. The full program is not processed directly but in background processing, according to the parameters specified for the background request. You can use the optional addition USER to specify a user ID user of the type sy-uname, which is used to execute the background task. The addition VIA JOB can only be used together with the addition AND RETURN. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The VIA JOB addition also loads the program accessed in a separate internal mode when the SUBMIT statement is executed and the system performs all the steps specified before START-OF-SELECTION. This means the events LOAD-OF-PROGRAM and INITIALIZATION are triggered and selection screen processing is performed. If the selection screen is not processed in the background when VIA SELECTION-SCREEN is specified, the user of the calling program can eidit it and schedule the program accessed in the background request using the function Place in Job. If the user cancels selection screen processing, the program is not scheduled in the background job. In both cases, execution of the program executed is completed after selection screen processing and the system returns to the calling program due to the AND RETURN addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the program is scheduled in the background task, the selections specified by the user or in the additions for filling the selection screen are stored in an internal variant. When the program is executed in the background request, it is processed fully but the selection screen is processed in the background. The system triggers all events, including that for selection screen processing. The variant stored internally is transferred to the selection screen between the INITIALIZATION and AT SELECTION SCREEN OUTPUT events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a basic list is created in the program accessed, you should create a spool request with explicit print parameters by specifying TO SAP-SPOOL. Otherwise the VIA JOB addition implicitly creates a spool request that derives its print parameters from standard values, some of which are taken from the user defaults, and which are not necessarily consistent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc Meaning &lt;/P&gt;&lt;P&gt;0 Background task scheduled successfully. &lt;/P&gt;&lt;P&gt;4 Scheduling cancelled by user on the selection screen. &lt;/P&gt;&lt;P&gt;8 Error during scheduling, i.e. when accessing JOB_SUBMIT internally. &lt;/P&gt;&lt;P&gt;12 Error in internal number assignment. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;You can create and monitor background jobs by choosing the menu path System - Services - Jobs. In addition to JOB_OPEN, the function modules JOB_CLOSE and JOB_SUBMIT can also be used in the ABAP program. JOB_CLOSE closes creation of a background request. Like the SUBMIT statement, JOB_SUBMIT schedules an ABAP program as a background task in a background request. JOB_SUBMIT provides more control options for background processing but must receive the input values for the selection screen in an existing variant. The SUBMIT statement creates this variant and accesses JOB_SUBMIT internally. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Scheduling a submitable program as a background task with the number number in a background request name. After scheduling, the background task is completed by function module JOB_CLOSE and released immediately providing the user has the relevant authorization. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: number           TYPE tbtcjob-jobcount, 
      name             TYPE tbtcjob-jobname VALUE 'JOB_TEST', 
      print_parameters TYPE pri_params. 

... 

CALL FUNCTION 'JOB_OPEN' 
  EXPORTING 
    jobname          = name 
  IMPORTING 
    jobcount         = number 
  EXCEPTIONS 
    cant_create_job  = 1 
    invalid_job_data = 2 
    jobname_missing  = 3 
    OTHERS           = 4. 
IF sy-subrc = 0. 
  SUBMIT submitable TO SAP-SPOOL 
                    SPOOL PARAMETERS print_parameters 
                    WITHOUT SPOOL DYNPRO 
                    VIA JOB name NUMBER number 
                    AND RETURN. 
  IF sy-subrc = 0. 
    CALL FUNCTION 'JOB_CLOSE' 
      EXPORTING 
        jobcount             = number 
        jobname              = name 
        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 &amp;lt;&amp;gt; 0. 
      ... 
    ENDIF. 
  ENDIF. 
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also have look on below thread&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="567148"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will solve your problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;ilesh 24x7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Jun 9, 2008 6:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 04:36:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827445#M920404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T04:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827446#M920405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you answer i.e. prompt answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code I am using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_plan_p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR : pm_snp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE it_plan_p-plannr '_SNP' INTO pm_snp.&lt;/P&gt;&lt;P&gt;    SUBMIT /sapapo/ppm_conv_ppds_to_snp WITH pm_ppds = it_plan_p-plannr&lt;/P&gt;&lt;P&gt;                                        WITH pm_snp  = pm_snp&lt;/P&gt;&lt;P&gt;                                        WITH x_flag  = 'X'&lt;/P&gt;&lt;P&gt;                                        USING SELECTION-SCREEN 1000 AND RETURN&lt;/P&gt;&lt;P&gt;                                        EXPORTING LIST TO MEMORY.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and yes you are right that I want to proceed with further iterations even if one iterations got error,&lt;/P&gt;&lt;P&gt;but at the same time I have to catch the error and maintain the log for it.&lt;/P&gt;&lt;P&gt;Can it be possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again for your answer and also appreciate your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kalikonda.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 14:25:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827446#M920405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T14:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827447#M920406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I am not using the text 'EXPORTING LIST TO MEMORY' in the submit command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by mistake I put that for testing purpose only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please ignore the text 'EXPORTING LIST TO MEMORY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;kalikonda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 14:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827447#M920406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T14:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827448#M920407</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;Include 'EXPORTING LIST TO MEMORY' in your code. For error records spool won't have any data. Anyway with the inclusion 'EXPORTING LIST TO MEMORY' you are exporting the spool data to the memory. Retrieve the data from memory using 'LIST_FROM_MEMORY' function module and store it in a some text variable and check the length of text variable. if it is zero means processed record is error record, store all those records some internal table and maintain that internal table as log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Jun 9, 2008 6:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 14:50:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827448#M920407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T14:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827449#M920408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with the text ''EXPORTING LIST TO MEMORY' ' in submit statement but still it is  not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way where I can use transaction code in the loop and catch the errors and display them later on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly,&lt;/P&gt;&lt;P&gt;kalikonda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2008 21:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827449#M920408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-09T21:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle errors encountered by SUBMIT statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827450#M920409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used Call transaction method to solve this issue.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2008 20:52:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-handle-errors-encountered-by-submit-statement/m-p/3827450#M920409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-09T20:52:17Z</dc:date>
    </item>
  </channel>
</rss>

