on 2014 Jan 31 12:55 PM
Hi all,
We are on BW 7.31. I have a process chain with a sub chain where a decision step decides whether it is the second working day or not. If not, the process chain stops and goes to the next sub chain. If it is the second working day, it starts a new sub chain where financial data for the last month is being loaded.
The formula for the decision is as follows:
WORKINGDAY_MONTH( SYST-DATUM, 'NL', '' ) = 2
The strange thing now is that in the test systems the decision works fine but in production it is showing strange behavior. I've created three situation:
Situation 1: the 2nd day of the month is the second working day. So the sub chain starts after the decision. And off course not on the 1st and 3rd day.
| calday | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| Mo | Tu | We | Th | Fr | Sa | Su | Mo | Tu | We | |
| workingday | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
Situation 2: the second working day is on monday. What happened in this case, is that the sub chain for financial data also ran during the weekend AND on monday. So as if the weekend days were also set as 2nd working day. This caused problems because of double (triple) requests.
| calday | 27 | 28 | 29 | 30 | 1 | 2 | 3 | 4 | 5 | 6 |
| Mo | Tu | We | Th | Fr | Sa | Su | Mo | Tu | We | |
| workingday | 21 | 22 | 23 | 24 | 1 | 2 | 3 | 4 |
So we changed the formula and we put '-' in the last section (after 'NL', ) so it keeps the last day in memory in case it is not a working day. This was found in the F1 help pop-up in under WORKINGDAY_MONTH in the formula edit screen. So the new formula is:
WORKINGDAY_MONTH( SYST-DATUM, 'NL', '-' ) = 2
Situation 3: with the new formula there was a new problem. With working day 2 on friday, the system keeps the value during the weekend so again saturday and sunday was "sort-of-working-day-2".
| calday | 28 | 29 | 30 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| Mo | Tu | We | Th | Fr | Sa | Su | Mo | Tu | We | |
| workingday | 22 | 23 | 24 | 1 | 2 | 3 | 4 | 5 |
What makes it even more strange is that it only happens on production. I've have checked the tables for factory calendar (TFACD) but they're the same on all systems. Is there another setting which determines the working days or how it keeps them in memory?
Hope someone has seen this before or know a simple setting or solution.
Thanks!
Best regards,
Daan Boon
The Netherlands
Request clarification before answering.
This is really really old. But since I think the issue still exists, I want to suggest a possible workaround.
As mentioned by others the formula (like fm DATE_CONVERT_TO_FACTORYDATE) shifts a date that is not a working date either to the following (+) or the previous working date (-) depending on "correct option". So you cannot know whether it is really a working day or not. Obviously this is really strange and very misleading. Solution could be to add a check if you get the same result for correct option "+" and "-". If you get the same result, it is a date that has not been shifted, so it is a geniune working day. Attached a screenshot fot the 7th working day. Hope this can be useful. Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Boon,
Better try with the below formula;
SUBSTRING( Current Date, 6, 2 ) = '15'.
Here 15 is day in a month. Eg: 15th day of the month.
As we had a similar situation we used this formula.
Thanks,
Ravi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am working in a support project even I am having the similar requirement.
On weekends/holidays I want to trigger sub chain 1 on working days I want to trigger sub chain 2 from Main chain
Can you help me on this?
so I have tried with following conditions
If
DATE_WEEKDAY1( Current Date ) ='6' OR '7' trigger sub chain 1
Else if
WORKINGDAY_MONTH (Current Date, 'FD') < 25 trigger sub chain 2
Else
Sunday/Saturday - It's working fine(As expected sub chain 1)
Working Day - It's working fine(As expected sub chain 2)
Holiday-Not working (Instead of triggering sub chain 1 it's proceeding with sub chain 2)
I have connected if and else condition from step1--->subchain1
else if and else condition to step 2 ----> subchain2
Expectation : I want trigger sub chain 1 on holidays w.r.t factory calendar
Please help on this as soon as possible. I need to transport to production by this weekend.
Regards
Bhargavi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your situation 2, are you sure that the process chain ran on Sunday and on Monday and not twice on Monday (check the system time to be sure)?
It should have worked fine, unless for some reason your "Sunday" chain was started àfter the end of Sunday (e.g. on Monday at 00:00:01) and the "Monday" chain was started before the end of Monday.
The Help (in our system - BW7.31 SP6) is actually quite funny:
Notes
Example 1:
workingday_month(20020501, '01', ' ')
25.12.2002 is a holiday in Factory Calendar Germany Standard. The formula takes 27.05.2002, the 18th working day in December 2002. It returns the value 18 .
Example 2:
workingday_month ('20021225', ' ', '-')
If not specified otherwise, the Factory Calendar Germany Standard is used. The formula takes 24.12.2002, the 17th working day in December 2002. It returns the value 17 .
Example 1 doesn't quite make sense to me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The process chain ran on all these days, where 03.01 and 04.01 were weekend days and 05.01 was monday and also the second workingday.
The Help in our system is also saying:
workingday_month(<date>, <<cal_id>>, <<correct_option>>)
The parameters <<cal_id>> and <<correct_option>> are optional.
If you do not enter anything for these optional parameters, the system uses the default values 01 for Factory Calendar Germany Standard and +. The latter tells the system to return the next working day if the date falls on a weekend or is a holiday.
This underlined section points my problem... Is there a way to debug this?
yup, read that too
ok, so definitely not an issue of "possibly" running the day after (as per your screen shots)
in that case it might just be a bug
these formulas are actually methods of class CL_RSAR_FUNCTION which you can look at via transaction SE80
you'll see that in your case, it basically comes down to running function module DATE_CONVERT_TO_FACTORYDATE twice (with slightly different parameter values)
you can find this when pressing F1 on that formula in the formula editor
so, you can actually "simulate" this to see what happens
good luck!
Message was edited by: Raf Boudewijns
I've tested the FM DATE_CONVERT_TO_FACTORYDATE with different input values. Its exportparameters are as I was expexting...
Import parameters
CORRECT_OPTION: +
DATE: 04.01.2014
FACTORY_CALENDAR_ID: NL
Export parameters
DATE: 06.01.2014
FACTORYDATE: 28999
WORKINGDAY_INDICATOR: +
And visa verse when changing the CORRECT_OPTION from '+' to '-'.
Import parameters
CORRECT_OPTION: -
DATE: 04.01.2014
FACTORY_CALENDAR_ID: NL
Export parameters
DATE: 03.01.2014
FACTORYDATE: 28998
WORKINGDAY_INDICATOR: -
So in the method of the class it continues to calculate with the exported date? So we will always have this problem when the second workingday is on friday or monday..? Why not ignore the CORRECT_OPTION value and don't fill the export date when it's weekend or holiday. This is really a bug.
I think i should make an extra decision variant in the process chain before this one, which decides whether it is weekend or not. If it is weekend/holiday, process chain stops, so it won't get the chance to get to the next decision for workingday. You think this is doable? Or will we still have this problem? Any suggestions?
Maybe make the process chain not as sub chain, but a meta chain. The only thing is that it may only run after the rest of the chain has been running.
Maybe you could raise an issue at SAP (Service Marketplace) and explain the current behavior versus the desired behavior. That way you either get some explanation as to why it works "as (currently) designed" OR you may solve it for everyone (if they agree it's a bug indeed).
Another option could be to include an ABAP process with status update (there's a white paper on how to implement that as it won't work with the standard ABAP process available). Then put your logic in a little program where you're in control of the "green" of "red" status of process calling it. Based on that status, you either proceeed with the chain or trigger another process that just turns green (so your overall chain goes green as well).
Check the factory calendar in Your QA n Production ... These should be one n the same.
Check the factory calender whats the starting date of the week which is there is PROD ?
Regards
KP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.