Skip to Content
0

Hirerachy variables in design studi0

Nov 09, 2016 at 04:37 PM

62

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Nov 09, 2016 at 05:01 PM
0

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

Show 8 Share
10 |10000 characters needed characters left characters exceeded
Former Member

HI ,

Thanks for your reply . in my hierarchy i have couple of nodes . what if i want to capture one node and display in text box?

whatever you suggest that will give entire nodes i belive

please correct me if i am wrong

Thanks,

Varun

0
Former Member
Former Member

Hi varun,

If you want to select a single node from a hierarchy, you can use the tree component.

It is especially used for hierarchy node selection.

Thanks,

Poovarasan

0
Former Member
Former Member

HI ,

Actually that is not my requirement.

My requirement is i have a hierarchy variable .like below screenshot. so i need to capture each node(PA_PH,PA-CF, etc..)

After capturing need to keep in different text boxes

Hope you got it?

is there any script to capture those nodes and display?

Thanks,

Varun

nlaem.png (10.8 kB)
kzuga.png (1.0 kB)
0
Former Member
Former Member

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

0
Former Member
Former Member

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

5bxgu.png (13.3 kB)
0
Former Member
Former Member

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

0
Show more comments
Tammy Powlas
Nov 09, 2016 at 05:08 PM
0

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?

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

HI Tammy,

Thanks for sharing . i didnt get this blog while searching .very helpful thanks for sharing

Thanks,

Varun

0