Skip to Content

How to schedule a job in such a way as it runs the last day of every month

HI Experts,

I needed to schedule a job today, and during implementing found and issue/interesting question and would like to ask your help on this.

So the situation is the following:

- i scheduled a job what will run periodically (once per month) and will responsible for Close (open) Period for Material Master Records (MMPV)

- used RMMMPERI and saved variant etc.....

My main question/issue is that: I wanted to schedule this job in such a way as it will run the last day of every month. Since not each month contains 31 days (for example february has just 28 days next year) so i can not enter into the date field e.g.: 31.11.2015 and set it to run periodically becuase if i think well (correct me if i am wrong) this job will not run in february 2016 since february has just 28 days.

Anyway i have scheduled the job to run 28. 10.2015 at 23:50 and set it to run periodically ( there is no month what contains less than 28 days) so it will run in case of month contains 30,31 or 28 days.

So all in all my question is:

- is there any option to schedule a job in such a way as it runs the last day of every month without reference to that how many days the month contains ?

Many thanks in advance,

Br David

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 28, 2015 at 11:05 AM

    Hi all,

    Many thanks for both of you for the usefull replies. Definetly this is the correct solution, but i have some concerns:

    - if i define such a factory calendar that defines every day as working day using SCAL i think it can causes some issues:

          - the system will use this calendar during shipping, MRP calculation etc. So for example the system can create shippement(in case automatic shippment creation) for saturday but no one is working on saturday in the plant. So that is why i decided to do not use this solution and keep the settings what i have descirbed in my comment (job will run on 27th of every mont).

    Many thanks one more time i really appreciate your quick help.

    Br David

    Add comment
    10|10000 characters needed characters exceeded

    • Hi David,

      Thank you for the detail description.

      I think everything is clear now.

      To answer you question:

      I don't think that there is a way to schedule a job to be run on the last day of every month without using factory calendar.

      Thanks and best regards,

      Shi Feng

  • Oct 27, 2015 at 06:43 PM

    Hello David,

    You can define a job that starts every end of the monts using SM36 and SCAL.

    First of all define a calendar using SCAL that defines everyday as workday.

    Then when you are defining the job start condition goto last button and enter your calendar and 1 as workday and select end of month.

    As you can see below screen this condition will start your program will start every end workday of the month.  

    Regards,

    Yuksel AKCINAR


    SM36_EndofMonth.jpg (126.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2015 at 02:32 PM

    While the last day of each month is different, the first day is not, so why not just schedule the job at 0:01 on the 1st of each month?

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jürgen,

      Thanks for you help, you are totally right i do not know how i did not think about this and skipped this solution 😀

      I will schedule my job as you adviced really appreciate it.

      Many thanks,

      Br David