SAP BW (Business Warehousing)
SAP BW (Business Warehousing) Forum
My requirement is
How to run the process chain first 8 working days of every month.
Can anyone recommend how to fulfill this requirement?
And where I have to write in process chains?
You can view more tutorials about SAP BW
Suppose we need to run a Process chain first 8 days of every month.....
In this case..........Create a Factory Calendar using Tcode SCAL.......there declare first 8 days as Working days and rest all as Holidays.
Right click on the Start Process >> Display variant >> Change Selections >> Click on Date/Time tab >> Click on the Restriction tab (F6) >> there maintain the Calendar id and Select Do not Execute on Sundays or Holid.........>> Then Check and Transfer........... Then in the Scheduled start field give the date when the Chain is going to run for the first time............
Then the Process chain will only run as per the above requirement.
You can use Decision Between Multiple Alternatives.
1.If - WORKINGDAY_MONTH( Current Date, 'Factory Calendary day', '' ) < 9-Chain will trigger first 8 workign days of factory calendar
2.Else-If it's greater than 8th woking day chain will not trigger.
I have two options for you.
Please try the below two things at the starting of your Process chain after the Start Variant,
1) Decision between Multiple alternatives:
See, if you have any formuala / Condition where you can use like, if First 8 WDs - then true (1) else False (2).
In this case, if it can recognize the first 8 days then it will pass through 1st option, else it will go through 2nd option and get finished.
2) ABAP Program / ABAP Program with Status:
Write an ABAP code, which will read System date/month/year. When the Program recognizes the first 8 days of month, then it will run further. Else, keep a dummy step which ends if condition is not true.
Hope this helps.
Let me know if you are looking for more info.
Thank you very much.
Can you send how to write the code in Decision Between Multiple Alternatives?
Even I don't know ABAP coding.
If you feel free send to me ABAP Code also. And where I have to write the ABAP Code.
Once again thank you very much.
Can you set up a Factory Calendar and then run the Process Chain Daily with a Restriction on this new Factory Calendar. We have done this to run a process chain on a specific user nominated day each period, and also to exclude running a process chain on a user defined date. I'm sure it should work on a range of dates somehow.
How to write formula in DBMA.
Please try if the below code works.
Since I have not tried myself, I don't know if it works.
Also, one more thing that you can try is to go for an Event triggered process chain.
Create an EVENT in sm64.
Create one chain with Start variant & an ABAP code step below Variant, and call EVENT as per the below condition.
Place this EVENT in your whatever chain which has to run first 8 days of a month.
data: lv_day type int1.
lv_day = sy-datum+6(2).
move sy-datum+6(2) to lv_Day.
if lv_day lt 9.
CALL "whichever event you want".
You can take suggestion from any ABAPer of your team for this.
Also, as our experts said in the above posts, please try those if you think this is too complicated.
Sign up for STechies
Ask Question From Our Experts