Skip to Content
author's profile photo Former Member
Former Member

use variable in computations in SAP exit variable

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?



Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2005 at 04:26 AM

    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.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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. =)

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2005 at 03:54 PM

    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,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.