Skip to Content
Former Member
Apr 07, 2016 at 09:38 PM

How do I append an array to an existing array in design studio 1.5?


Does anyone know if it is possible to append an array to an already existing array in design studio 1.5?

To my knowledge Design Studio 1.6 does have the capability( when creating a component with SDK. However, I would really rather be able to do it using a global script within the application.

If so, could you please provide an example?

To give you an idea of what I am trying to achieve. I know JavaScript allows appending using .push().It would be nice if SAP allowed us to use full-on javaScript so that I could use .push().

var RS2 = [[RS2chart1,RS2chart2,RS2chart3],[RS2qName1,RS2qName2,RS2qName3],[RS2dim1,RS2dim2,RS2dim3],[RS2selection1,RS2selection2,RS2selection3]];

chartCount = RS2[0];

RS2chartCount = chartCount.length;

RS2 = RS2.push( [[RS2chartCount]]);

I know that we do have to ability to include a new array in an existing array, but I want it to be part of the first set rather than incrementing up.

var chartCount1 = RS1[0];

var RS1chartCount = chartCount1.length;

RS1 = [RS1,[RS1chartCount]];

The above is 1 option that does kinda work except that it increments it up and adds it as a new set. so I'd be calling [1] instead of [0]

Thanks for any help anyone can offer.