How to identify the days of the week in progress. (monday - friday)

Hi everyone,
I would need help with a flow to be developed on SAP.

image

I have to set a range date, on the current week.
The flow should run every day theoretically.
(or maybe every Monday or every Friday this is irrelevant I think)

And in the two cells date: From: To:
I have to enter the two dates of the current week.
From Monday to Friday.
I don’t know how can I find these two dates?

Additionally, I would also need assigns the week + year number.
(2021_03 for example) to be used in final reporting.

Can anyone help me with this?
thanks…
Aaron

Get current day number: (int) CurrentDayNumber = Convert.ToInt32(Now.DayOfWeek)
Get Monday Date: (datetime) MondayDate = now.AddDays(1-CurrentDayNumber)
Get Friday Date: (datetime) FridayDate = MondayDate.AddDays(4)

Get WeekNumber: System.Globalization.CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(Now,System.Globalization.CalendarWeekRule.FirstFourDayWeek,DayOfWeek.Monday)

When you have a variable of datetime, you can customize as you wish.
E.g. Now.ToString(“dd/MM/yyyy”) you will an output of 22/01/2021
You can check this article for more information

WoW!
ok… it works well…
Thanks…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.