on 02-21-2014 12:58 PM
Dear Friends
I am currently working in SAP Design Studio 1.2 version and BW queries as source. I am in need to list last 36 months (like Aug 2013, Sep 2013, etc) on one of the drop down box and depends on which data will be displayed on dashboard. I get the latest month and year value from the source query but i do not see any option of creating loop or next\while such that i can do coding to produce it dynamically. I know that it is currently not available in 1.2 version but is there a way to do this?
Example : Current month is Apr 2013
I will require drop-down box to show Apr 2013, Mar 2013 till . May 2010.
---
Regards
Kishore Balachandran
Hi Kishore,
in consideration of the current restrictions of Design Studio 1.2, to achieve your requirement here is one solution:
DROPDOWN_ZEITRAUM.setItems(DS_2.getMemberList("0CALMONTH", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 36));
//DROPDOWN_ZEITRAUM.sort(false); // true=ascending; false=descending
Currently you cannot add or exclude individual items separately to an existing list of dropdown values. You can only set the items of a dropdown with values coming from a dimension, so you always need to think in terms of how to achieve that one single dimension contains all the values and only those values that should be shown in your design studio dropdown component.
Looping as known from other programming languages ( for(...), while(...) ) is not available in Design Studio scripting in v1.2 (maybe in later versions).
But in some blog posts regarding the new event "doBackgroundProcessing" there is mentioned a way of looping, here the shorthand basics about it to have an idea about it (you keep incrementing a variable and calling an event several times where some code is executed until the condition for calling this event is no longer met and the "looping" ends):
On the "On Startup" script, please add: APPLICATION.doBackgroundProcessing();
Create a variable Variable1, initialize it to 0
Then, on the background processing function, add:
…
Variable1 = Variable1 + 1;
if (Variable1 < 7) {
APPLICATION.doBackgroundProcessing();
}
…
Regards,
David Gyurasz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm going to have to think about this before I come up with a specific answer, but have you tried using recursion?
My mistake, I've been working with custom components and I was thinking you'd be able to call other functions. However, a custom component would be one way to accomplish your goal. It would be a bit of a pain, but you can use loops within them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I don't think you can do much in DS for your requirement (of looping). As an alternative, you can create a query in BW to give you these values and fill the DROPDOWN items.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anil
I agree with you that BW can be the only solution at this point. We had already created a query which gives the last 36 months but we find trouble on arranging the order in design studio. By default, the query provides the list randomly and i tried arranging them on source's initial edit but when the same is set into drop-down box at start-up, it does not work.
I have requested BW side to check if this can be sorted in query itself but does this mean we cannot sort the data and load to components?
---
Regards
Kishore Balachandran
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.