Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Released Function Modules for working day calculation

Former Member
0 Likes
2,936

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,

1 ACCEPTED SOLUTION
Read only

kathryn_mcgallicher
Active Participant
0 Likes
2,269

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--

8 REPLIES 8
Read only

former_member184158
Active Contributor
0 Likes
2,269

Hi,

what about this FM  "DATE_CONVERT_TO_FACTORYDATE"

Calendar function: Returns factory calendar date for a date

Regards

Ibrahim

Read only

former_member300076
Participant
0 Likes
2,269

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,

Read only

0 Likes
2,269

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,

Read only

0 Likes
2,269

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,

Read only

0 Likes
2,269

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.

Read only

kathryn_mcgallicher
Active Participant
0 Likes
2,270

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--

Read only

0 Likes
2,269

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.

Read only

0 Likes
2,269

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