cancel
Showing results for 
Search instead for 
Did you mean: 

DS Scripting: How we can access the whole result set (line by line)?

alexander_stettler
Participant
0 Kudos

Hi,

We are wondering how it's possible to write the complete result set of a DataSource into an (multidimensional) array in order to have access on existing characteristic relations. The only way we could find was a nested loop with getMembers and getData statements:


var arMaterial = DS_OVERVIEW.getMembers("0MATERIAL", 10000);

var arPlant = DS_OVERVIEW.getMembers("0PLANT", 10000);

arMaterial.forEach(function(elMaterial, ii) {

  arPlant.forEach(function(elPlant, jj) {

    if (DS_OVERVIEW.getData("A3R23AAT4HMDGHPUIYXEIWL8O", {"0MATERIAL": elMaterial.internalKey, "0PLANT": elPlant.internalKey}).value == 1)  {

          // Do something

    }

  });

});

This works but is not very fast if we have a multiple entries in each array. Also we are producing a lot of warning messages like 'No matching data found" or "Could not find member xyz of dimension 0MATERIAL"...

Does anyone knows a better solution for such an access on the whole result set?

Best Regards,

Alex

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Alexander,

Your described approach is the only way you can achieve the desired result with standard functionality.  If you don't mind using SDK components, a more effective approach is provided by the Design Studio SDK Community Data Iterator Component.

Regards,

Mustafa.

Answers (0)