cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the time difference (in seconds) between two timestamp fields?

Former Member
0 Kudos

Hi All,

I'm exploring validation expressions in SAP MDM Data Manager version 7.1.07.245

I have two timestamp fields, suppose Update Date and Update-GDS.

What I'm trying to do is prompt a warning when:

(Update Date minus Update-GDS) is greater than or equal to zero seconds

AND

(Update Date minus Update-GDS) is less than or equal to 900 seconds

the bottomline is, Update Date must be equal or greater than to Update-GDS but Update Date must not exceed 900 seconds difference.

my initial try was:

(Update Date - Update-GDS)>=0 s AND (Update Date - Update-GDS)<=900 s

But it always returns true even the time difference between update date and update-gds is beyond the condition.

Can you please guide me through this?

Thank you very much in advance.

Regards,

~erwin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

((Update Date - Update-GDS)>=0 s) AND( (Update Date - Update-GDS)<=900 s)

Try the above code this might help.

Regards,

Abhishek

Former Member
0 Kudos

Hi Abhishek,

I tried your code but it always returns true.

It seems subtraction of timestamp fields do not actually get the time difference... (in seconds)

Is this possible anyway? Or is there any other better approach on this?

Thanks,

~erwin

Edited by: erwin.j.rivera on Dec 14, 2011 8:40 AM

former_member186445
Active Contributor
0 Kudos

you can use class cl_abap_tstmp.

M.

Former Member
0 Kudos

Is this an ABAP Code? I'm only using expressions in SAP MDM Data Manager.

former_member186445
Active Contributor
0 Kudos

yes it's abap

sorry, didn't see the exact forum...

Former Member
0 Kudos

Hello,

If you may please explain the scenario, a solution can be developed.

Regards,

Abhishek