<?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 Problem with job_close Exception INVALID_STARTDATE = 2 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086141#M1506664</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following is the test program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to split the program execution in to multiple jobs which should run sequentially - one by one, I have populated prev job name and jobcount. As of now for the below code .. i am getting invalid_startdate exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one please let me know, where i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on ECC 6.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To test the below program, copy the below program as it is in to one test program and create a ZTESTV7 program with simple write statement, that can create a spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shilpa.&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;data : v_jobcount TYPE TBTCJOB-JOBCOUNT,&lt;/P&gt;&lt;P&gt;       v_jobname  TYPE TBTCJOB-JOBNAME,&lt;/P&gt;&lt;P&gt;       v_pjobcount TYPE TBTCJOB-JOBCOUNT,&lt;/P&gt;&lt;P&gt;       v_start type char1,&lt;/P&gt;&lt;P&gt;       v_PCHECK type char1,&lt;/P&gt;&lt;P&gt;       v_pjobname  TYPE TBTCJOB-JOBNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_jobname = 'TEST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 5 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-index = 1.&lt;/P&gt;&lt;P&gt;    v_start = 'X'.&lt;/P&gt;&lt;P&gt;    V_pcheck = '' .&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      v_start = SPACE.&lt;/P&gt;&lt;P&gt;      v_PCHECK = 'X'.&lt;/P&gt;&lt;P&gt;  endif.&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                           = v_jobname&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   JOBCOUNT               = v_jobcount&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 ZTESTV7 VIA JOB V_JOBNAME NUMBER V_JOBCOUNT 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                          = v_jobcount&lt;/P&gt;&lt;P&gt;    jobname                           = v_jobname&lt;/P&gt;&lt;P&gt;   PREDJOB_CHECKSTAT                 = v_PCHECK&lt;/P&gt;&lt;P&gt;   PRED_JOBCOUNT                     = v_pjobcount&lt;/P&gt;&lt;P&gt;   PRED_JOBNAME                      = v_pjobname&lt;/P&gt;&lt;P&gt;   STRTIMMED                         = V_START&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;   INVALID_TARGET                    = 8&lt;/P&gt;&lt;P&gt;   OTHERS                            = 9&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt; leave  list-processing.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_pjobcount = v_jobcount.&lt;/P&gt;&lt;P&gt;v_pjobname = v_jobname.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jul 2010 09:27:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-06T09:27:06Z</dc:date>
    <item>
      <title>Problem with job_close Exception INVALID_STARTDATE = 2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086141#M1506664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following is the test program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to split the program execution in to multiple jobs which should run sequentially - one by one, I have populated prev job name and jobcount. As of now for the below code .. i am getting invalid_startdate exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one please let me know, where i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on ECC 6.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To test the below program, copy the below program as it is in to one test program and create a ZTESTV7 program with simple write statement, that can create a spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shilpa.&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;data : v_jobcount TYPE TBTCJOB-JOBCOUNT,&lt;/P&gt;&lt;P&gt;       v_jobname  TYPE TBTCJOB-JOBNAME,&lt;/P&gt;&lt;P&gt;       v_pjobcount TYPE TBTCJOB-JOBCOUNT,&lt;/P&gt;&lt;P&gt;       v_start type char1,&lt;/P&gt;&lt;P&gt;       v_PCHECK type char1,&lt;/P&gt;&lt;P&gt;       v_pjobname  TYPE TBTCJOB-JOBNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_jobname = 'TEST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 5 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-index = 1.&lt;/P&gt;&lt;P&gt;    v_start = 'X'.&lt;/P&gt;&lt;P&gt;    V_pcheck = '' .&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      v_start = SPACE.&lt;/P&gt;&lt;P&gt;      v_PCHECK = 'X'.&lt;/P&gt;&lt;P&gt;  endif.&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                           = v_jobname&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   JOBCOUNT               = v_jobcount&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 ZTESTV7 VIA JOB V_JOBNAME NUMBER V_JOBCOUNT 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                          = v_jobcount&lt;/P&gt;&lt;P&gt;    jobname                           = v_jobname&lt;/P&gt;&lt;P&gt;   PREDJOB_CHECKSTAT                 = v_PCHECK&lt;/P&gt;&lt;P&gt;   PRED_JOBCOUNT                     = v_pjobcount&lt;/P&gt;&lt;P&gt;   PRED_JOBNAME                      = v_pjobname&lt;/P&gt;&lt;P&gt;   STRTIMMED                         = V_START&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;   INVALID_TARGET                    = 8&lt;/P&gt;&lt;P&gt;   OTHERS                            = 9&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt; leave  list-processing.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_pjobcount = v_jobcount.&lt;/P&gt;&lt;P&gt;v_pjobname = v_jobname.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 09:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086141#M1506664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T09:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with job_close Exception INVALID_STARTDATE = 2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086142#M1506665</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;It  may be because, for the first iteration in the loop, you are setting v_start = 'X', which starts the job immediately and for the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next 4 iterations, it is set to SPACE. Please try specifying the start date and time for the jobs being scheduled in these 4 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iterations i.e.(2 to 5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also debug and check if this exception is being thrown for the 4 iterations and not for the first one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sagar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 11:34:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086142#M1506665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-06T11:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with job_close Exception INVALID_STARTDATE = 2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086143#M1506666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This reply is already late to this question however just for future reference. I actually have the same requirement and the same error when executing FM JOB_CLOSE. Fortunately I solved the issue. You don't need to pass the job count for PRED_JOBCOUNT parameter of the FM as this causing the error. You only need the PRED_JOBNAME, which should be unique and STRTIMMED which should be marked with u2018Xu2019 always. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Itu2019s kind a weird because when I executed my program via debugging mode, it shows that this job name has this job number after calling JOB_OPEN however this job number is already assigned to the job of the previous execution of the loop. So, when JOB_CLOSE is called, it throws EXCEPTION 2. I also check SM36/37 there were jobs I created with the same job number. It seemed to me, SAP change the job number during actual execution of the job.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 18:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-job-close-exception-invalid-startdate-2/m-p/7086143#M1506666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T18:22:20Z</dc:date>
    </item>
  </channel>
</rss>

