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

System fields

Former Member
0 Likes
790

Can any one tell me what is the system field for current year.

1 ACCEPTED SOLUTION
Read only

bpawanchand
Active Contributor
0 Likes
517

Hi

there is no direct system field for finding the current year but you can use SY-DATUM

WRITE :
 / SY-DATUM+0(4).

or use

GET_CURRENT_YEAR  "Function Module

CALL FUNCTION 'GET_CURRENT_YEAR'
  EXPORTING
    BUKRS         = '1000'     " Company Code
    DATE          = SY-DATUM   " Date to find fiscal year for
  IMPORTING
    CURRM         = w_currm    " Current Fiscal Month
    CURRY         = w_curry    " Current Fiscal Year
    PREVM         = w_prevm    " Previous Fiscal Month
    PREVY         = w_prevy.   " Previous Fiscal Year

Regards

Pavan

3 REPLIES 3
Read only

valter_oliveira
Active Contributor
0 Likes
517

Hello.

Current year is in current date field sy-datum: like sy-datum(4).

Check all system fields in structure SYST.

Regards,

Valter Oliveira.

Read only

bpawanchand
Active Contributor
0 Likes
518

Hi

there is no direct system field for finding the current year but you can use SY-DATUM

WRITE :
 / SY-DATUM+0(4).

or use

GET_CURRENT_YEAR  "Function Module

CALL FUNCTION 'GET_CURRENT_YEAR'
  EXPORTING
    BUKRS         = '1000'     " Company Code
    DATE          = SY-DATUM   " Date to find fiscal year for
  IMPORTING
    CURRM         = w_currm    " Current Fiscal Month
    CURRY         = w_curry    " Current Fiscal Year
    PREVM         = w_prevm    " Previous Fiscal Month
    PREVY         = w_prevy.   " Previous Fiscal Year

Regards

Pavan

Read only

Former Member
0 Likes
517

Hi Priyanka,

As also told by Valter, you would get the current year from the system field sy-datum only.

sy-datum+0(4) is the current year.

With luck,

Pritam.