<?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: Executing program in parallel in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940087#M942638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naimesh, can you show me an example code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jun 2008 15:35:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-02T15:35:22Z</dc:date>
    <item>
      <title>Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940084#M942635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I want execute a program with SUBMIT statement, but i need execute it for example 6 times at the same time. The 6 processes must run in parallel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 15:18:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940084#M942635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-02T15:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940085#M942636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SUBMIT will keep your process busy until the called program is finished. For parallel processing you would need to look at asynchronous RFC.&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 15:25:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940085#M942636</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-06-02T15:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940086#M942637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create a JOB and than submit your program with that job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use FM JOB_OPEN, SUBMIT.. using JOBNUMBER , FM JOB_CLOSE to schedule your job and run the programs in parallel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 15:26:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940086#M942637</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-06-02T15:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940087#M942638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naimesh, can you show me an example code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 15:35:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940087#M942638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-02T15:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940088#M942639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Idea is:&lt;/P&gt;&lt;P&gt;You need to call the JOB_OPEN ... JOB_CLOSE FMs inside the Loop, which can get you multiple jobs at a time.&lt;/P&gt;&lt;P&gt;The execution of the jobs will be based on the avaliable JOB PROCESSes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the attached code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: W_COUNT LIKE TBTCJOB-JOBCOUNT,
      W_CLASS LIKE TBTCJOB-JOBCLASS.
DATA: W_UNAME LIKE TBTCJOB-AUTHCKNAM.

PARAMETERS:  W_NAME  LIKE TBTCJOB-JOBNAME DEFAULT 'PARALLEL'.
* the selection parameters which you need to pass to FM
PARAMETERS: FLD1 TYPE CHAR10.



START-OF-SELECTION.

  W_CLASS = 'A'.

  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
*     DELANFREP              = ' '
      JOBGROUP               = 'TEST'
      JOBNAME                = W_NAME
*     SDLSTRTDT              = NO_DATE
*     SDLSTRTTM              = NO_TIME
*      JOBCLASS               = w_class
    IMPORTING
      JOBCOUNT               = W_COUNT
*   CHANGING
*     RET                    =
*   EXCEPTIONS
*     CANT_CREATE_JOB        = 1
*     INVALID_JOB_DATA       = 2
*     JOBNAME_MISSING        = 3
*     OTHERS                 = 4
            .
  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.

* Submit program via jobname and jobcount
  SUBMIT ZTEST_NP1 WITH P_CHAR = FLD1            
                   VIA JOB W_NAME NUMBER W_COUNT
                    AND RETURN.


  CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
*     AT_OPMODE                         = ' '
*     AT_OPMODE_PERIODIC                = ' '
*     CALENDAR_ID                       = ' '
*     EVENT_ID                          = ' '
*     EVENT_PARAM                       = ' '
*     EVENT_PERIODIC                    = ' '
      JOBCOUNT                          = W_COUNT
      JOBNAME                           = W_NAME
*     LASTSTRTDT                        = NO_DATE
*     LASTSTRTTM                        = NO_TIME
*     PRDDAYS                           = 0
*     PRDHOURS                          = 0
*     PRDMINS                           = 0
*     PRDMONTHS                         = 0
*     PRDWEEKS                          = 0
*     PREDJOB_CHECKSTAT                 = ' '
*     PRED_JOBCOUNT                     = ' '
*     PRED_JOBNAME                      = ' '
*     SDLSTRTDT                         = NO_DATE
*     SDLSTRTTM                         = NO_TIME
*     STARTDATE_RESTRICTION             = BTC_PROCESS_ALWAYS
      STRTIMMED                         = 'X'
*     TARGETSYSTEM                      = ' '
*     START_ON_WORKDAY_NOT_BEFORE       = SY-DATUM
*     START_ON_WORKDAY_NR               = 0
*     WORKDAY_COUNT_DIRECTION           = 0
*     RECIPIENT_OBJ                     =
*     TARGETSERVER                      = ' '
*     DONT_RELEASE                      = ' '
*     TARGETGROUP                       = ' '
*      DIRECT_START                      = 'X'
*   IMPORTING
*     JOB_WAS_RELEASED                  =
*   CHANGING
*     RET                               =
*   EXCEPTIONS
*     CANT_START_IMMEDIATE              = 1
*     INVALID_STARTDATE                 = 2
*     JOBNAME_MISSING                   = 3
*     JOB_CLOSE_FAILED                  = 4
*     JOB_NOSTEPS                       = 5
*     JOB_NOTEX                         = 6
*     LOCK_FAILED                       = 7
*     INVALID_TARGET                    = 8
*     OTHERS                            = 9
            .
  IF SY-SUBRC = 0.
    WRITE: 'Job is ready'.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 15:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940088#M942639</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-06-02T15:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940089#M942640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Hope below code snippet helps!&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*Submit report as job(i.e. in background)  
data: lv_tem_job like tbtcjob-jobname value
                             ' TRANSFER TRANSLATION'.
data: lv_jobcount     like tbtcjob-jobcount.
    
 
* Job open 
  call function 'JOB_OPEN'
       exporting
            jobname          = lv_tem_job
            jobclass         = 'C'
       importing
            jobcount         = lv_jobcount
       exceptions
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            others           = 4.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message id sy-msgid type 'A' number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.
 
*Submit job
 SUBMIT zreport and return 
                with p_param1 = 'value'
                with p_param2 = 'value'
                user sy-uname
               via  job       lv_tem_job
                       number    lv_jobcount

  if sy-subrc &amp;gt; 0.
                                       "error processing
  endif.
 
* Close job
  call function 'JOB_CLOSE'
       exporting
            jobcount             = lv_jobcount
            jobname              = lv_tem_job
            strtimmed            = 'X'
            direct_start         = 'X'
       importing
            job_was_released     = lv_job_rel
       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.
    message id sy-msgid type 'A' number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vikram Jalali on Jun 2, 2008 11:59 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 15:58:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940089#M942640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-02T15:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Executing program in parallel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940090#M942641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to everyone for the anwers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 17:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/executing-program-in-parallel/m-p/3940090#M942641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-02T17:31:47Z</dc:date>
    </item>
  </channel>
</rss>

