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

BEx Query Formula Descriptions -- Conditional Formula

My question is in regards to the description that is returned from a formula within a structure. The data I'm expecting is based on (for example) "fiscal year." I have a text variable setup that returns the result of the "fiscal year" to be displayed as the column description.

However if no data is returned for the current fiscal year, I then want to display the data for the previous fiscal year.

I have a formula setup that uses a conditional statement. It is setup as described below:

<b>Formula Description</b>

-- If data is returned based on fiscal year "2008" then use that data.

-- Else use the data based on fiscal year "2007"


-- I use a text variable that is based on 0FISCYEAR called <b>0T_FYEAR</b>

-- When the query is run, the data returned is correct --> (2007 data if there is no 2008 data)

-- The text variable is also used as the formula "description" which is set to "0T_FYEAR" so if there was 2008 data, the text variable would say "2008" and if not it would say "2007."

The problem resides in the text variable which is used as the formula description. It is displaying the technical name of the text variable (&0T_FYEAR&) instead of "2008" or "2007."

Has anyone else had this occur? I would expect that if the data coming back is correctly based on 2008 or 2007, then the text variable used for the formula description would also be set to "2007" or "2008" based on my formula condition.

Any help would be greatly appreciated and of course points will be awarded!


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2007 at 05:53 PM

    The variables gets populated before the formula calculation. i.e. when i_step = 1 or 2. (Just before & after the selection screen)

    Whereas the formula will be calculated once the necessary data for your query layout is fetched.

    Thus you text variable is searching for a definite fiscal year value which is not there at that time & hence it's returning the technical name of the variable.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      The description should come back as "Q3 2008" or "Q3 2007" depending on which condition is met in the formula and what data (2007 or 2008) is returned. It is being displayed as "Q1 &0T_FYEAR&" (but the data is correct). Still seems weird to me that it is trying to fill the labels of the returned data before the data is doesn't know which condition is met at that point?

      Should I keep the formula in the query to bring back the data and use the customer exits simply to fill the text variables?

      If so, how in ABAP could I conditionally set the value of a variable based on the results of the query formula?

      The Quarter variable would be unneccessary as this value is correctly displayed in the results. It is the year that is showing up as "&0T_FYEAR&." <-- that is the text variable based on 0FISCYEAR which is used as the description of the formula.

      Thanks for your help


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.