Scenario :

With this document i will be showing the functionality of  “Interpret result as Boolean Value (True=1;False=0)” in formula variable with a simple example .

The scenario is like below :

Requirement : To show in the output of the BEx report only paid invoices.

DSO Data :

ZINV_NO – Invoice No

BEX1.jpg

ZINV_NO Master data :

As we can see below from the master data of “ZINV_NO” , there is a Paid indicator (display attribute of ZINV_NO) which tells us whether its an “open invoice” (with a blank space ” ” ) or a “paid invoice” (with the value “X”).

BEX2.jpg

Follow the below steps to get only paid invoices amount in the output of BEx report based on the Paid Indicator(ZPAID):

STEP : 1

In the BEx query designer make a New formula(For Ex : Paid Amounts) and in that make a new formula variable with the following settings in the general tab :

Processing Type : Replacement Path

Reference characteristics : ZINV_NO

BEX3.jpg

STEP : 2

Go to the replacement path tab and maintain the following settings:

Replace variable with : InfoObject

Replace with : Attrib. Value

Attribute : ZPAID

And select the checkbox “Interpret Result as Boolean Value(True=1; False=0)

BEX4.jpg

STEP : 3

Now multiply this formula variable with the amount keyfigure from the infoprovider :

BEX5.jpg

STEP :4

Just to check what this formula variable is bringing, make a separate NEW FORMULA ( For ex: Check) and just place this formula variable and also maintain AMOUNT keyfigure in the columns also just to get a better clarity of what is happening :

BEX6.jpg

STEP : 5

Finally your BEx Query designer should look like this :

BEX7.jpg

STEP : 6

Execute the report to see the output.

BEX8.jpg

Explanation :

The formula variable : ZFOR_VAR_BOOL internally checks for the attribute “ZPAID” of “ZINV_NO”. The value of the formula variable is 0 when it does not find value(i.e. blank) for the attribute ZPAID and the value of the formula variable is 1 when it finds value(i.e. “X” in this case) for the attribute ZPAID.

Hope the above explanation was useful.

All comments and suggestion are welcome !!

To report this post you need to login first.

16 Comments

You must be Logged on to comment or reply to a post.

    1. ASHUTOSH SINGH Post author

      Hey Benedict,

      Thx for the valuable comments.

      And I am glad that you now know this piece of information through my document.

      Will keep posting more useful information.

      Regards,

      Ashu

      (0) 

Leave a Reply