2007 Jul 09 5:07 PM
2007 Jul 09 5:16 PM
DATA: GS_LAYOUT TYPE LVC_S_LAYO.
GS_LAYOUT-ZEBRA = 'X'.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING IS_VARIANT = GS_VARIANT
I_SAVE = X_SAVE
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
CHANGING IT_FIELDCATALOG = GT_FIELDCAT
IT_SORT = GT_SORT[]
IT_OUTTAB = GI_ZTBCOMCON[].
Greetings,
Blag.
2007 Jul 09 5:16 PM
Hi,
Check the following link:
http://www.sap-img.com/abap/line-color-in-alv-example.htm
Regards,
Bhaskar
2007 Jul 09 5:36 PM
For a non OO ALV...
TYPE-POOLS: slis.
DATA: xfield TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv.
In your data structure you have tu put a field for the color, example:
DATA: BEGIN OF xdata OCCURS 1.
DATA: ebeln LIKE ekko-ebeln,
name1 LIKE lfa1-name1,
txz01 LIKE ekpo-txz01,
color_line(4) TYPE c, " <==== this is the color line
END OF xdata.
You have create a form for the layout like this:
FORM init_layout.
gs_layout-info_fieldname = 'COLOR_LINE'. "<==the name of de field of the structure
ENDFORM.
Perform the init_layout in the initialization.
Your call alv function, have to be like this:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = 'YOUR_PROGRAM'
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = xfield[]
TABLES
t_outtab = xdata
EXCEPTIONS
program_error = 1
OTHERS = 2.