Skip to Content
0
Aug 20, 2014 at 08:05 AM

Change color of key field in salv_table

320 Views

Hello,

this is my first post in scn. This community helped me a lot so far.

Now i have a problem with the SALV. I can change the color of normal fields but not of key fields. I changed the attribute like this:

INCLUDE <color>.
     lv_col-col = col_negative.

     TRY.
         lo_column ?= lo_columns->get_column( 'AUFNR' ).
         lo_column->set_key( ' ' ).
         lo_column->set_visible( 'X' ).
         lo_column->set_edit_mask( ' ' ).
         lo_column->set_color( lv_col ).
       CATCH cx_salv_not_found.
     ENDTRY.

 TRY.
         lo_column ?= lo_columns->get_column( 'RSDAT' ).
         lo_column->set_key( ' ' ).
         lo_column->set_color( lv_col ).
       CATCH cx_salv_not_found.
     ENDTRY.

He get the correct column and changes set_key from 'X' to ' ' but the color is still blue. Maybe anyone has an idea what to change on the column object.

Thanks in advance

Attachments

salvcolour.png (4.1 kB)