Application Development 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: 

Alv Color - LVC_T_SCOL

Former Member
0 Kudos

Hy !

Friends, i have a report alv-grid, this report using a dynamic table, this dynamic table was created using fieldcats, my doubt, how can i can do to put the structure LVC_T_SCOL in fieldcat ? i need this structure to use color in cells.

Example:

OBS: this example is incorrect...

  • COLOR_CELL

i = i + 1.

CLEAR afield2.

afield2-col_pos = i.

afield2-fieldname = 'COLOR_CELL'.

afield2-inttype = 'h'. " Tipo de campo

afield2-ref_table = 'LVC_T_SCOL'.

afield2-ref_field = 'COLOR_CELL'.

APPEND afield2 TO it_fieldcatalog.

Thanks.

Fabrício

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

LVC_T_SCOL will be used to fill your output internal table. you can use this to fill the colors for each line differently based on conditional data.

Hope the example below helps you.

regards,

Satya

*--- Internal table holding list data

DATA BEGIN OF gt_list OCCURS 0 .

INCLUDE STRUCTURE SFLIGHT .

DATA rowcolor(4) TYPE c .

DATA cellcolors TYPE lvc_t_scol .

DATA END OF gt_list .

A sample code to make the cell at row 5 and column ‘MATNR’ colored

DATA ls_cellcolor TYPE lvc_s_scol .

...

READ TABLE gt_list INDEX 5 .

ls_cellcolor-fname = 'MATNR' .

ls_cellcolor-color-col = '7' . "colors as in the write

ls_cellcolor-color-int = '1' . "intensified on 1 / 0 off

APPEND ls_cellcolor TO gt_list-cellcolors .

MODIFY gt_list INDEX 5 .

2 REPLIES 2

Former Member
0 Kudos

Hi,

LVC_T_SCOL will be used to fill your output internal table. you can use this to fill the colors for each line differently based on conditional data.

Hope the example below helps you.

regards,

Satya

*--- Internal table holding list data

DATA BEGIN OF gt_list OCCURS 0 .

INCLUDE STRUCTURE SFLIGHT .

DATA rowcolor(4) TYPE c .

DATA cellcolors TYPE lvc_t_scol .

DATA END OF gt_list .

A sample code to make the cell at row 5 and column ‘MATNR’ colored

DATA ls_cellcolor TYPE lvc_s_scol .

...

READ TABLE gt_list INDEX 5 .

ls_cellcolor-fname = 'MATNR' .

ls_cellcolor-color-col = '7' . "colors as in the write

ls_cellcolor-color-int = '1' . "intensified on 1 / 0 off

APPEND ls_cellcolor TO gt_list-cellcolors .

MODIFY gt_list INDEX 5 .

0 Kudos

Hi !

I understod your explanation, but, my dynamic internal table was created using fieldcats, i´ve tried to do it as in the example above, but a short dump has ocurred.

Thanks.