2007 Jul 09 1:23 PM
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.
2007 Jul 09 1:28 PM
in fieldcatelog give
wa_fieldcat-emphasize = 'VALUE'
wa_fieldcat-emphasize = 'C611'.
Message was edited by:
Sumi Vasu
2007 Jul 09 1:29 PM
2007 Jul 09 1:32 PM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |