on 11-09-2016 4:37 PM
HI Experts,
searched blogs before posting
https://archive.sap.com/discussions/thread/3488299
I would like to capture hierarchy node variables and display in a text box.
I have total ten hierarchies
i tried get varaible and display in a text but no luck
could any please guide me
Thanks,
Varun
Have you seen Mustafa's reply here: https://archive.sap.com/discussions/thread/3730860 it is very comprehensive. Did you see it as part of your search?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varun,
You can use the below code to get value of a hierarchy variable and set text.
Text_1.setText(DS_1.getVariableValueText("VAR_HIER"));
if it's not working then the variable does not have any value in it. So you need to give a default value to the variable in your query.
Thanks,
Poovarasan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varun,
There is no direct way to access all the nodes values in the hierarchy. You can only get all the values of nodes using getmembers() function on the infoobject that is assigned to the node.
Can you explain your requirement, why you want to show all the node values so we can think of a work around for that?
Thanks,
Poovarasan
HI,
Actually ,
I Need to Capture PA_PH as you see in above screenshot and display in text on landing page we have text boxes above KPI Ties as below
so on top of tiles i need to get these hierarchies as for now its static . but actually it should get data from backend shouldnt be static because all these are business units so might be naming convention will chnage instead of PA_PH it can be PA-PH. so user recomended get data from backend instead of static text
hope you got it?"
Thanks,
Varun
Hi Varun,
I think there is no need to get members from data source.
Since you are just showing the text or key of the members, you can access them based on the values you use in set text function of the text boxes showing measure value..
Let me know if you want any clarification in it.
Thanks,
Poovarasan
HI ,
Thanks for your reply.
i got it whatever your saying .but i would like to know what script we need to write in order to capture that node.
lets say i captured that variable using set variable and then how to keep that specific hierarchy text in different text boxes?
tetx.set text was giving me error
can you help me with the script please
Thanks,
Varun
Hi Varun,
You would have set the value for text boxes with data binding or scripting.
1. If you have used scripting to load data, you can use the method below to set value and dimension value
var array=DS_1.getMembers("dimension", maxNumber)
TEXT_DATA1.setText(DS_1.getDataAsStringExt("measure", {"dimension",array[0].InternalKey));
TEXT_DIM1.setText(array[0].text);
TEXT_DATA2.setText(DS_1.getDataAsStringExt("measure", {"dimension",array[1].InternalKey));
TEXT_DIM2.setText(array[1].text);
Like you can write code for the four members in your members array.
2. If you have set value by binding, you need to only set text for dimension members.
var array=DS_1.getMembers("dimension", maxNumber)
TEXT_DIM1.setText(array[0].text);
TEXT_DIM2.setText(array[1].text);
......
Thanks,
Poovarasan
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.