2015 Jul 18 7:53 PM
Hello Team,
I looked into function group SCAL / TB01 / KEPC. I could not find a function module that is released by sap for following purpose. There are many Not Released function modules.
I even tried to look for other threads before posting this one.
My requirement is -
If I enter date,based on Factory Calendar I would like to know 6th ,5th and 4th working day before entered date.
Like for example if I entered July 10 and factory calendar is US. so I would like to output will be 6th Working Day = 1 Jul, 5th Working day = 2 Jul and 4th working day = 6 Jul.
I am sure someone might already faced this problem. Please revert with ideas.
Thanks,
2015 Jul 20 5:18 PM
Hello,
Also check out function group FB00. We use module BKK_ADD_WORKINGDAY to calculate a week time frame starting 3 days before and ending 3 days after the current date. You can specify a particular calendar, or none at all, to use in the calculation. Provide your starting date and then calculate for -4, -5 and -6.
Regards,
K--
2015 Jul 18 8:20 PM
Hi,
what about this FM "DATE_CONVERT_TO_FACTORYDATE"
Calendar function: Returns factory calendar date for a date
Regards
Ibrahim
2015 Jul 19 7:43 AM
Hi,
You can use the FM : "HOLIDAY_CHECK_AND_GET_INFO", to check if the entered day is holiday.
1 - Check if the entered day D is Holiday - if yes, output error message ;
2 - Get the the 4th Day = D - 4 ;
3 - Check if the 4th Day is Holiday if yes decrement it by one, and so on for the next day.
Regards,
Sam,
2015 Jul 19 6:14 PM
Thanks Sam,
Appreciate it. I can see holidays using this function module like Sept 7, however its not showing weekends as holidays. Is there some other FM I can use?
Thanks,
2015 Jul 19 8:28 PM
HI Kapil,
You can use the FM "DAY_IN_WEEK", in order to get what you want.
This FM convert your date into the day in the week and returns :
Monday -> 1
Tuesday -> 2
Wednesday -> 3
Thursday -> 4
Friday -> 5
Saturday -> 6
Sunday -> 7
So if the returns value is 6 or 7 => This is the weekend.
Hope that will help you.
Regards,
Sam,
2015 Jul 20 5:15 PM
Thanks Sam,
However DAY_IN_WEEK is is not released by SAP yet. We are using Sfin 2.0 system and there are many things changing with this new system. We don't know for sure if SAP will change the function module in future and if that happens my development may not work. Any other ideas.
2015 Jul 20 5:18 PM
Hello,
Also check out function group FB00. We use module BKK_ADD_WORKINGDAY to calculate a week time frame starting 3 days before and ending 3 days after the current date. You can specify a particular calendar, or none at all, to use in the calculation. Provide your starting date and then calculate for -4, -5 and -6.
Regards,
K--
2015 Jul 20 5:30 PM
Thanks Kathy,
That's exactly what I want, to be able to get working days based on factory calendar. BKK_ADD_WORKINGDAY, does the trick, but its also not released function module, if SAP changes something in that, we will be trouble. But if no other option, we may have to use it.
2015 Jul 20 6:48 PM
My apologies, I overlooked checking the released status. It appears that all of the date calculation modules we are currently using are unreleased.
Best of success to you,
Kathy