<?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: Schedule a background job for a program using ABAP code. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024589#M961829</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 use the JOB_OPEN &amp;amp; JOB_CLOSE FM to schedule a background job for another program.&lt;/P&gt;&lt;P&gt;Check this and do reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ponraj.s.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2008 08:43:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-23T08:43:12Z</dc:date>
    <item>
      <title>Schedule a background job for a program using ABAP code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024587#M961827</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 to write a program to schedule a background job for another program.&lt;/P&gt;&lt;P&gt;Need your help to understand how we can achieve this functionality.Any example of an abap code would be of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need it urgently.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Sandeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 08:32:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024587#M961827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T08:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a background job for a program using ABAP code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024588#M961828</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;Search the forum for JOB_OPEN and JOB_CLOSE, these function modules are used to create a job from an ABAP program and are often discussed.&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>Mon, 23 Jun 2008 08:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024588#M961828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T08:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a background job for a program using ABAP code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024589#M961829</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 use the JOB_OPEN &amp;amp; JOB_CLOSE FM to schedule a background job for another program.&lt;/P&gt;&lt;P&gt;Check this and do reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ponraj.s.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 08:43:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024589#M961829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T08:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a background job for a program using ABAP code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024590#M961830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;JOB_OPEN&lt;/P&gt;&lt;P&gt;JOB_SUBMIT&lt;/P&gt;&lt;P&gt;JOB_CLOSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the import parameters of function module JOB_CLOSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDLSTRTDT &amp;amp; SDLSTRTTM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to pass the required start date and time (respectively) of your background job. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these are the function modules used to shedule in programmatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 08:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024590#M961830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T08:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a background job for a program using ABAP code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024591#M961831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;Here is the demo program regarding the BDC For the background job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
report zprprbdc1
       no standard page heading line-size 255.

include bdcrecx1.

parameters: dataset(132) lower case.
***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
*
*   If it is nessesary to change the data section use the rules:
*   1.) Each definition of a field exists of two lines
*   2.) The first line shows exactly the comment
*       '* data element: ' followed with the data element
*       which describes the field.
*       If you don't have a data element use the
*       comment without a data element name
*   3.) The second line shows the fieldname of the
*       structure, the fieldname must consist of
*       a fieldname and optional the character '_' and
*       three numbers and the field length in brackets
*   4.) Each field must be type C.
*
*** Generated data section with specific formatting - DO NOT CHANGE  ***
***
***data: begin of itab occurs 0 ,
***
***       matnr(20) type c,
***       mbrsh(30) type c,
***       mtart(30) type c,
***       kzsel(20) type c,
***       maktx(40) type c,
***       meins(5) type c,
***       end of itab.

data: begin of record occurs 0,
* data element: MATNR
        matnr_001(018),
* data element: MBRSH
        mbrsh_002(001),
* data element: MTART
        mtart_003(004),
* data element: XFELD
        kzsel_01_004(001),
* data element: MAKTX
        maktx_005(040),
* data element: MEINS
        meins_006(003),
* data element: MTPOS_MARA
        mtpos_mara_007(004),
      end of record.


*** End generated data section ***

start-of-selection.

*perform open_dataset using dataset.
perform open_group.

**do.
**
**read dataset dataset into record.
**if sy-subrc &amp;lt;&amp;gt; 0. exit. endif.
call function 'GUI_UPLOAD'
  exporting
    filename                      = 'c:\jitu\bdc\10002.txt'
   filetype                      = 'ASC'
   has_field_separator           = 'x'
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
*   VIRUS_SCAN_PROFILE            =
*   NO_AUTH_CHECK                 = ' '
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
  tables
    data_tab                      = record
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17
          .
if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

loop at record .

perform bdc_dynpro      using 'SAPLMGMM' '0060'.
perform bdc_field       using 'BDC_CURSOR'
                              'RMMG1-MATNR'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'RMMG1-MATNR'
                              record-matnr_001.
perform bdc_field       using 'RMMG1-MBRSH'
                              record-mbrsh_002.
perform bdc_field       using 'RMMG1-MTART'
                              record-mtart_003.
perform bdc_dynpro      using 'SAPLMGMM' '0070'.
perform bdc_field       using 'BDC_CURSOR'
                              'MSICHTAUSW-DYTXT(01)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ENTR'.
perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                              record-kzsel_01_004.
perform bdc_dynpro      using 'SAPLMGMM' '4004'.
perform bdc_field       using 'BDC_OKCODE'
                              '=BU'.
perform bdc_field       using 'MAKT-MAKTX'
                              record-maktx_005.
perform bdc_field       using 'BDC_CURSOR'
                              'MARA-MEINS'.
perform bdc_field       using 'MARA-MEINS'
                              record-meins_006.
perform bdc_field       using 'MARA-MTPOS_MARA'
                              record-mtpos_mara_007.
perform bdc_transaction using 'MM01'.

**enddo.
endloop.
perform close_group.
*perform close_dataset using dataset.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;*****************&lt;STRONG&gt;Reward point if helpful&lt;/STRONG&gt;************&amp;amp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 08:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024591#M961831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T08:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule a background job for a program using ABAP code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024592#M961832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;JOB_OPEN&lt;/P&gt;&lt;P&gt;JOB_SUBMIT&lt;/P&gt;&lt;P&gt;JOB_CLOSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use these FM to complete your requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 08:47:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/schedule-a-background-job-for-a-program-using-abap-code/m-p/4024592#M961832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T08:47:04Z</dc:date>
    </item>
  </channel>
</rss>

