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

REGARIDNG DATES

Former Member
0 Likes
1,428

is there any function module by which i can get a date one year older than the the system date.

or any other way to do it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,221

Hi,

current date = sy-datum - 365

regards

9 REPLIES 9
Read only

Former Member
0 Likes
1,221

data : l_date type sy-datum.

l_date = sy-datum - 1.

Read only

Former Member
0 Likes
1,221

Hi

You can simply subtsract the no of days from the date you will get that date

New date = sy-datum - 365 (or 366 depending on year condition)

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
1,222

Hi,

current date = sy-datum - 365

regards

Read only

Former Member
0 Likes
1,221

hi

good

there is no such function module for the same,you have to write the logic by calculating the Sy-datum.

thanks

mrutyun^

Read only

Former Member
0 Likes
1,221

Hi ,

You can use the FM

DATE_IN_FUTURE

GIVE -365 DAYS

OR USE THE FM

MONTH_PLUS_DETERMINE

-12

AS THE PARAMETER.

Regards,

IFF

Read only

S0025444845
Active Participant
0 Likes
1,221

hi,

try this,copy paste n run.

data: l_date type sy-datum.

l_date4(2) = sy-datum4(2).

l_date6(2) = sy-datum6(2).

l_date0(4) = sy_datum(4) - 1.

write: l_date.

regards,

sudha.

Read only

Former Member
0 Likes
1,221

hi

if date format is yyyymmdd

year = sy-datum(4).

month = sy-datum+4(2).

day = sy-datum +6(2).

year = year - 1.

concatenate year month day into date.

write : date.

Read only

Former Member
0 Likes
1,221

Hi,

Use the Function Module <b>CALCULATE_DATE</b> to Increase/decrease DATE by a specific number of Days/Months

Regards

Sudheer

Read only

S0025444845
Active Participant
0 Likes
1,221

Hi,just copy paste n run.

data: l_date type sy-datum.

l_date4(2) = sy-datum4(2).

l_date6(2) = sy-datum6(2).

l_date0(4) = sy-datum0(4) - 1.

write: l_date.

regards,

sudha