05-24-2017 7:02 AM
Hi All,
I want to find date value for particular date(ex 01/01/2014 = 41640 as in excel).
Is there any FM in SAP to find date value for a particular date.
Thanks in advance.
05-24-2017 7:27 AM
What's your purpose? Nevertheless just MOVE the date field to an integer field.
(Conversion Rules for Elementary Data Objects → Date/Time Fields as Source Fields → Source Field Type)
05-24-2017 7:57 AM
Thanks Raymond. Actually i am trying to find average between 2 dates (between 01.01.2014 & 01.04.2017).
Thanks.
05-24-2017 8:12 AM
Use the implicit conversion from date to integer like when the Abaper add or subtract some integer to a date.
date3 = date1 + ( date2 - date1 ) / 2 .
05-24-2017 10:04 AM
What's wrong with SD_DATETIME_DIFFERENCE and in any case what do you mean by 'Average between 2 dates'. The average what ??? If you really want what you state it is 1 day.
05-24-2017 10:20 AM
Isn't technically a "date" a quantity, the "duration since an initial calendar date", so the average value of two dates can make sense?
Of course expressions like center/middle of range/interval and other ones could have been used 😉
Actually following syntax is also ok in Abap...
date3 = ( date1 + date2 ) / 2.
05-24-2017 8:06 AM
05-24-2017 10:35 AM
05-24-2017 1:16 PM
So what happens when you run a 'Delayed Choice' experiment and turn the detectors on ? Are they then dates or characters or numeric ???
05-24-2017 1:46 PM
Isn't it more like Schroedinger's Cat? The day just is; it is the act of observation that reveals their format. If observed on a computer, they are numeric. Printed and hanging on a wall they are clearly character-based and not suitable for programmatic calculations.
Then there are also the more specialist date formats such as Lego and Stone, not sure if SAP will support those in future versions, maybe if we petition them enough...?
05-24-2017 1:58 PM