cancel
Showing results for 
Search instead for 
Did you mean: 

Global Script Variable - Array

abdussamad_peera
Participant
0 Kudos

When creating a global script variable you have the option to define the variable type like INT, Boolean, String, Float but there is no

option to define a variable as an ARRAY.  Is this be design or a miss by SAP?

I want to be able to store a list of dimension values to use it various scripts in my application without having to fetch it from

the data source and without having to create a listbox or something.  Why can't you create a global variable as an array?

Thanks

Abdul

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Abdul,

Yes, this is a limitation of global script variables at the moment.  What you can do as a workaround is as follows:

1)  Define a global script variable of type String

2)  Populate the value of this variable with your dimension members as a comma separated string

3)  Convert the array string to an array object by applying the split() method to the array string

Regards,

Mustafa.

abdussamad_peera
Participant
0 Kudos

Thanks, Mustafa.

The way I am doing this is creating a local array variable and populating it with the members;

var equipment_array = DS_2.getMembers("EQUIPMENT", 25);

and then just picking out a member using a loop.

It works for me but I want to know if populating a local array with members is making a call

to the database every time or no?  My understanding is that DS_2 is already loaded at startup

so it shouldn't be another trip to the database, correct?

Abdul

MustafaBensan
Active Contributor
0 Kudos

Hi Abdul,

My understanding is the same.  Since the data source is already loaded, getMembers() should not require further roundtrips to the database.  You could probably confirm this for sure using the profiling feature of Design Studio.

Regards,

Mustafa.

Answers (0)