cancel
Showing results for 
Search instead for 
Did you mean: 

use variable in computations in SAP exit variable

Former Member
0 Kudos

hi BW gurus,

i'd like some help on a problem that i have. hope you could give me some insight/ideas on how to go about it.

i need to be able to make a report that will 1.) ask for user input on what month/years to evaluate (as current), and 2.) will output fields that are restricted to these month/years, as well as the previous years for these months - a past vs. "current" comparison, if you will. (for example, i input march-may 2004. the report would output keyfigures for march-may 2004 and march-may 2003.)

i've checked the business content and the sample code in the user exit, but i can't see any of them that provides for this need. has anyone done something like this? how was this sort of report provided?

thanks!

ryan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ryan,

To achieve the result, this is what you need to do.

Add the time characteristic (Calender monthyear) to your query and restrict it to your user input variable.

Then create a restricted key figure as follows...

1. Create a new restricted key figure.

2. select the key figure that will be displayed in the report.

3. select the time characteristic (calender monthyear)

4. restrict the calender monthyear to the same viriable selected earlier.

5. Right click this variable and select "Specify Variable Offsets"

6. In the offset field specify the value -1 for the previous year for example. This restricted key figure will now display the values for the same month previous year.

Hope this helps. Let me know if you need any more clarifications.

Cheers,

Demetrius.

Former Member
0 Kudos

hi demetrius,

i did what you suggested, and noted the ff. differences to what you expected:

- when i tried to put the time characteristic to the query, the restriction sort of "bled" through the restricted KFs, preventing output.

- when i entered -1 for the variable offset, my result was one month prior to my input month/year.

however, by creating two KFs restricted to the time characteristic, one without the variable offset, and one with the offset, and entering -12 for my offset, i was able to get the prior year's figure (12 months).

thanks for the info - it sure got us going in the right direction. 😃

Answers (1)

Answers (1)

josko_poljak
Participant
0 Kudos

Hi Ryan,

if you are still interested in this issue there are SAP exit variable 0FPER and 0P_FPER. You may use them with offset -12 as you alreday mentioned.

Kind regards,

Josko.