cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calculate time difference in a Smartform

webe
Explorer
0 Likes
384

In a Smartform (PDF) I would like to calculate a time difference. Example: Starttime: 11:15, Endtime: 12:20. The result should be showing as 1:05 or similar. How can I achieve this? It seems it does not let me calculate with timestamps. Also using timestamps, it always shows the seconds also, which I do not need, only hours and minutes. Any input is appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

Yanik_Kurzawski
Participant
0 Likes

Hello Bernhard,

I don't know if this is possible within smartforms.

But what should be possible is creating a business rule for this scenario. Your business rule can get your values on Checklist creation or update. You can also get just the calculation for hours and minutes of your timestamps with a function like DATEDIFF() (Regular Functions | SAP Help Portal). Then update the field in the checklist where the value should be shown with the action Update Object on the object ChecklistInstaceElement.
You also need to have a lower order number in this business rule than your business rule that creates a PDF out of checklists, so that the calculation is done before PDF creation.

Hope this helps.

Best Regards
Yanik

webe
Explorer
0 Likes

Hi Yanik.

Many thanks for your quick answer. I will propose this solution to the customer.

Have a nice day.

Bernhard