cancel
Showing results for 
Search instead for 
Did you mean: 

Fiscal year Period to Calquarter

Former Member
0 Kudos
246

Hi All,

The function module, UMC_FISCPER_TO_CALQUARTER is not available. Could you plz tell me the alternate method to convert Fiscal year Period to Calquarter.

Thanks,

KP

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

There is some ambiguity in your question. What if the period starts on 9/30 and ends on 11/1? Is it the 3rd quarter or 4th?

At any rate, you can try using the code below. Change the FM to be first_day rather than last, according to your needs.

REPORT  zz_table_query.

data l_date type sy-datum.
DATA l_qtr TYPE n.
DATA l_mon(2) TYPE c.
DATA l_qtr_mon(2) TYPE n.
DATA l_last_day(2) TYPE c.
DATA l_year(4) TYPE c.
data l_calquarter type /BI0/OICALQUARTER.

constants  c_months TYPE c VALUE '3'.


CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
  EXPORTING
    i_gjahr              = '2004'
    i_periv              = 'Z0'
    i_poper              = '12'
 IMPORTING
   E_DATE               = l_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.


* parse current month and year from current date
* to use as a basis for the current quarter
l_mon = l_date+4(2).
l_year = l_date+0(4).
l_qtr = CEIL( l_mon / c_months ).

concatenate l_year l_qtr into l_calquarter.

write: / l_date.
write: / l_qtr.
write: / l_year.
write: / l_calquarter.

Former Member
0 Kudos

Hi,

Chack the Firmulas avialable in update rules .If you donot able to find a direct formula to convert to Calquarter from FYP ,use 2 nested formulas .For ex: In inner formula you need to convert to CALMONTH and in outer formula you will get Calquarter from the result of ineer formula.

With rgds,

Anil Kumar Sharma .P