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: 
Read only

alvreport

Former Member
0 Likes
559

hi,

my internal table have three fields , my requirement is i want to display the first field only ( say for example LIFNR) in red color in alv.

hi,

my internal table have three fields , my requirement is i want to display the first field only ( say for example LIFNR) in red color in alv.

3 REPLIES 3
Read only

Former Member
0 Likes
537

in fieldcatelog give

wa_fieldcat-emphasize = 'VALUE'

wa_fieldcat-emphasize = 'C611'.

Message was edited by:

Sumi Vasu

Read only

rodrigo_paisante3
Active Contributor
0 Likes
537
Read only

Former Member
0 Likes
537

Hi,

If u want to display only first field, build a fieldcatalog for that field alone and display it..

If u want to display all the three fields but diplay fist field only red in color means,

Check out this code,

FORM build_fieldcatalog .

fieldcatalog-fieldname = 'FIELD1'.

fieldcatalog-seltext_m = 'Field1.'.

fieldcatalog-col_pos = 0.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'FIELD2'.

fieldcatalog-seltext_m = 'Field2.'.

fieldcatalog-col_pos = 1.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

fieldcatalog-fieldname = 'FIELD3'.

fieldcatalog-seltext_m = 'Field3.'.

fieldcatalog-col_pos = 2.

APPEND fieldcatalog TO fieldcatalog.

CLEAR fieldcatalog.

ENDFORM.

FORM build_layout .

gd_layout-no_input = 'X'.

gd_layout-colwidth_optimize = 'X'.

gd_layout-totals_text = 'Totals'(256).

gd_layout-coltab_fieldname = 'CELL_COLOUR'.

ENDFORM. " build_layout

LOOP AT it.

*Now based on the value of the field1 we can

change the cell colour of the field .

IF it-FIELD1 eq '10001' .

ls_cellcolour-fname = 'FIELD1'.

ls_cellcolour-color-col = '5'.

ls_cellcolour-color-int = '1'.

ls_cellcolour-color-inv = '0'.

APPEND ls_cellcolour TO it-cell_colour.

IF sy-subrc EQ 0.

MODIFY it.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM.