Question:
Hi all,
I have the fallowing doubt:
I need to subtract two dates (Dates and Hours).
At this moment I have four InfoObjects, two for Dates and two for Hours.
I can subtract the two dates for example: 20.01.2004 – 19.01.2004 is equal 1.
But I would like to subtract 20.01.2004 00:01:00 – 19.01.2004 00:02:00.
How can I do this?
Thanks in advance,
MER
Answer:
You can use Function Module TIMECALC_DIFF, you enter both values in the format YYYYMMDDhhmmss, it will give you the difference in seconds.
Following your example if you enter the values:
20040120000100
20040119000200
the third parameter "Time Zone" refers to your particular local time zone, and you should use here the value contained in System Variable SY-ZONLO.
It will give you 86340 seconds as a result, which is 23 hours and 59 minutes.
Hope this helps.
F.
Answer:
Hi Mer,
Can you tell me how u are able to subtract dates. Did you use a function module? If so can u give me the name of the module.
Thanks so much
bwadmirer1