Skip to Content

How to write script logic for performing calculations based on values of different members within a same dimension to update another member in the same dimension?

Hello all

Here is what I wish to calculate in my Input schedule on a run time basis:

The user can enter or change values for Customer Forecast and Price 2. Whether there is an input or not, a change in the value or not- the calculation must stay intact all the time.

The issue is that I have to juggle and compare the values for the members within the same dimension to calculate value for another member in the same dimension.

I need to know if we can write script logic for this scenario. I know we can achieve this using BADI but that is not possible for now due to time constraints.

Also, I would like to know if there is any SAP delivered Callback API for VB macro as we have in BEx and Advanced Analysis; for instance- writing a macro for the calculation but calling it based on any event happening in the particular sheet- which could be input/change/refresh/opening the template etc.

Any help would be truly appreciated!

Issue.jpg (60.2 kB)
Issue.jpg (60.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Aug 26, 2013 at 05:46 PM

    Hi Gajendra,

    The REC statement in the WHEN/ENDWHEN loop will be:

    *REC(EXPRESSION= ([KeyFigure].[PRICE2]>0.5) ? [KeyFigure].[PRICE2]*[KeyFigure].[CUSTOMER_FORECAST] : [KeyFigure].[PRICE1]*[KeyFigure].[CUSTOMER_FORECAST]

    B.R. Vadim

    Add a comment
    10|10000 characters needed characters exceeded

    • Issue resolved through VBA code:

      User anyways has to enter and click on "Save Data". I included VBA calculation right before the save is executed allowing me to save all the values - entered and calculated. The macro is then assigned to a new button inserted in the sheet.

      Sub Save_and_Refresh()

      Dim EPMobject As New FPMXLClient.EPMAddInAutomation

      CalculateData 'Custom Macro to perform calculation

      EPMobject.SaveAndRefreshWorksheetData

      End Sub

      Thanks a lot Vadim for your prompt response and help! I truly appreciate all the input provided in this thread.

      Closing the thread!

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.