首页 > SAP > ABAP > Add row color in ALV using CL_SALV_TABLE
2019
08-29

Add row color in ALV using CL_SALV_TABLE

[adsenseyu2]

In this tutorial, we will learn how to add color to the row of an ALV using CL_SALV_TABLE.In our earlier we applied colors to the columns,click here to know how. This is similar to Functional Module ALV, we need an extra column in the output internal table to apply colors to a particular row (or) particular cell. Lets see how we can do it.

To apply colors to row in ALV

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/3dd7da4db24eca246d74#file-rowcolor_salv-abap

Output before:

[adsenseyu1]

Output after adding colors to row:

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