Showing results for 
Search instead for 
Did you mean: 

Customer Exit Code for Fiscal Quarter

Former Member
0 Kudos


Our company Quarter starts from March 27 2011 to June 28 2011 (1 quarter)(2012/1)

June 29 2011 to Sept 29 2011 ( 2 nd Quarter)( 2012/2)

Sept 30 2011 to Dec30 2011 (3rd Quarter) (2012/3)

etc..4th quarter (2012/4) next year first quarter (2013/1)

If user select July 3 rd 2011 ,the reports to be run from current quarter to 4 rolling quarters mean the report to be run from 2012/2-2013/1.I need customer exit ABAP code for this requirement.



Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sridhar,

you can acheive it at query level by using customer exit Variable.

Kindly have a look on below steps.

1) Use user input ready variable 'A' in query at any of the column

2) Create one customer exit variable 'B' and restrict query by using that variable

Customer exit variable will refer the input variable 'A' in code.

Kindly note that I can only give you psudo code here.

in customer exit B variable

just read the variable 'A' date.

now using date find out the year

and check date is fall under which quarter of that year based on your quarter definition.

and then use the lower date of that quarter as a lower limit(l_date).

now add one year in l_date and store it as h_date.

h_date = l_date.

h_date0(4) = h_date0(4) + 1.

then h_date = h_date-1.

now use l_date and h_date as lower and upper limit of your variable 'B'.

please let me know if you have any concern on above logic.



Former Member
0 Kudos


You can achieve this using Customer Exit Variable. What you will have to do is create a customer exit variable on Fiscal Quarter. And write code in EXIT_SAPLRRS0_001 (RSR00001).

In case statement write code under your variable name. i.e When "XYZ" and put one more condition as IF I_STEP = '2'.

start your coading below this.

First of all you will have to read the date value entered by customer,

LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'Customer_Date'. *Put proper variable name.

Now you have date value available in structure loc_var_range. Based on this value you can determine current Fiscal Quarter (2012/2). After that calculate the value of rolling 4 quarter and store it in some temp variable ie..2013/1

Now you need to populate these values:

l_s_range-high = lv_quarterend (2013/1).

l_s_range-low = lv_currentquarter (2012/2).

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

APPEND l_s_range TO e_t_range.

And put this variable in Filter Section. Your report will be automatically restricted to this value range.



Former Member
0 Kudos

Hi Durgesh,

Could suggest the exit code for the below requirement :

For broadcasting SAP BI reports

Example below

For 0FISCPER: Previous fiscal period. e.g. date is between 01.02.xxxx and 28.02.xxxx, then 0FISCPER is 001.xxxx. So if the date is today July 8th 2013, the outcome should be 006.2013.

For ZPLANPER: Previous planning period (one per quarter). For dates 01.02.xxxx-30.04.xxxx, the outcome should be 001.xxxx. 01.05.xxxx-31.07.xxxx = 004.xxxx. 01.08.xxxx-31.10.xxxx = 007.xxxx. 01.11.xxxx-31.01.xxxx(+1) = 010.xxxx.



Active Contributor
0 Kudos

Start  same question as new discussion , you will get  more replies , as  this is disussed in 2011.

persons may/may not be active.

Active Participant
0 Kudos

Hi Shridhar,

What i have understand from your posting you have requirement to show Output from Current Quarter till End of Year Quarter.

As per my understanding your requirement cannot be achieved at query level it need to be handle at Modelling level.

For Modelling, you need to have 2 info object 0CALQUARTER and 0CALYEAR.

Update both of the above infoobject using routine as you required by piece of code at transformation level.

Like if document date fall in March 27 2011 to June 28 2011 than 0CALQUARTER = 12012 and 0CALYEAR = 2012 and so on.

Now you have Quarter and Year in your info provider. Use that for creating query and ask user to enter the quarter instead of date as you have mentioned in out put date has no significance beside deciding quarter.

Create 2 variable 1. Input variable on 0CALQUARTER and restrict the it as greater than equal to

2. Replacement Path Variable on 0CALYEAR and restrict it as equal to

I think above logic can help to complete your development.