on 2023 Dec 07 2:48 PM
Hello everyone,
what I am trying to achieve is to insert some values in a Dimension Comment Column dinamically based on a condition,
I want to insert into the "Dimension Comment" Column of the right table a comment which contains the value of the VAT measure of the Left table, for the same id between Legal Entity and Intercompany (eg. Intercompany BD01 should contain 58,472,55 in the Dimension Comment column)
I have written this code onInitialization event:
var selections = Table_8.getDataSource().getDataSelections();
var seltab1=Table_8.getDataSource().getResultSet(); //this contains the resultset of the left table
var seltab2=Table_9.getDataSource().getResultSet(); //this contains the resultset of the right table
for ( var i=0;i<seltab1.length;i++) //this loops on the left table
{
for(var j=0;j<seltab2.length;j++){ //this loops on the right table
if(seltab1[i]["Legal_Entity"].id===seltab2[j]["Intercompany"].id){ //if the ids are equal
if(seltab1[i][Alias.MeasureDimension].description==="VAT"){ //if it's the measure VAT
var dataCell1=Table_8.getDataSource().getData(selections[i]); //get that value
var val=dataCell1.rawValue;
Table_9.getComments().setDimensionComment(seltab2[j],val);
//set the comment with the taken value on the current selection
}
}
}
}
But it doesn't work, the applications goes in script error...
the value is taken correctly, the code goes well til the instruction "var val=dataCell1.rawValue;"
There's something wrong in the way I'm passing the current selection...
Can anyone help me correct my code?
Many thanks,
Best Regards.
Filomena.
filomena_sap_1997
filomena_sap_1997May be you should try to console.log(val) and console.log(seltab2[j]) and see what kind of values you are getting in those 2 variables. It will help you to understand your error better.
Br.
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.