Application Development 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: 

ABAP Query: creation of local field (Subtraction between 2 dates)

JulienGirard
Participant
0 Kudos

Hi,

I want to create a local field which will calculate the number of days between 2 dates (for example, document date - posting date).

What I did:

1) Created the user group in SQ03

2) Created the infoset in SQ02

3) I'm stucked at the creation of the Query in SQ01. I'm at the «Create Query: Select field screen». I clicked on Edit --> Local Field --> Create. I selected the «calculation field» attribute. I clicked on the «Complex calculation button», but I don't know how to write my formulate DOCUMENT DATE - POSTING DATE.

Thanks a lot for your help.

Julien

2 REPLIES 2

Former Member
0 Kudos

Try these FM's to calculate difference between two dates..

DAYS_BETWEEN_TWO_DATES

LEAP_DAYS_BETWEEN_TWO_DATES

HR_SEN_CALE_DAYS_DATE

ISB_DAYS_BETWEEN_TWO_DATES

FIMA_DAYS_BETWEEN_TWO_DATES

FIMA_DAYS_BETWEEN_TWO_DATES_2

FIMA_LEAP_DAYS_BETWEEN_2_DATES

SD_DATETIME_DIFFERENCE

Former Member
0 Kudos

Hi,


You can define a variable of type I and just subtract both dates.

Thanks

Arun