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

Function module for current year

Former Member
0 Likes
1,559

Hi ,

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

Regards

rahul

7 REPLIES 7
Read only

Former Member
0 Likes
1,167

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

Read only

0 Likes
1,167

Hi katrhik

Thanks for your reply !

Yes...I need function module only .

Regards

rahul

Read only

0 Likes
1,167

Hi Sharma..

We can call the FM

<b>GET_CURRENT_YEAR</b>

Reward if Helpful.

Read only

0 Likes
1,167

Hi All,

I got the function module HR_IN_GET_DATE_COMPONENTS

Thanks for your help ....points rewarded !

Regards

rahul

Read only

Former Member
0 Likes
1,167

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

Read only

Former Member
0 Likes
1,167

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

Read only

Former Member
0 Likes
1,167

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.