cancel
Showing results for 
Search instead for 
Did you mean: 

Get Members of Parameter Variables from BPC Live Connection SAC

former_member664493
Discoverer

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!

Accepted Solutions (0)

Answers (4)

Answers (4)

leppens
Explorer
0 Kudos

2021 Q4 - should have new functionality on writing to unbooked data.

leppens
Explorer
0 Kudos

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"]);
}
kostyah
Participant
0 Kudos

Hello everyone!

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

Kind regards,
Kostia

bhargava_basavani
Discoverer
0 Kudos

Hi,

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

Thanks,

Bhargava.