Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Datevalue function in SAP

Former Member
0 Likes
1,854

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.

10 REPLIES 10
Read only

RaymondGiuseppi
Active Contributor
1,592

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)

Read only

0 Likes
1,592

Thanks Raymond. Actually i am trying to find average between 2 dates (between 01.01.2014 & 01.04.2017).

Thanks.

Read only

0 Likes
1,592

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 .
Read only

0 Likes
1,592

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.

Read only

0 Likes
1,592

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.
Read only

0 Likes
1,592

Like electromagnetism (wave/particle ) dates in abap carry some duality (character/numeric)

Read only

0 Likes
1,592

So what happens when you run a 'Delayed Choice' experiment and turn the detectors on ? Are they then dates or characters or numeric ???

Read only

1,592

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...?

Read only

1,592

I studied physics and document ABAP now. That fits.