09-20-2007 2:49 PM
Hi All,
Is there is any standard function module for getting finacial month and year , if we pass current date as input.
Regards,
Nikhil
09-20-2007 2:52 PM
FM - 'FI_PERIOD_DETERMINE'
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
I_BUDAT =
I_BUKRS = ' '
I_RLDNR = ' '
I_PERIV = ' '
I_GJAHR = 0000
I_MONAT = 00
X_XMO16 = ' '
IMPORTING
E_GJAHR =
E_MONAT =
E_POPER =
EXCEPTIONS
FISCAL_YEAR = 1
PERIOD = 2
PERIOD_VERSION = 3
POSTING_PERIOD = 4
SPECIAL_PERIOD = 5
VERSION = 6
POSTING_DATE = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
vasu
09-20-2007 2:53 PM
Sure, you will need to pass the company code, or a calendar id as well.
report zrich_0001 .
data: period like t009b-poper,
year like bkpf-gjahr.
call function 'FI_PERIOD_DETERMINE'
exporting
i_budat = sy-datum
i_bukrs = '0010'
importing
e_gjahr = year
e_poper = period.
write:/ period, year.
Regards,
RIch Heilman
09-20-2007 2:58 PM
09-20-2007 3:03 PM
Unfortunately, if you are looking for FI period, these are always tied to a company code, and/or fiscal year variant. This funciton module works from this, if you provide the company code, it will find the specific fiscal year variant that it needs to determine the fiscal period/year, if you provide the fiscal year variant directly, it will simply use that fiscal year variant to determine the period.
The fiscal year variants are stored in table T001 specific to the company code.
Regards,
RIch Heilman