Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

OO ALV colour cells

Hello,

I have implemented a code in which i wanto to colour some cells in the ALV according to a condition.

My code is.

LOOP AT GT_ALVTABLE INTO GW_ALVTABLE.
        IF GW_ALVTABLE-APLFZ <> '0'.
          LV_S_COLOR-FNAME = 'NAME1'.
          LV_S_COLOR-COLOR-COL =  6. "red
          LV_S_COLOR-COLOR-INT =  1.
          LV_S_COLOR-COLOR-INV =  0.
          APPEND LV_S_COLOR TO LV_T_COLOR.
          GW_ALVTABLE-T_COLOR = LV_T_COLOR.
          MODIFY GT_ALVTABLE FROM GW_ALVTABLE.
        ENDIF.

      ENDLOOP.

      TRY.
          GCL_COLUMNS->SET_COLOR_COLUMN( 'T_COLOR' ).
        CATCH CX_SALV_DATA_ERROR.
      ENDTRY.

    GCL_TABLE->DISPLAY( ).

T_COLOR is a column in the GT_ALVTABLE

TYPE LVC_T_SCOL

When i execute it it doesnt colour those cells.

Have i forget something or it cant be done by this way ?

Thx in advance.

Former Member
Former Member replied

hi,

You can refer to any of the following link:

ALV Color a CELL?

alv color rows

ALV color codes

Thank You.

Regards,

Dhanalakshmi L

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question