cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAC Script needed to retrive the selected values of a Hierachie filter parameter/variable

Martin_4
Participant
0 Likes
1,429

SAC Script needed to retrive the selected values of a Hierachy filter parameter/variable

-got a BW Query,
-the BW Query got a Companycode with a Hierarchy,
- the Companycode Hierachy is for example:
Country Companycode
----------+---------------------
DE        2150
DE        2222
DE       .........
AT         8010
AT        8020
AT        .....
...
REST  1001
REST  1002
REST  ....


The query got a Customer Exit Hierachy Node Variable ZHIERNODEMULTI
for multiple values.

I need  to get the values of selected nodes of the customer exit varable ZHIERNODEMULTI

in a script:
What means in the sample the values of the 0HIERODE :  AT &  DE

Martin_4_1-1721731884807.png

Anybody got a fitting script ?

Thank You !

Best Martin

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Martin_4
Participant
0 Likes

 

' '

Venkat99
Explorer
0 Likes
use for loop-> for (var i=0; i < sel.length; i++){ newvar.push(sel[i])}
Martin_4
Participant
0 Likes

' '

Martin_4
Participant
0 Likes

''

Venkat99
Explorer
0 Likes
newvar is a array. like var newvar = AarryUtils.create(Type.String);

Answers (2)

Answers (2)

Martin_4
Participant
0 Likes

Hmm,

for which event  to get the "sel" value also of  the initial call of the query input variable ZHIERNODEMULTI?
And how to read than out  "sel"  ...?

You assistance is appreciated.

Best Martin

Venkat99
Explorer
0 Likes

Hi Martin,

The below listed script would help to fetch the variable values that are selected part of back end variable "Zxxxxxxx".

Here this variable "Zxxxxxxx"  is being used in Story and has some values already selected.

In my case two plants. The O/P shown is fetched two values that are selected in the variable.

var sel = Table_2.getDataSource().getVariableValues("Zxxxxxxx");
console.log(sel);

Thanks,

Venkat