cancel
Showing results for 
Search instead for 
Did you mean: 

Macro Function CELL_BG() or ROW-BG() not working

Former Member
0 Kudos


Hello SAP experts,

We have a requirement where Planners want to Flag an item in the Planning book and follow up this flagged material sometime in the next month after the Forecast run.

They wanted to get an Alert of that material saying that this material is flagged.

I tried to create a macro which will color a key figure row from buckets 01/2015 to 03/2015 in the planning book, when they want to flag a particular material they can just click on the macro button to color those cells (from 01/2015 to 03/2015) . I have created another macro which will generate an alert ( Item is Flagged) based on the color of those 3 cells (01/2015 to 03/2015) .

But, the problem I am facing is , when I click on the macro button it is coloring the cells from (01/2015 to 03/2015) . But, when I hit SAVE button , the Color is gone.

I tried ROW_BG() macro function as well, I have the same problem with this as well.

FYI: I don't have any  macros set in Default or Level change or Start or Exit..

Not sure why the Color is lost for the cells when I hit SAVE. See below macro that I wrote.

Please help.

Thanks,

SV

Accepted Solutions (0)

Answers (1)

Answers (1)

satish_waghmare3
Active Contributor
0 Kudos

Hi Swathi,

This is expected behavior based on details you mentioned.  If you want to retain those FG or BG color then you need to make that particular macro as default macro. This will ensure macro runs every time when you load, save or refresh data or hit enter in the dataview.

Once you that required cells with FG OR BG color then you can make your second macro run.

One suggestion for such requirements -  it is better to use Auxiliary keyfigure - flagging purpose.  Flag can have value 1 and 0. Based on this value, condition can be checked to get the results/alerts.

Hope this will help.

Thank you

Satish Waghmare

Former Member
0 Kudos

Hello Satish ,

Thanks for your response.

Can you please provide more details on using an Auxiliary key figure.

Would be great if you could provide me with an example.

Thanks again

RahulHanda
Active Contributor
0 Kudos

Hi Swathi,

Check below link

If this answer's your question follow

Regards

Rahul

Former Member
0 Kudos

Hello Rahul,

Thanks for your response

Here is what I have tried, but no luck.

As soon as I hit the "SAVE" button, the color is gone.

See below , when I clicked on SAVE, the color is gone for the cell 01/2015

Please help.

satish_waghmare3
Active Contributor
0 Kudos

Hi Swathi,

Your macro looks correct.  I think you did not make this macro as default.  Please add this macro as Default macro, then things should work as desired.  Refer below link for SAP help on default macro -

Standard Macros - Planning Book Design - SAP Library

Hope this will help.

Thank you

Satish Waghmare

Former Member
0 Kudos

Thanks for your response.

But, if I put it as a default macro, it will be executed for all Materials right. I don't want to execute it for all materials.

I just tried it by putting that macro in Default, but the problem is, it is coloring that cell (01/2015) for all materials, I don't want to color all materials, I only want to manually hit that macro button for certain materials where the review is needed next month .

Basically, Planner will have to manually execute that macro button in the planning book to color it.

Then, next month they will get an alert for that material if there is a color for that cell. If they decided they don't need to review it anymore then , I have another macro button to de-color it, that means that material doesn't need a review anymore.

Thanks,

Swathi


satish_waghmare3
Active Contributor
0 Kudos

Hi Swathi,

1. Default macro will be executed only for the currently selected combination from your selection profile.  It will not be executed for all the materials.

2. In my opinion,  use of FG or BG color is not good option for your requirement.  Instead you should use keyfigure to flag (Value 1 or 0) where there is exception situation.   BG or FG for the color is not stored in database or livecache, it is randomly determined when macro is run as a default or by hitting the push button.  Please think through this logic.

3.Clear the flag from above keyfigure if user do not want to take any action by using directly executable macro(Push Button).

I suggest consult senior APO consultant from your team.  Also read more from help.sap.com to understand APO functionality.

Thank you

Satish Waghmare

pravin_tikar
Participant
0 Kudos

Hello Swati,

I have tried to replicate your case and it is working correctly here.

I used CELL_BG() and set as default macro...I can see the flag color when i click on SAVE button.

I have taken below example to test.

Case 1:

Demand History M 11/2015

67

Planner Demand Adjustment M 11/2015

50

It is showing flag with color

Case 2:

Demand History M 11/2015

66

Planner Demand Adjustment M 11/2015

50

It is not showing flag with color as per macro condition (TEST Color > 25)

Try again.

Regards,

Pravin Tikar