cancel
Showing results for 
Search instead for 
Did you mean: 

displaying dimension value in textfield

Former Member
0 Kudos

Hello,

I want to display a dimension value in a textfield. The dimension has only one value.

I tried to use a crosstab.

Startup:

TEXT_6.setText(CROSSTAB_2.getSelectedMember(

"ZCRM_EXPM").internalKey);

Result:  textfield shows "All Members".

Any Idea ?

Thanks,

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

former_member131154
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Stefan,
If I got you right, you are trying to display a member value that comes out of your datasource in a textfield.
If you know the dimension value and want to read the corresponding key figure value you can use a DS_1.GetData(measure, selection); script. See the tutorial for more information: http://scn.sap.com/docs/DOC-41395
As yo write the result is "All Members" I guess you want to read the first/second/third dimension value that comes out of your DataSource, correct?
If that is what you want to get you should think of the following scenario:
  • In the Startup of you Application you fill a hidden dropdownbox with the data you get from your Datasource [ DROPDOWN_1.setItems(DS_1.getMemberList("0SOLD_TO__0COUNTRY", MemberPresentation.INTERNAL_KEY,
    MemberDisplay.TEXT,
    10)); ]
  • Use Dropdown_1.setSelectedValue(value); to specify the nth entry you want to read, you can leave that out if you need the first one.
  • Then you can fill your text field with either  TEXT_1.setText(DROPDOWN_1.getSelectedText()); or TEXT_1.setText(DROPDOWN_1.getSelectedValue());

Hope that helps. I I misunderstood please clarify.

Dirk

Former Member
0 Kudos

Hi Dirk,

thanks a lot, that works fine.

Regrads,

Stefan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Dirk,

I am so sorry to be replying to such an old message but I am having the exact same issue and the proposed solution does not seem to be working so I hope I can pick your brains just a litte bit please.

What I am trying to do:

I have a dimension filter that changes my crosstab selections [DS_1] based on an INDICATOR(key). I am trying to display in a text box a property (or attribute [UOFM]) for my dimension[INDICATOR]. My crosstab is made up of the following:

Indicator measure by Time and Version (actual and target). I am trying to get the Unit of Measure of the selected Indicator in a text box. This unit of measure is an attribute of my Performance Indicator. Since I am using BPC data, it can also be a stand alone dimension.

Based on your previous steps, some logic I have right now:

On Startup:

DROPDOWN_1.setItems(DS_1.getMemberList("UOFM", MemberPresentation.INTERNAL_KEY,MemberDisplay.key, 10));

This woks perfectly fine. It is now populated with the 4 Units of Measure that my indicators can have.

The next step is where I get stuck. My dropdown doesn't seem to want to change based on the selection made in the crosstab, it always stays at the first one.

On Event for Crosstab:

DROPDOWN_1.setSelectedValue(CROSSTAB_1.getSelectedMember("UOFM", internalKey);

And then of course, to populate the text:

TEXT_1.setText(DROPDOWN_1.getSelectedValue());

Any idea on how I can alter the second line of code to get the dropdown to change for it to pick up the UofM - the attribute - of the filtered Indicator?

Thank you so much for your time,

Nikki