Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the Background colour of particular CELL in ALV Grid display?

Former Member
0 Kudos
1,061

How to change the Background colour of  particular CELL in ALV Grid display(whether it may OOPS ALV / Normal ALV) ?

Actually i have requirement like to change the colours for purticular cells in OOPS alv grid display.

Ans:

1) Declare a filed in your final internal table of type LVC_T_SCOL.

          TYPES: BEGIN OF t_final,

                        cellcolor TYPE lvc_t_scol,

          END OF t_final.


2) Declare a structure for a layout.

     Data: we_layout  TYPE lvc_s_layo.


3) Declare a structure for color.

     DATA wel_cellcolor TYPE lvc_s_scol.


4) Pass field name to Layout work area.

      we_layout-ctab_fname = 'CELLCOLOR'.


5) At the time of filling the final internal table use the below code inside the LOOP to change background colour of Cell.

   

          wel_cellcolor-fname = (FILED NAME  which field cell you want to change the colour)

          wel_cellcolor-color-col = '5'" Green colour

          wel_cellcolor-color-int = '1'.

          APPEND wel_cellcolor TO we_final-cellcolor.

          CLEAR wel_cellcolor.

    

     Finally append this Final work area to your final internal table.

    

          APPEND we_final TO wt_final.

          CLEAR: we_final

1 ACCEPTED SOLUTION

prad_k
Explorer
0 Kudos
393

Go through the link below.

1 REPLY 1

prad_k
Explorer
0 Kudos
394

Go through the link below.