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

is there any in-built function for date compare?

Former Member
0 Likes
520

I need function which compare dates?

I need function which compare dates?

2 REPLIES 2
Read only

FredericGirod
Active Contributor
0 Likes
437

Hello Albert,

You don't need any function to compare date, SAP do that without any function.

date_1 - date_2 will give you number of day between date_1 and date_2 ....

You need function if you want to work of factory calendar.

Regards

Frédéric

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
437

Hi,

You can simply use > , <,etc.,

Check this sample code.

data : d1 type RM06B-EEIND ,

d2 type sy-datum.

d1 = sy-datum.

CALL FUNCTION 'DATE_IN_FUTURE'

EXPORTING

anzahl_tage = '-7'

import_datum = d1

IMPORTING

EXPORT_DATUM_EXT_FORMAT = d2

EXPORT_DATUM_INT_FORMAT = d2

.

if d1 < d2.

write 'h'.

endif.