<?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: background processing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283208#M785223</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;Check the code using sy-batch which u have to use with if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM download_html_file_on_pc tables   YT_DOWNLOAD&lt;/P&gt;&lt;P&gt;                              using    X_OUTFILE type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use gui_download if file is located on the local PC.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WS_download only works in foreground&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF SY-batch EQ 'X'.&lt;/P&gt;&lt;P&gt;    MESSAGE e001(AQ) WITH&lt;/P&gt;&lt;P&gt;   'This program cannot be executed in background'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ERROR: Unable to download locally stored files when running in&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  background&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        FILENAME                = X_OUTFILE&lt;/P&gt;&lt;P&gt;        FILETYPE                = 'ASC'&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        DATA_TAB                = YT_DOWNLOAD&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        FILE_WRITE_ERROR        = 1&lt;/P&gt;&lt;P&gt;        NO_BATCH                = 2&lt;/P&gt;&lt;P&gt;        GUI_REFUSE_FILETRANSFER = 3&lt;/P&gt;&lt;P&gt;        INVALID_TYPE            = 4&lt;/P&gt;&lt;P&gt;        NO_AUTHORITY            = 5&lt;/P&gt;&lt;P&gt;        UNKNOWN_ERROR           = 6&lt;/P&gt;&lt;P&gt;        HEADER_NOT_ALLOWED      = 7&lt;/P&gt;&lt;P&gt;        SEPARATOR_NOT_ALLOWED   = 8&lt;/P&gt;&lt;P&gt;        FILESIZE_NOT_ALLOWED    = 9&lt;/P&gt;&lt;P&gt;        HEADER_TOO_LONG         = 10&lt;/P&gt;&lt;P&gt;        DP_ERROR_CREATE         = 11&lt;/P&gt;&lt;P&gt;        DP_ERROR_SEND           = 12&lt;/P&gt;&lt;P&gt;        DP_ERROR_WRITE          = 13&lt;/P&gt;&lt;P&gt;        UNKNOWN_DP_ERROR        = 14&lt;/P&gt;&lt;P&gt;        ACCESS_DENIED           = 15&lt;/P&gt;&lt;P&gt;        DP_OUT_OF_MEMORY        = 16&lt;/P&gt;&lt;P&gt;        DISK_FULL               = 17&lt;/P&gt;&lt;P&gt;        DP_TIMEOUT              = 18&lt;/P&gt;&lt;P&gt;        FILE_NOT_FOUND          = 19&lt;/P&gt;&lt;P&gt;        DATAPROVIDER_EXCEPTION  = 20&lt;/P&gt;&lt;P&gt;        CONTROL_FLUSH_ERROR     = 21&lt;/P&gt;&lt;P&gt;        OTHERS                  = 22.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Status of download&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CASE SY-subrc.&lt;/P&gt;&lt;P&gt;      WHEN 0.&lt;/P&gt;&lt;P&gt;        MESSAGE I002(AQ) WITH&lt;/P&gt;&lt;P&gt;        'Code converted to HTML and downloaded as ' X_OUTFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Upload unsuccessful - error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " download_html_file_on_pc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help u &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward points if useful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sreenivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jan 2008 13:36:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-08T13:36:05Z</dc:date>
    <item>
      <title>background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283205#M785220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gurus,&lt;/P&gt;&lt;P&gt;I want write a code for a program which will run in background.&lt;/P&gt;&lt;P&gt;for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt; run in back ground.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt; run in foreground.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can i use sy-batch and how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283205#M785220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283206#M785221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if sy-batch = 'X'&lt;/P&gt;&lt;P&gt;run in back ground.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;run in foreground.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward some points&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283206#M785221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283207#M785222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  You can use sy-batch to run the program in background. Write the code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-batch = 'X'.                   &lt;/P&gt;&lt;P&gt; run in background.&lt;/P&gt;&lt;P&gt;else. &lt;/P&gt;&lt;P&gt; run in foreground.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Haritha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:33:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283207#M785222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283208#M785223</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;Check the code using sy-batch which u have to use with if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM download_html_file_on_pc tables   YT_DOWNLOAD&lt;/P&gt;&lt;P&gt;                              using    X_OUTFILE type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use gui_download if file is located on the local PC.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WS_download only works in foreground&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF SY-batch EQ 'X'.&lt;/P&gt;&lt;P&gt;    MESSAGE e001(AQ) WITH&lt;/P&gt;&lt;P&gt;   'This program cannot be executed in background'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ERROR: Unable to download locally stored files when running in&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  background&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        FILENAME                = X_OUTFILE&lt;/P&gt;&lt;P&gt;        FILETYPE                = 'ASC'&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        DATA_TAB                = YT_DOWNLOAD&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        FILE_WRITE_ERROR        = 1&lt;/P&gt;&lt;P&gt;        NO_BATCH                = 2&lt;/P&gt;&lt;P&gt;        GUI_REFUSE_FILETRANSFER = 3&lt;/P&gt;&lt;P&gt;        INVALID_TYPE            = 4&lt;/P&gt;&lt;P&gt;        NO_AUTHORITY            = 5&lt;/P&gt;&lt;P&gt;        UNKNOWN_ERROR           = 6&lt;/P&gt;&lt;P&gt;        HEADER_NOT_ALLOWED      = 7&lt;/P&gt;&lt;P&gt;        SEPARATOR_NOT_ALLOWED   = 8&lt;/P&gt;&lt;P&gt;        FILESIZE_NOT_ALLOWED    = 9&lt;/P&gt;&lt;P&gt;        HEADER_TOO_LONG         = 10&lt;/P&gt;&lt;P&gt;        DP_ERROR_CREATE         = 11&lt;/P&gt;&lt;P&gt;        DP_ERROR_SEND           = 12&lt;/P&gt;&lt;P&gt;        DP_ERROR_WRITE          = 13&lt;/P&gt;&lt;P&gt;        UNKNOWN_DP_ERROR        = 14&lt;/P&gt;&lt;P&gt;        ACCESS_DENIED           = 15&lt;/P&gt;&lt;P&gt;        DP_OUT_OF_MEMORY        = 16&lt;/P&gt;&lt;P&gt;        DISK_FULL               = 17&lt;/P&gt;&lt;P&gt;        DP_TIMEOUT              = 18&lt;/P&gt;&lt;P&gt;        FILE_NOT_FOUND          = 19&lt;/P&gt;&lt;P&gt;        DATAPROVIDER_EXCEPTION  = 20&lt;/P&gt;&lt;P&gt;        CONTROL_FLUSH_ERROR     = 21&lt;/P&gt;&lt;P&gt;        OTHERS                  = 22.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Status of download&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CASE SY-subrc.&lt;/P&gt;&lt;P&gt;      WHEN 0.&lt;/P&gt;&lt;P&gt;        MESSAGE I002(AQ) WITH&lt;/P&gt;&lt;P&gt;        'Code converted to HTML and downloaded as ' X_OUTFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN OTHERS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Upload unsuccessful - error message&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " download_html_file_on_pc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help u &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward points if useful&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sreenivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:36:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283208#M785223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283209#M785224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want to know how to submit a program in background ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SY-BATCH field will tell you if you are already running in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you clarify your requirement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Chester&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:40:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283209#M785224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283210#M785225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;actually what code i have to write to make a program to run in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;means i have a simple program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i want to make it run in background and foreground both on a particular condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any code to make a program to run in background.&lt;/P&gt;&lt;P&gt;so that i can put it inside IF condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-batch = 'X'.&lt;/P&gt;&lt;P&gt;  code for background.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need code for background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u have any question please let me know.&lt;/P&gt;&lt;P&gt;thanks. please advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:49:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283210#M785225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283211#M785226</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;  You can put what code to run in back ground and what code to run in foreground in the if conditions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-batch = 'X'. &lt;/P&gt;&lt;P&gt;  write the code which u want to run in back ground.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt; write the code which you want to run in foreground.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the status of the background job in sm30 transaction code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Haritha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 13:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283211#M785226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T13:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283212#M785227</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;You have to use as below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-batch = 'X'.&lt;/P&gt;&lt;P&gt;Run the report in background.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;Run the report in foreground.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 14:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283212#M785227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T14:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283213#M785228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhisbek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF p_bkgrd IS NOT INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Program is being run in background...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   CALL FUNCTION 'JOB_OPEN'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      jobname          = &lt;STRONG&gt;w_name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      jobcount         = &lt;STRONG&gt;w_number&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      cant_create_job  = 1&lt;/P&gt;&lt;P&gt;      invalid_job_data = 2&lt;/P&gt;&lt;P&gt;      jobname_missing  = 3&lt;/P&gt;&lt;P&gt;      OTHERS           = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SUBMIT program&lt;/P&gt;&lt;P&gt;    WITH p_1 EQ p_1&lt;/P&gt;&lt;P&gt;      VIA JOB &lt;STRONG&gt;w_name&lt;/STRONG&gt; NUMBER &lt;STRONG&gt;w_number&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'JOB_CLOSE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        jobcount             = w_number&lt;/P&gt;&lt;P&gt;        jobname              = w_name&lt;/P&gt;&lt;P&gt;        strtimmed            = 'X'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cant_start_immediate = 1&lt;/P&gt;&lt;P&gt;        invalid_startdate    = 2&lt;/P&gt;&lt;P&gt;        jobname_missing      = 3&lt;/P&gt;&lt;P&gt;        job_close_failed     = 4&lt;/P&gt;&lt;P&gt;        job_nosteps          = 5&lt;/P&gt;&lt;P&gt;        job_notex            = 6&lt;/P&gt;&lt;P&gt;        lock_failed          = 7&lt;/P&gt;&lt;P&gt;        OTHERS               = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Program is being run in foreground&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   SUBMIT program&lt;/P&gt;&lt;P&gt;    WITH p_1      EQ p_1&lt;/P&gt;&lt;P&gt;    AND RETURN.&lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chester&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 14:06:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283213#M785228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T14:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: background processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283214#M785229</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;Chester's point is accurate, sy-batch is of no use to you here at all, it will only tell you if you are currently running in the background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All this will do;&lt;/P&gt;&lt;P&gt;IF sy-batch = 'X'.&lt;/P&gt;&lt;P&gt;code for background.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;is perform 'code for background' if your program is already running in the background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It run a program in the background you can use the SUBMIT statement.  Take a look at the ABAP help for this statement, particularly the job_options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So an example might be;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if counter gt 5000.&lt;/P&gt;&lt;P&gt;submit program (using job_options) and return.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;submit program and return.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 14:08:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-processing/m-p/3283214#M785229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T14:08:46Z</dc:date>
    </item>
  </channel>
</rss>

