03-10-2009 2:53 PM
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
03-17-2009 10:35 AM
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.