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

date problem

Nawanandana
Active Contributor
0 Likes
594

hai

i want to increased date in to one year.....how should i do it?

EG: current date 2006.12.31

i want to increased 2007.12.31

plz tel me how should i do it?

regard

nawa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
578

Hi,

Use the below Funtion module

RP_CALC_DATE_IN_INTERVAL

Example:

data: v_date type sy-datum.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = '20061231'

DAYS = 0

MONTHS = 0

SIGNUM = '+'

YEARS = '01'

IMPORTING

CALC_DATE = V_DATE.

WRITE:/ V_DATE.

5 REPLIES 5
Read only

former_member189629
Active Contributor
0 Likes
578

U can de it simply by using offsets..

suppose date = 2006.12.31.

concatenate ( date+0(4) + 1 ) '.' date + 5(2) '.' date + 7(2) into date 1.

reward if helpful,

Karthik

Read only

Former Member
0 Likes
578

hi,

DATA: gv_date(11)," LIKE ekpo-aedat,

gv_date1(11),

year(4),

month(2),

day(2),

gv_date1 = sy-datum.

year = gv_date1+0(4).

month = gv_date1+4(2).

day = gv_date1+6(2).

year = year +1.

CLEAR gv_date1.

CONCATENATE year month day INTO gv_date1.

regards

siva

Read only

Former Member
0 Likes
578

Hi,

Suppose ur date is the current date i.e sy-datum use the offset as follows:

sy-datum+0(4) + 1

what this does is it increments the year part by one.

Make sure about yout date format and use the offset value.

Regards,

Sai

Read only

Former Member
0 Likes
578

You can use FM 'MONTH_PLUS_DETERMINE'. Input initial date and number of months: 12 in your case. result is the date after one year.

Read only

Former Member
0 Likes
579

Hi,

Use the below Funtion module

RP_CALC_DATE_IN_INTERVAL

Example:

data: v_date type sy-datum.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = '20061231'

DAYS = 0

MONTHS = 0

SIGNUM = '+'

YEARS = '01'

IMPORTING

CALC_DATE = V_DATE.

WRITE:/ V_DATE.