Schedule Job with Job_close after successful job doesn't work

Hi guys,
I'm using FM CLOSE_JOB with parameters : 
            JOBCOUNT             = w_JobId
            JOBNAME              = w_JobName
            PREDJOB_CHECKSTAT    = 'X'
            PRED_JOBCOUNT        = w_oldJobId
            PRED_JOBNAME         = w_oldJobName
I have about 9 jobs wich must run the one after the others. The first start without PRED* parameters, but the 8 others one are filled with CHECKSTAT, and previous job name and id.
It works fine for the side "the one after the others", BUT, wathever the previous job give as result (cancelled or finished), the next one starts whereas I pass the parameter CHECKSTAT to X.
Any ideas of the problem and how to solve it?
Thanks in advance for your answers.

Here my code with explanation :
REPORT  YCOMJ023.
start-of-selection.
"Initialization of my vars
w_StepCount = 0. >> number of steps maxi in a job
w_jobCount = 1.  >> number to see easier in SM37 the job order
CONCATENATE pe_name '_STEPS' w_jobCountC INTO w_JobName. (example : TOTO_STEP1)
CONDENSE w_JobName NO-GAPS.
"I open my first job
  CALL FUNCTION 'JOB_OPEN' (OPEN job TOTO_STEP1)
    EXPORTING
      jobname          = w_JobName
    IMPORTING
      jobcount         = w_JobID
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.
"We keep in memory first job IDs to close it at the end of the prg
  w_firstjobName = w_JobName.
  w_firstjobID = w_JobID.
"imagine you do the bellow code in a loop and it makes several jobs TOTO_STEP2 TOTO_STEP3 TOTO_STEP4...
ADD 1 TO w_StepCount.
IF w_StepCount GT 250.
    "I call close job eatch time I reach 250 steps
     PERFORM fx_jobclose.
ENDIF.
submit RKGALKEUB to sap-spool and return
                                   without spool dynpro
                                   spool parameters print_parameters
                                        VIA JOB w_JobName NUMBER w_JobID
"End of the programmI close the current Job and the first one :
"Current
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            JOBCOUNT             = w_JobId
            JOBNAME              = w_JobName
            PREDJOB_CHECKSTAT    = 'X'
            PRED_JOBCOUNT        = w_oldJobId
            PRED_JOBNAME         = w_oldJobName.
"First one + launch with STRIMMED
        CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          JOBCOUNT             = w_firstjobId
          JOBNAME              = w_firstjobName
          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.
*&      Form  fx_jobclose
*       text
FORM fx_jobclose.
  "Step to zero to do a new loop after this form
  w_StepCount = 0.
  DATA : w_job_released TYPE CHAR1.
  "If the flag IsFirst, we don't do nothing, because it's the first JOb, and it should not be closed
  IF w_IsFirst = 'X'.
    "Flag is set to blank
    w_IsFirst = ''.
  ELSE.
      "Else it mean we are closing a job with predecessor :
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          JOBCOUNT             = w_JobId
          JOBNAME              = w_JobName
          PREDJOB_CHECKSTAT    = 'X'
          PRED_JOBCOUNT        = w_oldJobId
          PRED_JOBNAME         = w_oldJobName
          "SDLSTRTDT            = sy-datum
          "SDLSTRTTM            = sy-timlo
        IMPORTING
          JOB_WAS_RELEASED = w_job_released.
  ENDIF.
  "Vars get the value of current job, witch will become the older one
  w_oldJobId = w_jobID.
  w_oldJobName = w_JobName.
"I make the new TOTO_STEPX job name
  ADD 1 TO w_jobCount.
  w_jobCountC = w_jobCount.
  CONCATENATE pe_name '_STEPS' w_jobCountC INTO w_JobName.
  CONDENSE w_JobName NO-GAPS.
  "I open the new job
  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = w_JobName
    IMPORTING
      jobcount         = w_JobId
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.
ENDFORM.                    "fx_jobclose
I hope my code is clear enought, I tried to delete the superfluities code.

Similar Messages

  • Replacing a subclip with an After Effects Composition doesn't work properly

    I have a Premiere Project with DV PAL footage. I have gone through my footage and identified all sorts of subclips in my project, and arranged them into bins.  For a few, on the sequence timeline, I want to replace them with After Effects Compositions so I can add some effects.
    If I right-click on a designated subclip (or part of a subclip), and choose "Replace with After Effects Composition", After Effects starts up and I end up with an After Effects project containing 3 items:
    - a composition called "MyProject Linked Comp 1" (duration: length of sub clip, but the comp's layer itself (the next comp) has a duration of zero, so I just see black)
    - another composition called "My Subclip" (duration: length of subclip, starting at beginning of original video footage, not at start of subclip),
    - and then the full original video file also called "My Subclip" (and I mean the full original video file that the subclip points to).  This is full length.
    The linked Composition is therefore viewed as being blank in After Effects, and is returned as such in Premiere Pro.
    What does work properly is if I simply drag a selected clip (in/out) from the Source Monitor in Premiere Pro to the sequence timeline, and then right click and choose  "Replace with After Effects Composition".
    Then I end up with an After Effects project containing:
    - a composition called "MyProject Linked Comp 2" (duration: length of selected clip, and the comp's layer itself (the next comp) has the correct duration, so I see the selected clip!)
    - another composition called "My SourceVideo" (duration: length of full original video, starting at beginning of original video footage, not at start of subclip),
    - and then the full original video file also called "My SourceVideo" (and I mean the full original video file that the selected clip points to).  This is full length.
    In this case the linked Composition is therefore viewed as being the selected clip in After Effects, and is returned as such in Premiere Pro.
    So subclips don't work as I would expect them. I have also tried with a few different video formats. Can anyone else reproduce this behaviour, or even better, find a way to make it work?
    I am running Windows Vista x64 Ultimate, 8GB ram, CS4
    Message was edited by: bobbymacadobe - added system info

    I had the same issue. Created multiple subclips from various parts of a master, mixed subclips on the timeline (all from the same master clip) and when I replace it with an AE comp is send it over with 1 subclip only (eg I had clips for showroom and warehouse, it only send showroom) so any refences to the clips it didn't send were blank!
    So I had to replace all the clips with the master clip (I would like to know if there is a quick way to revert subclips back to master, had to do it manually and it was a pain) and now it is working fine. This doesn't mean subclips don't work; if all the clips are derived from the same subclip it worked for me.

  • Scheduling jobs with condition-after job programatically

    Hi,
    Could anybody please tell me how can we schedule jobs from programs(prgramatically) with condition-start after job(after a particular job completed) like we have the same option in sm36.
    Thanks,
    Rahul.

    Hello Rahul,
    Check the following Link Page Number 41.
    "Sample Program: Wait for Predecessor Job with
    JOB_CLOSE"
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBLIB/BCDWBLIB.pdf
    Regards,
    Abhishek Jolly

  • Schedule job with JOB_CLOSE until a certain time

    Hello all,
    I'd like to schedule a background job with JOB_CLOSE until a certain time, i.e. first start time at 10 a.m., repitition period 15 min., last start time 1 p.m.
    I tried this using parameter LASTSTRTTM, e.g.:
    i_startdate = sy-datum.
    i_starttime = '100000'.
    i_prdmins = '15'.
    i_laststrtdt = sy-datum.
    i_laststrttm = '130000'.
    CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = l_jobcount
          jobname              = 'MY_JOB'
          sdlstrtdt            = i_startdate
          sdlstrttm            = i_starttime
          laststrtdt           = i_laststrtdt
          laststrttm           = i_laststrttm
          prdmins              = i_prdmins
        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.
    but I didn't succeed - the job didn't stop at 1 p.m. Any hints?
    Best regards
    Martin Lehmann

    Hi Martin,
    i_startdate = sy-datum.  " 1st time Job Start Date
    i_starttime = '100000'.
    i_prdmins = '15'.
    i_laststrtdt = sy-datum.  " If Job is not started by this date, then it wont be started once this date is completed
    i_laststrttm = '130000'.
    What it means is, if i want to start a job by 10th Oct.. & expect that it should be started maximum by 20th Oct.. If its 20th Oct & still the job is not started,... then terminate the job & do not start it..
    If the job is already started, then it wont stop.
    Hope its clear.
    Best regards,
    Prashant

  • Just bought my white iphone4 and after syncing with my computer the speaker doesn't work now. I tried reset and even restore and still does not work. Do I have to exchange?

    Just bought my white iphone4 and after syncing with my computer the speaker doesn't work now. I tried reset and even restore and still does not work. Do I have to exchange?

    Make sure the silent switch is not set to mute.  If you can see the red dot, it is on mute.
    It may think you have headphones plugged in, try plugging and unplugging a wired headset a few time.
    The next step would be to restore as new.
    If none of that works, a warranty exchange would be the resolution.    

  • I bought an app for my iphone version 3.1.3 and it is written in the requirements that it is compatible with IOS 3 or later and after installing it doesn't work.i bought it from the apple store.

    i bought an app for my iphone version 3.1.3 and it is written in the requirements that it is compatible with IOS 3 or later and after installing it doesn't work.i bought it from the apple store

    You could try reporting the problem to iTunes store support here: http://support.apple.com/kb/HT1933.

  • I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    There is no more LiveType with Motion 5.  You may want to go to the Final Cut Express forum, as that's the only place it's existed for the last few years.

  • MY IPOD APPEARS TO BE ZOOMED INTO THE SCREEN AT ALL TIMES, MAKING IT DIFFICULT TO DO SIMPLE TASKS SUCH AS GO BACK, OR SELECT A PLAYLIST, ETC. I'VE TRIED PULLING IT OUT WITH MY FINGERS BUT THAT DOESN'T WORK. PLEASE CAN YOU HELP!!! THANKS.

    I've got a touch iPod and for about a week now it's almost been permenently zoomed into the screen? I actually cannot get it to zoom back out. I've tried pulling the screen out with my fingers but that doesn't work. It's zoomed in on my home pages, on my music, settings everything! It makes simple things like deleting a number from my password login extreamly differcult. Please can someone help?!?! Thanks.

    Double tap the screen with three fingers to un-zoom.
    Then go to Settings > General > Accessibility > Zoom and turn this OFF.

  • I bought one Iphone a 3 weeks ago and I can´t listen what people speak with me, because de microphone doesn´t work, I need  to use the speaker, somebody know what I need to do?

    I bought one Iphone a 3 weeks ago and I can´t listen what people speak with me, because de microphone doesn´t work, I need  to use the speaker, somebody know what I need to do?

    Just thought that I'd report that I've decided on my solution.
    It seems that just making do with what I can find on the US store is the easiest and perhaps also the best way of going about it. All other methods mean trouble. I'm lucky that China hasn't outright blocked the US store, as they HAVE blocked iTunes music store in China already (something about a song about Tibet caused them to block the store entirely).
    So yeah, just going to deal with it I guess. I should be grateful I'm getting anything at all, considering the country I'm in. Still, I just feel so ripped off sometimes when I pay for expensive devices and I can't even get much out of them do to my region. iPhones cost around $700 in China because there's no company like AT&T that you can just sign a contract with to get one, so you have to pay up-front for the phone, and get less features out of it in the end. Makes buying smart phones look like a waste of time and money sometimes, since you can't use the device to do what it was built to do due to censorship and not having any content for your region (though they do have a lot of Chinese apps that I can't use due to not knowing Chinese).

  • I have ipad with IOS 7,  Some apps doesn' t work, safari not open some web site. What can I do?

    I have ipad with IOS 7,  Some apps doesn' t work, safari not open some web site. What can I do?

    Try this and see if it helps.
    Settings>Safari>Clear cookies and data.
    Now close Safari completely. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then "swipe up" or "drag up" on the app preview thumbnail to close it.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • I have internet optic fiber connection and I'm trying to configure it with my Airport Express but doesn't works, appears that I have IP and DNS, as I'm a computers dummy , who could help me to configuration it, please?

    I have internet optic fiber connection and I'm trying to configure it with my Airport Express but doesn't works, appears that I have IP and DNS, as I'm a computers dummy , who could help me to configuration it, please?

    You're welcome.
    Voicemail is left at your carrier's server. That will continue to work unless you report your iPhone as lost or stolen with your carrier.
    You may never find it again and you can't if the iPhone remains offline or out of service which means the iPhone is powered off or doesn't have cellular reception.

  • Schedule job with dependencies in another job

    Hi All,
             I Have a job in sm36 schedule but I want to create a new job and will be started after my first job,
       for exemple : I have a job Test1 started in 30 and 30 minutes and I create a new job test2 that this job has to executable after the job test1, I can to do this but my slave job only executable one time, I need that this job stay continued always after job test1 and don't finish.
    Thank for Help.
    Regards,
    Osvaldo Antonio dos Santos

    Hi,
    I am afraid your reqmt may not be possible.
    You can very well run one job after another job by maintaining the After event parameters in SM36. However you cannot enable a job run for ever. Once there is no input meeting the selection criteria, teh job will finish.
    Instead of thinking of enabling the job for ever, you can maintain the jobtest2 as after event of jobtest1.
    After that you can create jobtest3 using the same variant of jobtest2 and schedule it to run once in 15 min or 30min or so.
    Hope this helps you
    Pls reward if it is of some help to you

  • Check in dialog with Adobe Drive 4.2 doesn't work

    Hi,
    we are currently implementing a custom check-in dialog using Adobe Drive 4.2.
    The dialog looks like the example given in discussion "Custom check in dialog".
    To build the SWF, I use Flash Builder 4.5 with Adobe Flex SDK 4.0.0 (flex_sdk_4.0.0.14159A).
    I have created a new Flex Project with Application type "Web" and added a MXML Modul with name "CustomUI" and option "Do not optimize (module can be loaded by multiple applications)".
    After compiling the project I extract the "CustomUI.swf" and copy the file in the "resources" folder of my Custom Adobe Drive adapter.
    I implement the "IGetCustomCheckInUIHandler", "ICanEnableCustomCheckInUIHandler" and "IGetCustomCheckInUIContextInfoHandler":
    "IGetCustomCheckInUIHandler" sets the module url like
    response.setModuleURL(Thread.currentThread().getContextClassLoader().getResource("resource s/CustomUI.swf"));
    "ICanEnableCustomCheckInUIHandler" enables the custom ui dialog with
    response.setCanEnable(true);
    "IGetCustomCheckInUIContextInfoHandler" adds some context data like
    Map<String, Object> contextInfo = new HashMap<String, Object>();
    contextInfo.put("key1", "test1");
    response.setContextInfo(contextInfo);              
    (Also hidding the "IGetCustomCheckInUIContextInfoHandler" in "IRemoteHandlerFactory" doesn't work.)
    Right click on an checked out asset in Windows Explorer and click on "Adobe Drive 4/Check in..." does following:
    1. "IGetCustomCheckInUIHandler" called
    2. "ICanEnableCustomCheckInUIHandler" called
    3. "IGetCustomCheckInUIHandler" once more called
    4. "IGetCustomCheckInUIContextInfoHandler" called
    5. The default check in dialog is shown (with no custom ui extension), the default dialog hangs (OK/Cancel doesn't react on click, the dialog is freezed). Only the close button (X in the right upper corner) works.
    How is it possible to provide a custom ui check in dialog?
    Thanks

    Hi again.
    I found where the problem was (at least in my case).
    To go to the point: go in the "properties" of your flex project. In the menu, go in "Flex Build Path" and then in "Library Path". Then, the option "Framework linkage" is with the default value in a new flex project.
    So here is the trick : with Flex 3 (so Adobe Drive 3), the default value is "merged into code".  Bug in the Flex 4 (so Adobe Drive 5), the default value is "Runtime Shared Library".
    And because the module is ran independently (with no link with the flex code that load your module), the flash player crashes because it doesn't find your libraries (like ICustomCheckinUI).
    I discovered this problem running the Custom UI from the windows explorer (not with Bridge) and using the Flash Player Debug version, and watching the error log files of the Flash Player.
    So in the end, when I checked "merged into code" in the Framework Linkage option, all my dependencies of my flex module were merged into my final module swf, and no more flash crash.
    Sorry for my bad english and hope it helped.
    Guillaume
    (edit : screenshot at http://www.hostingpics.net/viewer.php?id=276932flexbuildpath.png )

  • IPad 4 with iOS 8 "read list" doesn't work

    After updating to iOS 8, read list  feature in Safari doesn't work animore!!!((( I can not read articles without the intertnet!
    And also, Apple, come on, make iWork for free for rest of you costomers! It's ridicules to pay 30$ just only because that I bought the iPhone 4 and iPad 4 erlier...and even by highest price!

    Hi
    Sorry for being too nitpicky - BUT
    You indicate iOS 8.1.2 on iPhone 4
    Either you have a 4S or you have iOS 7.x
    But with that said
    Can you please check Settings -- General -- Accessibility - scroll down to Interaction -- Call Audio Routing and see if Automatic is checked?
    Thanks

  • Textvariable with replacement path for 0CALMONTH doesn't work ...

    Hello expert,
    we have done release upgrade BW 7.01 -> BW 7.3 SPS 04. While checking queries I found out that textvariables with replacementpath for 0CALMONTH doesn't work anymore. In the report I only see the variable name like ZVARXYZ01 but want to see something like 'JAN 2011'.
    As far as I understand 0CALMONTH don't need a texttable. Texts can be found in table T247. I checked the table and all values looks fine.
    Any Idea where the problem is or how I can analyze it?
    Thank you in advance,
    Peter

    Hi Peter
    Please check this link, especially this note for text variable problems after upgrade to 7.3
    Let us know if it helps.
    Think of giving points.
    Regards
    PC

Maybe you are looking for