<?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 Starting Background Job from program... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629260#M874254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello I am using following to create a background job.&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 'METZ: INVOICING FROM SHIPMENT',
        print_parameters TYPE pri_params.
  data vari  LIKE varid-variant.
  data shipm    LIKE vttk-tknum.
  data use  LIKE   btch2170-username.
  vari = '3350_1' .
  shipm = p_shipment.
  use = 'K5_BATCH'.

  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 Z5L_START_INVOICING with p_shipm = shipm
                               with p_vari = vari
                               with p_submit = 'X'
                               USER use 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;I am using the addition USER but the job gets started with user who is log on or who is using this trasaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should start with user 'K5_BATCH' but it is not...........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 7, 2008 1:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Apr 2008 12:59:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-07T12:59:50Z</dc:date>
    <item>
      <title>Starting Background Job from program...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629260#M874254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello I am using following to create a background job.&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 'METZ: INVOICING FROM SHIPMENT',
        print_parameters TYPE pri_params.
  data vari  LIKE varid-variant.
  data shipm    LIKE vttk-tknum.
  data use  LIKE   btch2170-username.
  vari = '3350_1' .
  shipm = p_shipment.
  use = 'K5_BATCH'.

  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 Z5L_START_INVOICING with p_shipm = shipm
                               with p_vari = vari
                               with p_submit = 'X'
                               USER use 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;I am using the addition USER but the job gets started with user who is log on or who is using this trasaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should start with user 'K5_BATCH' but it is not...........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 7, 2008 1:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 12:59:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629260#M874254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Starting Background Job from program...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629261#M874255</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;Question: Does the following userid 'K5_BATCH'  existe on your system ad withcorrect authorizations ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 13:07:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629261#M874255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T13:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Starting Background Job from program...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629262#M874256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 13:10:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629262#M874256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T13:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Starting Background Job from program...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629263#M874257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the following info:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open Job Scheduling Without Dialog (Including COMMIT WORK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use JOB_OPEN to create a background job.  The function module returns the unique ID number which, together with the job name, is required for identifying the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have "opened" a job, you can add job steps to it with JOB_SUBMIT and submit the job for processing with JOB_CLOSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you will first have to use the JOB_SUBMIT  statement like mentioned above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 13:18:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629263#M874257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T13:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Starting Background Job from program...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629264#M874258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;JOB_SUBMIT is done internally when you write Submit.....with....USER....VIA JOB....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently job is working fine but with Sy.uname and not with user i am specifying in SUBMIT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 13:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629264#M874258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T13:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Starting Background Job from program...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629265#M874259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well if you think that everyting is ok. the last thing that you could do is to debug your application and see why your specific user id is not taken into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck with debugging&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2008 13:42:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/starting-background-job-from-program/m-p/3629265#M874259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-07T13:42:52Z</dc:date>
    </item>
  </channel>
</rss>

