cancel
Showing results for 
Search instead for 
Did you mean: 

problem in colouring in ALV

Former Member
0 Kudos

hi,

I want to display one column alone in a colored format.

how to do it ..?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

u can refer to the following code:

1. Include a field of type u201Cslis_specialcol_alv OCCURS 0u201D in your output table.

TYPES: BEGIN OF gt_out1.

INCLUDE TYPE gt_out.

TYPES: c_info TYPE slis_specialcol_alv OCCURS 0,

END OF gt_out1.

DATA: gi_out1 TYPE STANDARD TABLE OF gt_out1,

wa_out1 TYPE gt_out1.

2. Fill the value of color and field name and modify your output table.

wa_c_info-color-int = '1'.

wa_c_info-color-inv = '1'.

wa_c_info-color-col = u20182u2019.

wa_c_info-fieldname = 'POST'.

APPEND wa_c_info TO wa_out1-c_info.

MODIFY gi_out1 FROM wa_out1 TRANSPORTING c_info.

3. Pass this field C_INFO into ALV layout.

wa_layout-coltab_fieldname = 'C_INFO'.

4. Pass this layout in REUSE_ALV_GRID_DISPLAY FM.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

i_callback_pf_status_set = 'SET_STATUS'

is_layout = wa_layout

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = gi_f_cat

TABLES

t_outtab = gi_out1

EXCEPTIONS

program_error = 1

OTHERS = 2.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please refer to the following link:

[http://help.sap.com/saphelp_nw04/helpdata/en/c3/d9d93fac0fec06e10000000a1550b0/frameset.htm]

Thanks,

Anurodh