首页 > SAP > SAPUI5 > Add cell color in ALV using CL_SALV_TABLE
2019
08-27

Add cell color in ALV using CL_SALV_TABLE

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:Add cell color in ALV using CL_SALV_TABLE - 第2张  | 优通SAP

最后编辑:
作者:yangsen
有需要可在文章留言或者邮件yan252@163.com给我。