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

Get Next Date

Former Member
0 Likes
2,111

Hi All,

I need a FM or class, which gives the next date for a given date. i.e. If i give today's date, i should get tomorrows date..

Reg

Prabhu

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,622

Just add 1 tyo a DATS type field.

regards

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,623

Just add 1 tyo a DATS type field.

regards

Read only

Former Member
0 Likes
1,622
DATA: back_date LIKE sy-datum,
            
 

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date      = '20030812'                                  "08/12/2003
    days      =  1
    months    =  0
    signum    = '+'
    years     =  0
  IMPORTING
    calc_date = back_date
  EXCEPTIONS
    OTHERS    = 1.

kishan negi

kishan negi

Read only

0 Likes
1,622

data: c_date type d value '20070112',

n_date type d.

n_date = c_date + 1.

write: n_date.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,622

Hi,

v1 = sy-datum.

v2 = v1 + 1.

You can try date_in_future fm.

Message was edited by:

Jayanthi Jayaraman

Read only

Former Member
0 Likes
1,622

Hi sekar,

you calculate with date.

data: dat1 like sy-datum.

dat1 = sy-datum.

write: / dat1.

dat1 = dat1 - 1.

write: / dat1.

dat1 = dat1 + 2.

write: / dat1.

Regards, Dieter

Read only

Former Member
0 Likes
1,622

HI,

Use the Function module <b>SAA_COMPUTE_NEXT_DATE</b>.

Give the Date in the Field EXEDATE and you will get the next date .

Regards

Sudheer

Read only

Former Member
0 Likes
1,622

Got it Thanks...

Read only

Former Member
0 Likes
1,622

Hi sekar,

<b>RP_CALC_DATE_IN_INTERVAL</b> - Add/subtract years/months/days from a date

data : v_dates like sy-datum.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 0

months = 12

signum = '+'

years = 0

importing

calc_date = v_dates.