<?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: Problems with background job in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682045#M300548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. U are right.&lt;/P&gt;&lt;P&gt;2. It will happen if we use SUBMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. As per the help documentation,&lt;/P&gt;&lt;P&gt;    it will run the program in separate session,&lt;/P&gt;&lt;P&gt;   ( as soon as submit statement comes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. and run the INITIALIZATION event.&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 statement. &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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Nov 2006 12:55:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-14T12:55:01Z</dc:date>
    <item>
      <title>Problems with background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682041#M300544</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;I have problems when creating a job that is supposed to be run once in background. I use the common steps as described below. My problem is that the report is executed twice. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- First it is executed synchronously when the job is created&lt;/P&gt;&lt;P&gt;- Then it is executed in the normal job step as I want it to do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want it to be executed the first time because it creates data!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'JOB_OPEN'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          jobname  = w_jobid&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          jobcount = w_jobnr&lt;/P&gt;&lt;P&gt;          sdlstrtdt = sy-datum&lt;/P&gt;&lt;P&gt;          sdlstrttm = sy-uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUBMIT (p_prog)&lt;/P&gt;&lt;P&gt;WITH p_idocnr = p_idocno&lt;/P&gt;&lt;P&gt;           USER            p_user&lt;/P&gt;&lt;P&gt;           VIA   JOB       w_jobid&lt;/P&gt;&lt;P&gt;                 NUMBER  w_jobnr&lt;/P&gt;&lt;P&gt;                 AND       RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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_jobnr&lt;/P&gt;&lt;P&gt;          jobname          = w_jobid&lt;/P&gt;&lt;P&gt;          strtimmed        = 'X'&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          job_was_released = w_jobrel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a clue of what I should do to prevent this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//  Regards  Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 12:37:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682041#M300544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T12:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682042#M300545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hans,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Instead of using SUBMIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. use the FM JOB_SUBMIT&lt;/P&gt;&lt;P&gt;    and provide the appropriate parameters.&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 12:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682042#M300545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T12:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682043#M300546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hans,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check SY-BATCH = 'X'   (background) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create entries. This way Entries will be craeted only when the program is being executed background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if this helps.&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 12:44:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682043#M300546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T12:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682044#M300547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check the JOB_SUBMIT parameters once .....&lt;/P&gt;&lt;P&gt;here are the parameters which normally we pass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'JOB_SUBMIT' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;AUTHCKNAM     = SY-UNAME " Runtime authorizations  user&lt;/P&gt;&lt;P&gt;JOBCOUNT        = JOBNUMBER " Value from JOB_OPEN&lt;/P&gt;&lt;P&gt;JOBNAME          = JOBNAME " Value from JOB_OPEN&lt;/P&gt;&lt;P&gt;REPORT            = 'REPORT' " Report to be run&lt;/P&gt;&lt;P&gt;VARIANT           = 'VARIANT' " Variant to use with report&lt;/P&gt;&lt;P&gt;PRIPARAMS      = USER_PRINT_PARAMS " User printing options&lt;/P&gt;&lt;P&gt;ARCPARAMS     = USER_ARC_PARAMS " User archiving options Both sets of options &lt;/P&gt;&lt;P&gt;                                                               " come from GET_PRINT_PARAMETERS&lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;BAD_PRIPARAMS                      = 01 &lt;/P&gt;&lt;P&gt;INVALID_JOBDATA                    = 02 &lt;/P&gt;&lt;P&gt;JOBNAME_MISSING                   = 03 &lt;/P&gt;&lt;P&gt;JOB_NOTEX                               = 04 &lt;/P&gt;&lt;P&gt;JOB_SUBMIT_FAILED                 = 05 &lt;/P&gt;&lt;P&gt;LOCK_FAILED                            = 06 &lt;/P&gt;&lt;P&gt;PROGRAM_MISSING                   = 07 &lt;/P&gt;&lt;P&gt;PROG_ABAP_AND_EXTPG_SET  = 08 &lt;/P&gt;&lt;P&gt;OTHERS                                      = 99.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 12:46:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682044#M300547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T12:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682045#M300548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. U are right.&lt;/P&gt;&lt;P&gt;2. It will happen if we use SUBMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. As per the help documentation,&lt;/P&gt;&lt;P&gt;    it will run the program in separate session,&lt;/P&gt;&lt;P&gt;   ( as soon as submit statement comes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. and run the INITIALIZATION event.&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 statement. &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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 12:55:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682045#M300548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T12:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682046#M300549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for all help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found an excellent solution to the problem which was to look at the sy-ucomm paramer, see example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-ucomm = 'ONLI' or sy-ucomm = ' '.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for further description, see following thread:&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="253334"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//  Regards  Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Nov 2006 13:33:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problems-with-background-job/m-p/1682046#M300549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-14T13:33:47Z</dc:date>
    </item>
  </channel>
</rss>

