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 fiscal year

Former Member
0 Kudos

Hi all,

can you please suggest me the function module for automatic generation of fiscal year.

Thanks and regards,

S.Latha.

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

First read some documentation at [Fiscal Year Change Documents|http://service.sap.com/fyc]

Which step do you want to perform programmatically.

Regards,

Raymond

PS: If you want to calculate fiscal year/period for a company/date, check FM FI_PERIOD_DETERMINE

Former Member
0 Kudos

Hi,

Use this function module GM_GET_FISCAL_YEAR.

In function module you need to pass date which is sy-datum in your case & Fiscal Year Variant which you can find out from T009 table.

Hope this helps.

Former Member
0 Kudos

Hi Latha,

Please find below the code for auto generation of the fiscal year.

l_date = sy-datum. "l_date should declared of type sy-datum

  • Use the function module to get the period

CALL FUNCTION 'MC_PERIODE_ZUM_DATUM'

EXPORTING

idate = l_date

iperkz = l_p " 'P'

iperiv = l_periv "V6

IMPORTING

eperid = l_period

EXCEPTIONS

wrong_period = 1

OTHERS = 2.

l_fiscal = l_period+0(4).

l_p - 'P' i. e. Is the period indicator (Period according to fiscal year variant)

l_periv - 'V6' i.e. Is the Fiscal year variant. Here it is V6 which relates country 'US'.

l_period - gives you the Fiscal period.

l_fiscal - The first four digits of l_period gives you the 'Fiscal year'.

Hope this helps you !.

Thanks & Regards,

MM Jaffer.

Edited by: MohammedJaffer on Aug 10, 2010 12:53 PM