cancel
Showing results for 
Search instead for 
Did you mean: 

Given a date, how to find the nearest Monday using SAC Data Action

SP9
Explorer
0 Kudos
215

Hi Experts,

Given a date in integer format, how to find the nearest Monday of it in SAP SAC data action. 

We have a date in interger format in a measure called: "Shipment Date", that will be entered by the planner, and we need to find the nearest Monday after 10 days, that's the max "Delivery by Date".

So, for example, Shipment date is: 05/27/2024,  the delivery date should be calculated as: 06/03/2024, instead of 06/10/2024, as this is the nearest Monday to date: 06/06/2024, when added 10 days to 05/27/2024. 

Thanks,

SP

View Entire Topic
ThomasK
Participant
0 Kudos

Hi @SP9 , I´m afraid this can´t be solved with a data action. If it´s an option for you, it´s more likely you can solve it with scripting in a story. -- Thomas

SP9
Explorer
0 Kudos
Hi Thomas, Thanks. Can you please give the solution on solving this with scripting in a story?
ThomasK
Participant
0 Kudos
Sorry, I don´t have a code available for this. If you are familiar with JavaScript you should be able to manage it.