Skip to Content

Get Members of Parameter Variables from BPC Live Connection SAC

Setup: Creating Analytic Application on SAP Analytics Cloud Version 2020.2.1 using a BPC Live Data Connection

We are trying to change the values of the parameter variables of our data model without having to open up the typical dialogue box.

Changing the variables of a live data connection in the App Builder View happens via Data > Edit Prompts:

We have managed to create the same view in the Present View (Run Analytic Application) using Table_2.getDataSource().openPromptDialog(). Ideally, however, we would like to set the variable values in the script, not using the dialogue box. One option would be to create a dropdown filter containing the variable members, essentially creating our own prompt dialogue box. To do this, we need access to the members of the variables. So far, we have only found getVariables() and setVariableValue() APIs that don't fulfill our needs (getVariables gets us the variables correctly, but not the members of the variables). Is there any way to extend these APIs to access the members of the different variables?

In addition to this, we have tried setVariableValue() by hardcoding the inputs using the Variable ID and the member ID, but got the following error:

Would appreciate any tips regarding accessing the members of parameter variables and why setVariableValue() doesn't seem to be working for us!

dialogue-box.png (38.8 kB)
error.png (66.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Mar 24 at 08:08 AM

    Hi,

    we got the same requirement, if you got solution for this already could you please update the same.

    Thanks,

    Bhargava.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 06 at 04:07 PM

    Hello everyone!

    Same issue here. Please let us know if you found any way around it.

    Kind regards,
    Kostia

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 07 at 04:17 PM

    on SAC version 2020.2.10

    In my project, I'm not using SetVariableValue(), but SetUserInput() for what I want to do.
    Not sure how much it will help you,.. but to get my script working I had to set the table to
    -use planning
    -use a flat hierarchy
    -show unbooked Data (the field I want to change must be editable in the table itself)

    My dimensions and measures come from other "lookup tables"
    Here I selected 1 field to see what it returns and then change the date dimension for before using SetUserInput. Next step would be to create the "mySelection" as a string by myself.


    var mySelection = tblMain.getSelections()[0]; console.log(["before edit",mySelection]); mySelection["Version"]="public.TEMPLATE-0"; //set another Version mySelection["Date"]="[Date].[FYP].&[201802]"; //set another Date console.log(["after edit",mySelection]); tblMain.getPlanning().setUserInput(mySelection,"0"); tblMain.getPlanning().submitData();

    To get a list of my measures I found this code

    var selectionsArray = tblLookup01.getDataSource().getDataSelections();
    console.log(selectionsArray);
    for (var key = 0; key < selectionsArray.length; key++){
      var obj = selectionsArray[key];
      console.log(obj["@MeasureDimension"]);
      console.log(obj["Date"]);
    }
    Add a comment
    10|10000 characters needed characters exceeded

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.