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-ABAP编辑器 and copy the below code.
https://gist.github.com/prakash13t/7e4f8b9b8d1ba2d6f178#file-cellcolor_salv-abap
1.Output Before:
[adsenseyu1]
2.Output after adding color to cells: