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

How i can get current year

Former Member
24,229

Hi,

How i can get current year only , is any variable is there to get only curren year only

1 ACCEPTED SOLUTION
Read only

Former Member
8,430

Hi,

sy-datum contains 20071031 (current data).

sy-datum(4) contains 2007 (current year).

sy-datum+4(2) contains 10 (current month).

sy-datum+6(2) contains 31 (current day).

rgs

5 REPLIES 5
Read only

Former Member
0 Likes
8,430

Hi,

Use sy-datum+0(4).

Regards,

Atish

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
8,430

current date holds your current year.

so get year from date.

data:year(4)

year = sy-datum+0(4).

reward if usefull.

Read only

Former Member
0 Likes
8,430

Hi Udhay,

use this.

data : ws_year(4) type c.

ws_year = sy-datum+0(4).

Reward If Useful.

Regards,

Chitra

Read only

Former Member
8,431

Hi,

sy-datum contains 20071031 (current data).

sy-datum(4) contains 2007 (current year).

sy-datum+4(2) contains 10 (current month).

sy-datum+6(2) contains 31 (current day).

rgs

Read only

Former Member
0 Likes
8,430

hi,

either use :

sy-datum+0(4)

use this function:

PERIOD_AND_DATE_CONVERT_OUTPUT Conversion of a date with period specification with output. Import : YYYYMMDD (Internal Date), Language, Country, Internal Period;

1 MM/DD/YYYY

2 WW/YYYY Week

3 MM/YYYY Month

for various formats.

from these u can retrieve the year.

regards,

sohi