cancel
Showing results for 
Search instead for 
Did you mean: 

Show value for key in table

Former Member
0 Kudos

Hello,

i have a table in a view that shows data that comes from a aRFC

model from the R/3 backend.

So far so good, the values shown are the same as in the backend.

Now i have the problem that two colums in this table contain only

keys (one character, represented as String).

I want to show the right values for this keys in the table, so i created

two simple types that contain the enumerations for these two columns.

The problem is, that i can not change the type of these two elements

in the Context of the view controller, because they are mapped from

the model and can not be altered.

Is there a "best practice" approach to the topic of getting values for

given keys from the backend?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Armin,

yes you can change the type of your with something like this:

// get Mofiable type of your model attribute

ISimpleTypeModifiable statiType = wdThis.wdGetAPI().getContext().getModifiableTypeOf(

"YourModelNode.YourModelNode.YourModelAttribute");

// Set valid values for this data type

IModifiableSimpleValueSet statiValues =statiType.getSVServices().getModifiableSimpleValueSet();

statiValues.clear();

for (int i = 0; i < yourValues.size(); i++) {

//set key value pairs

String statusText = yourValues.get(i);

statiValues.put(i, statusText);

}

}

Hope it helps, regards

Sakib

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you for you answers!

After thinking a while over this topic, i think that it may be cleaner/ nicer/ more performant if i change the table in the R/3 backend to use a check table.

With using such a check table (referred to via foreign key relationship) the model automatically maps this table and also manages to have the right simple type in the context for my two colums.

Is this the wrong direction i am thinking?

Former Member
0 Kudos

Hello Armin,

yes you are right you can do it this way too.

It think also that it would be cleaner and nicer,

and also you can change your table in R/3 and

get new values without changing your Web Dynpro

applikation.

Regards Sakib

Former Member
0 Kudos

Hi Armin,

you can add into a model Node a new value node in wich you can insert others value attribute.

After this step you bind them your simple types.

You will have the complete control on a value Node.

Regards.

Gianluca