Add row color in ALV using CL_SALV_TABLE

1
19276

[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 and copy the below code.

https://gist.github.com/prakash13t/3dd7da4db24eca246d74#file-rowcolor_salv-abap

Output before:

alv2

[adsenseyu1]

Output after adding colors to row:

alv1

WordPress database error: [Table 'saplearn_wp1.wp_nsex_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_nsex_comments.comment_ID FROM wp_nsex_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 669 AND comment_parent = 0 ORDER BY wp_nsex_comments.comment_date_gmt ASC, wp_nsex_comments.comment_ID ASC

Comments are closed.