cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting lines within BEx

Former Member
0 Kudos

Hello all BW experts.

I am facing issues when trying to format lines within Bex : as for exceptions on ratios, I want lines to be colored green when a characteristic has a value A and colored red when that characteristic has a value B.

Does anyone know how to proceed?

I tried Excel conditional formatting on the workbook but it is reinitialized when I refresh the query.

Thanks for your help

André

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Andre,

I will be watching to the "right" answer to your question. I hope to learn something.

In the meantime, you might consider using the Excel conditional formatting and having BW reset it each time the query is refreshed.

To get the code for the conditional formatting, just turn on the macro recorder (Tools >> Macro >> Record New Macro) and set up the conditional formatting once manually.

Then, locate the code Module named SAPBEX in your workbook (not to be confused with the BW Analyzer itself, which is named sapbex.xla). In the SAPBEX code module will be a subroutine named SAPBEXonRefresh(queryID as String, resultArea as Range). The BW Analyzer runs this routine (initially empty) every time a query result table is filled (query refreshed or a change in navigational state). The queryID tells you which query was refreshed (if there is more than one in the workbook) and resultArea tells you exactly where the result table is located.

If you are using Excel newer than 2002, AND you are not using a template, you might not find the Module and subroutine I just wrote about. In which case, you can just add a new code Module (Instert >> Module) and type in a line that reads:

Sub SAPBEXonRefresh(queryID as String, resultArea as Range)

Then, paste the code that the macro recorder created. And, voila! You have the conditional formatting set up every time.

- Pete

Former Member
0 Kudos

Hello Peter,

Thanks for your answer, it was very helpful.

We still have language issues (french and english) in the VB module but the formatting works.

André