End date in SAP under two different scenarios

Hello Team,

I am working on SAP automation to pull the data from SAP; I need to execute this automation twice in a month i.e. first on 4th day of the month and second time on 25th day of the month.
When the report is executed on 4th working day the end date in SAP report should be last working day of previous month and when it is executed on 25th, then it should be current date.
e.g. when this report is executed on 4th April the end date should be 31/03/2023 and on 25th April, the end date should be 25/04/2023.
I’m able to get previous month date and current date separately but not able to build the condition where above criteria can be met.

Looking forward for your expert guidance. Thanks

@KiranBole
Are you using Orchestator?

Regards

Hi @KiranBole ,

Could you let us know what is the challenge that you are facing ? Are you not able to schedule the process on those particular days or are you not able to create a condition to use the different date values on those specific days.

I believe the condition would be that check if the Current Day is 4th, then use the Previous Month Date, if the Day is 25th, then use the same date.

Now.Day = 4

I’m using UiPath studio

I’m not able to create a condition where the date can be entered in SAP as per the criteria.

@KiranBole
If you can get them separately, then you have figured out most of the process. Just combine them in an If Date1 Or Date2 then
If Date1 enter Date Else Date2 enter Date2
Nested If statements should solve the issue.

Regards

Hello @KiranBole

Hope this workflow can help you
if date Less than or equal 4th will return last day of working day in previous month
but if date is more than that will return current date (Since you will run process in 25 it will return date 25th of current month)

Main.xaml (11.2 KB)
in case if you want to test but today is 20 apr you can change value in if condition to 21 to make it true condition

Best Regard,

@KiranBole ,

In that case, as mentioned above , You would require to use an If Condition and assign the value according to the condition.
Maybe something like this :

Thanks, this has helped me.

1 Like

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