Skip to Content
author's profile photo Former Member
Former Member

Show value for key in table

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 10:39 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 10:27 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 11:15 AM

    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?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.