Add cell color in ALV using CL_SALV_TABLE

1
3383

[adsenseyu2]

In this tutorial, we will learn how to color a particular cell in ALV using the factory class CL_SALV_TABLE.In earlier tutorial we have added colors to row in ALV, click here to know how. This is similar to coloring row. Lets see how we can do it.

To apply cell color,

  • Create a new column of Type LVC_T_SCOL in your output internal table.
  • Set the above column as Color Column in ALV by using the method SET_COLUMN_COLOR( ).
  • Add the color data to the color column based on your requirement.

Create a program in SE38 and copy the below code.

https://gist.github.com/prakash13t/7e4f8b9b8d1ba2d6f178#file-cellcolor_salv-abap

Output Before:

alv2[adsenseyu1]

Output after adding color to cells:alv3

  • Efim

    Thank you very much for your article