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

difference between sy-datum and any given date

Former Member
0 Likes
1,322

Dear Friends;

I have one query regarding DATE I wanna calculate the difference between

SY-DATUM and ANY GIVEN DATE . Is there any function or code available that take one parameter as sy-datum and another parameter as any given date and give result as no. of days between them

Regards;

Parag

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
805

Hi,

Just use direct substraction

no_of_days = sy-datum - w_date( given date)

Cheers

VJ

Dear Friends;

I have one query regarding DATE I wanna calculate the difference between

SY-DATUM and ANY GIVEN DATE . Is there any function or code available that take one parameter as sy-datum and another parameter as any given date and give result as no. of days between them

Regards;

Parag

2 REPLIES 2
Read only

Former Member
0 Likes
806

Hi,

Just use direct substraction

no_of_days = sy-datum - w_date( given date)

Cheers

VJ

Read only

Former Member
0 Likes
805

DATA: DATEDIFF TYPE P.

CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
  EXPORTING
    date1                 = '20071122'
    time1                 = '000001'
    date2                 = '20070905'
    time2                 = '000001'
 IMPORTING
   DATEDIFF               = DATEDIFF
 EXCEPTIONS
   INVALID_DATETIME       = 1
   OTHERS                 = 2.

Greetings,

Blag.