Application Development 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: 

Function module for current year

Former Member
0 Kudos

Hi ,

Is there any function module which will give current year only ??

Regards

rahul

7 REPLIES 7

Former Member
0 Kudos

hi

data: var type sy-datum.

var = sy-datum+0(4).

this will give u the current year.

is it necessary for u to use function module?

regards

katrhik

0 Kudos

Hi katrhik

Thanks for your reply !

Yes...I need function module only .

Regards

rahul

0 Kudos

Hi Sharma..

We can call the FM

<b>GET_CURRENT_YEAR</b>

Reward if Helpful.

0 Kudos

Hi All,

I got the function module HR_IN_GET_DATE_COMPONENTS

Thanks for your help ....points rewarded !

Regards

rahul

Former Member
0 Kudos

hi,

i dont think so there is any function which gives u the current year only.but u can easily code it by taking it in string format getting the last 4 characters of string.

regards,

sohi

Former Member
0 Kudos

Hi,

FM MARV_READ with MARV_BUKRS = Your company code.

wmarv-lfgja = Current Year &

wmarv-lfmon = current period.

I hope his helps,

Regards

Raju Chitale

Former Member
0 Kudos

data : a(20).

<b>CALL FUNCTION 'GM_GET_FISCAL_YEAR'</b>

EXPORTING

I_DATE = SY-DATUM

i_fyv = 'V3'

IMPORTING

E_FY = a.

  • EXCEPTIONS

  • FISCAL_YEAR_DOES_NOT_EXIST = 1

  • NOT_DEFINED_FOR_DATE = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

write : a.