Skip to Content
SAP BusinessObjects Design Studio

Design Studio SDK: Collection Util Component



Work with Collections with sorting feature. This is usefull when you have some arrays, which you want to put together and sort.

This component is created with collaboration with @Michael Howles.

Thanks Michael for allowing the reuse of the sorting-code from your blog Design Studio SDK - Get Top/Bottom N rankings with a little less code, as response on my primitive blog How to get "Top X" our of resultset


Items with

  • key
  • label
  • value

-> See also available extensions in How to Use Extended Sdk Collection to handle "properties"



void setItems (

  /*keys*/ String keys,

  /*labels*/ String labels,

  /*values*/ String values,

  /*separator*/ optional String separator)

initialization with 3 arrays, ideally all 3 are equal, if not, the loop is on keys:

  • in case label array is shorter, empty label will be add
  • in case value array is shorter, 0 value will be add

Default Separator is comma ,

void addItem (

  /*key*/ String key,

  /*label*/ String label,

  /*value*/ String value)

you can add items one by one as well

String getKeys(

  /*separator*/ optional String separator)

keys separated by separator

Default Separator is comma ,

String getLabels(

  /*separator*/ optional String separator)

values separated by separator

Default Separator is comma ,

String getValues(

  /*separator*/ optional String separator)

values separated by separator

Default Separator is comma ,

void sortBy...()some sort methods (provided by Michael)
int getLength()length of current array

String getLabelByIndex(

  /* index */ int index)


String getLabelByKey(

  /* index */ String key)


String getValueByIndexAsString(

  /* index */ int index)


float getValueByIndex(

  /* index */ int index)


String getValueByKeyAsString(

  /* key */ String key)


float getValueByKey(

  /* index */ String key)


The Coolest Function


org.kalisz.karol.scn.pack.KeyLabelValueArray getAsKeyLabelValueArray (

  /**max members*/ optional int maxMembers)

returns the complete collection of keys, labels, values as JSON loopable object

maxMembers can restrict the length of the returned array

Example Application

An Application with example can be downloaded at the BIAPP Repository:


Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

Important Maintenance Notice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!

The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

Have Fun!

for other components see: Karol's SDK Components