cancel
Showing results for 
Search instead for 
Did you mean: 

Error using setDimensionFilter

0 Kudos

This code is crashing:
(The table (tblSPI) is a planning table Cross-tab)

var dsTblSPI = tblSPI.getDataSource();
var strArrUOMs = cbgUOM.getSelectedKeys();
dsTblSPI.setDimensionFilter("CH_UoM",strArrUOMs);

- strArrUOMs = ["Pounds"]

- CH_UoM is in data source:

4: {id: "CH_UoM", description: "Unit of Measure"}

--------------------------------------------------------------------------------------------------------------------------------------

Error is:

app.chunk.63.slice_of_main-chunk.8701bcae944b0baaad1b.js:20 Script execution failed for event "cbgUOM.onSelect" Unhandled failure during logical store adapter dispatch. code: Store.UnhandledError devMessage: Unhandled failure during logical store adapter dispatch. action: ObjectdimensionId: {dimensionId: "CH_UoM"}exclude: falsehierarchyId: {hierarchyId: "__FLAT__"}instanceId: e {idStr: "[{"app":"MAIN_APPLICATION"},{"story":"storyID"},{"table":"13f062ab-f361-46a6-80f8-d958a4a7a6f4"}]", lastPair: {…}, debugKey: "[{"table":"13f062ab-f361-46a6-80f8-d958a4a7a6f4"},{"app":"MAIN_APPLICATION"},{"story":"storyID"}]"}invisibleMembers: []members: [{…}]storeEntityType: "table"type: "ADD_DIMENSION_MEMBER_FILTER"__proto__: Object translatedMessage: undefined executed: Object sourceFailure: TypeError: Cannot read property 'getParentKey' of null

-----------------------------------------------------------------------------------------------------------------------------

Any help is appreciated. Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Bob0001
Advisor
Advisor
0 Kudos

In case of such hard errors, you may reach out to SAP directly by creating an incident.

(I know the question is quite old, but wanted to share this with others in case you also see exceptions like this)

saurabh_sonawane
Active Contributor
0 Kudos

Hi

please use the below code

tblSPI.dsTblSPI.setDimensionFilter("CH_UoM",strArrUOMs);

the below code will only get the datasource information which is applied to table spi

var dsTblSPI = tblSPI.getDataSource();

we have to specify the table or chart before applying any filter

tblSPI.dsTblSPI.setDimensionFilter("CH_UoM",strArrUOMs);

Thanks,

Saurabh S.

0 Kudos

Hi,

Thanks.

But,

I think...
dsTblSPI is a pointer to tblSPI.getDataSource()
as in the code below.
var dsSI = tblStatistics.getDataSource();
dsSI.setVariableValue("IP_ITEM_1", svStrItemA);
dsSI.setVariableValue("IP_ITEM_2", svStrItemB);
dsSI.setVariableValue("IP_ITEM_3", svStrItemC);
dsSI.setVariableValue("IP_COUNTRY", svStrCountry);

We could write it as:

tblSPI.getDataSource().setDimensionFilter("CH_UoM",strArrUOMs);

Does this seem right?

I am thinking that the setDimensionFilter() does not work on planning tables. Filter line controls seem to work okay, but just cannot use the setDimensionFilter on the planning table.