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

ALV: show the description instead of code value in a column

Hello everyone,

I'm creating a simple ALV to output the content of a table. Everything works fine, but about the content showed I would like that, for the fields with list of valid values (in the data element, SE11), the alv shows the description instead of the code.

For instance, suppose that in the table there is a field called RESULT which has the following set of values: "CO" for complete, "IP" for In Progress and "NS" for Not Started. I would like that in the alv, instead of showing CO, IP or NS the ALV showed Complete, In Progress or Not Started, in each row.

This is the standar behaviour when you create a table maintenance in SE11/SM30, but is this possible in webdynpro's ALV?

Regards,

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 14, 2008 at 03:45 PM

    If your text (description) is coming from some table, then create a text attribute in the node and bind your field to that nodel and read the text for this key...suppose complete for 'CO'.

    If it's defined in the domain level, then try to find out the sap table where it's storing the text for this key.

    and then do the same as I mentioned above.

    But one thing it's can not be automatic as your key and value both are having different data elements.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 13, 2008 at 06:27 PM

    Hi,

    Create an attribute in the node for text. Delete the column for key from the ALV.

    Reema

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      thanks for your answer. As you say it´s an option to create a text field and manually (i.e. getting the description for the code with a select statement for example) fill the cell. But in my case the domain for the field has a list of possible values, not a table an external table as a check for valid values.

      In the table maintenance (SM30) this is done automatically, I mean when you enter the table maintenance you see the description instead of the codes, my question is if this is possible to do with ALVs

      Thanks again

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2012 at 12:49 PM

    Hi,

    An easy way without creating a new context node is changing the cell editor of the column:

    DATA lo_cell_editor TYPE REF TO if_salv_wd_table_cell_editor.

    DATA lo_col TYPE REF TO cl_salv_wd_column.

    lo_col = wd_this->wd_cpifc_alv( )->get_model( )->if_salv_wd_column_settings~get_column( 'RESULT' ).

    CREATE OBJECT lo_cell_editor TYPE cl_salv_wd_uie_dropdown_by_key

    EXPORTING

    selected_key_fieldname = 'RESULT'.

    lo_col->set_cell_editor( lo_cell_editor ).

    Best Regards,

    Sascha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 14, 2008 at 04:05 AM

    Hi,

    Check this Article [Recreate the SE16 Data Browser|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bf20e84f-0901-0010-fe9e-91d100013a59] written by Thomas Jung.It might help you to solve the problem.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      nice and really useful article, but it doesn't answer my question. Let's use the SFLIGHT table from the article, my question will be, is it possible to show in the CARRID column "American Airlines" instead of "AA"?

      When you have a table maintenance and look at it in SM30 this is possible. And to be more specific imagine that instead of a validation table (SCARR) the data element for CARRID had a list of valid values (hardcoded in the domain). Is it possible to show the description instead of the codes, without doing coding?

      I'm thinking on a configuration property for the ALV column or something like that...

      Regards,

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.