cancel
Showing results for 
Search instead for 
Did you mean: 

Fiscal Year Period

Former Member
0 Kudos

Hi,

In My report I need to show Fiscal year Period wise Quantity. Based on Customer input date. For Example the input date is 20.07.2010 means it should calculate from Period1(Apr) one column and period2(may) another column, period3(Jun) another column, period4(jul) another column. pls guide me how can i achive this.

Thanks

Rama

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member181964
Active Contributor
0 Kudos

Hi,

Use the followimg code, you just copy and past the code in SE38 and test it and implement it.

Code to convert the Date into -N DATE and then convert into Fiscal Year/Period.

DATA: zm(2) TYPE n,
      zdt1 TYPE sy-datum,
      zdt2 TYPE sy-datum,
      zm1 TYPE /bi0/oicalmonth,
      zfy TYPE umc_y_fiscper,
      zfv TYPE periv,
      zmn TYPE umc_ys_dimvals,
      zdd(2) TYPE n,
      zmm(2) TYPE n,
      zyy(4) TYPE n,
      ZFF TYPE UMC_Y_ICHAVAL,
      ZFFY TYPE UMC_Y_ICHAVAL.


zdt1 = sy-datum.

CALL FUNCTION 'SEPA_MANDATE_ADD_MONTH_TO_DATE'
  EXPORTING
    months  = -3
    olddate = zdt1
  IMPORTING
    newdate = zdt2.

zdd = zdt2+6(2).
zmm = zdt2+4(2).
zyy = zdt2+0(4).

ZFF = ZMM.
ZFFY = ZYY.

CALL FUNCTION 'UMC_CALMONTH_TO_FISCPER'
EXPORTING
i_periv          = 'V3'
i_calyear        = zFFY
i_calmonth       = zFF
 IMPORTING
   e_fiscper        = zfy
* EXCEPTIONS
*   INVALID          = 1
*   OTHERS           = 2
    .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


WRITE:/ zdt1.
WRITE:/ zdt2.

WRITE:/ zdd.
WRITE:/ zmm.
WRITE:/ zyy.
WRITE:/ zFY.

Note:

Check the Code in SE38 and implement the same logic for Customer Exit Variables and use Offset values for other Variables on Fy Period.

For all Customer Exit Code details see the below url..

http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy

Thanks

Reddy

Former Member
0 Kudos

HI Surendra,

Do you mind giving little explanation to your code. I have similar requirement but in your code you have used ZDT 1, 2..etc and then Month=-3.

If you can explain, it would be graet!

Thanks

Former Member
0 Kudos

Restrict your query on current fiscal year and on fiscal period <= X1

X1 is a customer exit variable where fiscal period is calculated based on user inpu date.

Add date in the columns above key figure structure.

This will ful fill your requirement.

-Mayuri

Former Member
0 Kudos

create a custome exit variable of type interval suppose var1 :

user input var be VARIN

READ TABLE i_t_var_range WITH KEY vnam = 'VARIN' INTO

loc_var_range.

year = varin+0(4)

loc_var_range-high = loc_var_range-low .// stores input period

concatenate '04' year to loc_var_range-low .// stores april period of same year

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'BT'.

L_S_RANGE-LOW = loc_var_range-low.

L_S_RANGE-HIGH = loc_var_range-high.

APPEND L_S_RANGE TO E_T_RANGE.

restrict the period char to var1.

former_member189638
Active Contributor
0 Kudos

Is that you want to daiplay the data from 1st April to the user user input date??

Create two variables for Fiscal Period as following such that var 2 is populated as 004/year (year value based on the value from var1).

Var1 - User Entry/Default, Single Value, ready for input

Var2 - Customer Exit, Single Value, not ready for input

Now in your query you can have Fiscal year/period in your columns and below that put your key figure.

Right Click on Fiscal year Period and select Restrict.

Select Variables and Value Range from the Drop Down.

Drag Var1 and Var2 to the right.

Save and Execute the query.

This will run your report for the required date range.