In sap automation, if the date should be taken as per the current month how to set the field in sap.
Can you please elaborate
If you need current date then use Now.ToString("FormatYouNeed")
If you want to add days use Now.AddDays(numberofdaysplusOrminus)
Cheers

every month if we run the sap then it should take the year and period of current month how to do that?
Year will be Now.Year.ToString
What do you mean the period?
The start and end of current week?
Cheers
according to the financial year
apr2023 - mar 2023 is the current year
how to declare that in sap
if we declare as now.year.tostring then the current year 2024 is getting but I want the year according to the financial year
if the financial year is constant like april to march every year use the below expressions
"apr"+now.addyears(-1).tostring("yyyy")
"mar"+now.tostring("yyyy")
how to declare this in SAP

2023 because according to the financial year feb is 2023(apr-march is 2023)
I might be apr 2023 - mar2024 and fy would be 2023 yes
so you can use something like this…if the month is in jan,feb or mar it would be previous year else it would be current year
so If(Now.Month>3,Now,Now.AddYears(-1)).Year.ToString - this will give the required financial year
Hope this helps
cheers
how to set period
period means month number
like apr means 1 may means 2 so the current month is jan so it should be 10 how to set period
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.