ALV colors are divided into row colors, column colors, and cell colors.

Source: Internet
Author: User

ALV color is dividedRow color,Column colorAndCell color.
The task requires that tabellenfeld be filled in yellow, that is
Cell color


Data:
Ls_cellcolortypelvc_s_scol,
Coltabtypelvc_t_scol,
Colortypelvc_s_colo.

Data: Begin offield_struc, "define the color in the Table Structure
....
Cellcolortypelvc_t_scol,
End offield_struc.
View_tab ist eine structur von field_struc.

* Farbe einsetzen
Color-Col = '3 '.
Color-Int = '1 '.
Color-inv = '0 '.

Loop atxxx into view_tab.
If two tables have different data values.
Ls_cellcolor-fname = 'wears '. "specifies the column name
Ls_cellcolor-color = color.
Appendls_cellcolor to coltab.
Clearls_cellcolor.
Endif.
View_tab-cellcolor = coltab.
Appendview_tabtoit_view.
Endloop.

Row color[Quelle: http://blog.csdn.net/zltpc007/archive/2008/10/18/3095850.aspx]
You need to add a field in the table to display color information, such as color (4) type C.

ITAB-COLOR = 'c700 '.

 

In addition, you must set the display color based on the FM or class method.

  • FM: LS_LAYOUT-INFO_FIELDNAME = 'color '.

Call function 'reuse _ alv_grid_display'

Exporting
Is_layout = ls_layout
It_fieldcat = lt_fieldcat
Tables
T_outtab = itab.

· Class method:SLA-Info_fname = 'color '.

Call method go_grid-> set_table_for_first_display

Exporting
Is_variant = gs_variant
I _save = 'A'
Is_layout =SLA
Changing
It_outtab = itab []
It_fieldcatalog = gt_fieldcat []
Exceptions
Invalid_parameter_combination = 1
Program_error = 2
Too_many_lines = 3
Others = 4.

Column color


Set fieldcat, for example, the color of the TMP_FIELDCAT-EMPHASIZE = 'c500 '. "column

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.