Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Grid: Display Text instead of Value

Former Member
0 Kudos

Hello everybody,

I am developing several ALV grids to display information with custom values which have custom domains. These domains do have a fixed list of allowed values. These values have corresponding texts (which can be found in table DD07T).

I now want an ALV grid to display this text instead of the actual value. Is there a simple way to do this? I know I can create a second structure for the ALV grid which contains a text field instead of the value field and manually fill it, but thats kind of time consuming for lots of grids. Perhaps there is a way to tell the fieldcatalogue to read the actual value from the domain.

Thanks and regards,

Christoph

1 REPLY 1

Former Member
0 Kudos

For those who have a similar issue: I figured out how to solve this with a custom conversion routine. It created a routine which converts the stored values to the one it want to display and modified the field catalog in the following way:

  DATA:
    lt_fcat     TYPE slis_t_fieldcat_alv WITH HEADER LINE.

* Build field catalog
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name       = 'Z_STRUCTURE_ONE'
    CHANGING
      ct_fieldcat            = lt_fcat[]
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

* Modify field catalog (edit masks)
  LOOP AT lt_fcat.
    CASE lt_fcat-fieldname.
      WHEN 'STATUS'.
        lt_fcat-edit_mask = '==ZCV01'.
        lt_fcat-outputlen = 15.
        MODIFY lt_fcat INDEX sy-tabix.
    ENDCASE.
  ENDLOOP.