2005 Nov 28 2:09 PM
Hello all
I need a FM that finds the month and year for a given fiscal period.
for example, in my company I know that fiscal period 03/2005 is actually december 2004.
does anybody knows if exist such a FM?
thanks in advance.
2005 Nov 28 2:12 PM
2005 Nov 28 2:12 PM
What I did was wrote a function module to do this for me.
FUNCTION Z_GET_FS_PD_DATES.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(I_GJAHR) LIKE T009B-BDATJ
*" REFERENCE(I_MONMIT) LIKE GJVAR-MONMIT DEFAULT 00
*" REFERENCE(I_PERIV) LIKE T009B-PERIV
*" REFERENCE(I_POPER) LIKE T009B-POPER
*" EXPORTING
*" REFERENCE(S_DATE) LIKE SY-DATUM
*" REFERENCE(E_DATE) LIKE SY-DATUM
*"----------------------------------------------------------------------
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
I_GJAHR = I_GJAHR
I_MONMIT = 00
I_PERIV = I_PERIV
I_POPER = I_POPER
IMPORTING
E_DATE = S_DATE
* EXCEPTIONS
* INPUT_FALSE = 1
* T009_NOTFOUND = 2
* T009B_NOTFOUND = 3
* OTHERS = 4
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
I_GJAHR = I_GJAHR
I_MONMIT = 00
I_PERIV = I_PERIV
I_POPER = I_POPER
IMPORTING
E_DATE = E_DATE
* EXCEPTIONS
* INPUT_FALSE = 1
* T009_NOTFOUND = 2
* T009B_NOTFOUND = 3
* OTHERS = 4
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFUNCTION.
Regards,
Rich HEilman
2005 Nov 28 2:13 PM
2005 Nov 28 2:13 PM
2005 Nov 28 2:34 PM