cancel
Showing results for 
Search instead for 
Did you mean: 

Add working days to a date

former_member296836
Participant
0 Kudos

Dear all,

I have a date (20120920) where I need to add 10 working days in mapping.

For weekend it would be easily to write a little UDF, but I am afraid

the public holidays (Germany) would not be that easy.

Does anyone got experience with this?

Regards

Chris

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184681
Active Contributor
0 Kudos

Hi Chris,

This might be difficult in PI itself - since as you say, PI wouldn't know the holidays. But you could use an RFC Lookup to execute a FM in ECC to add those 10 days according to a factory calendar. The thread below contains three proposals of function modules to be used:

All you need to do is encapsulate the right FM into a remote-enabled FM and then call it from PI mapping.

Regards,

Greg

gagandeep_batra
Active Contributor
0 Kudos

hi Christain,

Can you explain ur requirement.

what you want add 10 day to day or any thing else?

Regards

Gagan

former_member296836
Participant
0 Kudos

I have a delivery date like 20120920 (Thursday). If I add 3 days, the date 20120923 (Sunday) will be returned, but of course it is not a valid delivery day. So the weekend (Saturday and sunday needs to  be removed. In our example the 20120925 would be the right delivery date.

If Monday would be a public holiday (like easter monday) the correct delivery date would be 20120926.

gagandeep_batra
Active Contributor
0 Kudos

Hi Christain,

you can get this as Glowacki  said, and also i have one more option if you have not more public holiday means max 10 to 20. you can do wit value mapping or fix mapping.

as follow

you need to create two UDF's on is just as same u created addweekend,and second is addDays whose input is output of fixvalues which return how many days  to add, but for that you have to hard coded holidays 

if two or more public holiday come toghert then you have to add more day as i highlighted in below.

and one more thing if you have more public holidays means 4 or 5 together  then  you have to take care for that also by repeating that logic in a loop and for more flexibility  you can use value mapping also

Regards

Gagan

former_member296836
Participant
0 Kudos

Thanks for your detailed description, but I can't use it for public holiday in Germany, because not everyone got a fix date (like eastern). So I would have to do a huge list for the next 20 years or I really have to calculate all public holidays  😞