cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Build Process Automation - How to get current date time

vivekkumar15
Explorer
0 Kudos

Hi All, we are building one Business Process in Build Process Automation, where system needs to check if today's date has reached some specific date ( end of month day for example).

Is there any way that i can get current date time in BPA

View Entire Topic
victor-chan
Advisor
Advisor
0 Kudos

Hi Vivek,

I found there are two ways you can do this:

1) Create a new "Any" variable and call new Date() which gets the current datetime. See image below. Then you can use this Any variable to do whatever you need like checking for end of month with business logic you develop by calling functions available here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date

Just a quick note, if you were to use function .getMonth() remember it's an offset of 1 because starting index is 0 for January.

2) Using custom script. Basically, similar to the above but calling JavaScript built in modules/functions.

vivekkumar15
Explorer
0 Kudos

Hi Victor,

Maybe question was a bit confusing due to word 'workflow'. updated it. Basically it is a business process with business process automation ( and we want to execute workflow with the same. Approvals based on fiori forms)

There are options to create variables, but not any value in them. Also there is no option to add anything like 'custom script'

Is the example given by you is different type of workflow, or am i missing something here

Thanks

vivekkumar15
Explorer
0 Kudos

Thanks Victor

I found where you were doing it. It is automation that you are creating within process.

I guess this automation will run on desktop of some user. So we need Desktop agent on any machine that will run this step.

What i'm doing is creating a worflow, for which need to use some variables. So, having an agent on each user wont be feasible. Am I understanding it correct