Skip to Content
author's profile photo Former Member
Former Member

CLEAN_REQREQ_UP

We are running SRM 4.0 in extended classic scenario and have R/3 4.70 as our backend.

I have a custom program that is creating a background job that runs the CLEAN_REQREQ_UP program. My question is, is there anyway for me to know when this job has completed? Ideally I'd like the program to submit the background job for CLEAN_REQREQ_UP and then wait for the job to complete before processing further. Anyone have an idea on how to solve this problem?

Best regards,

Shawn O'Connor

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2008 at 06:19 PM

    Hi,

    In a single if you define multiple objects ( Programs), system automatically trigger the jobs in a sequence you have in a Job.

    Hope this resolves your problem.

    Thank you

    Sreedhar Vetcha

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Sreedhar-

      Thank you for your response. I'm not sure I understand your recommendation. In my situation I have custom program that is submitting the CLEAN_REQREQ_UP program via a background job. This is done because you cannot submit the program directly. The submission of the CLEAN_REQREQ_UP program is actually happening in a loop. So I want the job to complete before the next loop is done and consequently submits the job again.

      Best regards,

      Shawn O'Connor

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2008 at 06:22 PM

    Hi,

    You can use "Commit Work and Wait" statement after scheduling your backgrnd job and check SY-SUBRC before processing the further task.

    BR,

    Disha.

    Do reward points for useful answers.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Disha-

      Thank you for your response. I'm familar with the commit work and wait statements but I'm unsure on how to incorporate them in this example. Could you expand on your thought. Below is my actual code, if you look at the last statement you will see I am utilizing the wait command. This has had limited success as the job doesn't alway complete within the thirty second wait time I've specified. Can you please expand on how I might utilize commit work in combination with the wait statement.

      Best regards,

      Shawn O'Connor

      • Create Background Job

      call function 'JOB_OPEN'

      EXPORTING

      delanfrep = ' '

      jobgroup = ' '

      jobname = jobname

      sdlstrtdt = sy-datum

      sdlstrttm = sy-uzeit

      IMPORTING

      jobcount = jobcount

      EXCEPTIONS

      cant_create_job = 01

      invalid_job_data = 02

      jobname_missing = 03.

      if sy-subrc ne 0.

      "error processing

      endif.

      • Insert program into job as step

      submit CLEAN_REQREQ_UP

      using selection-set 'CLEANER'

      user 'SRM_BATCH'

      via job jobname

      number jobcount

      and return.

      if sy-subrc > 0.

      "error processing

      endif.

      • Close job

      starttime-sdlstrtdt = sy-datum.

      starttime-sdlstrttm = sy-uzeit.

      starttimeimmediate = 'X'.

      call function 'JOB_CLOSE'

      EXPORTING

      jobcount = jobcount

      jobname = jobname

      strtimmed = starttimeimmediate

      IMPORTING

      job_was_released = job_released

      EXCEPTIONS

      cant_start_immediate = 01

      invalid_startdate = 02

      jobname_missing = 03

      job_close_failed = 04

      job_nosteps = 05

      job_notex = 06

      lock_failed = 07

      others = 99.

      if sy-subrc eq 0.

      "error processing

      endif.

      wait up to w_thirty seconds.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.