08-10-2010 7:35 AM
Hi all,
can you please suggest me the function module for automatic generation of fiscal year.
Thanks and regards,
S.Latha.
08-10-2010 7:45 AM
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
08-10-2010 7:50 AM
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.
08-10-2010 8:23 AM
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