Saturday, December 18, 2010
Set column color code to wa_fieldcat-emphasize to get column coloring.
REPORT ZTEST_NOTEPAD. DATA: BEGIN OF IT_T100 OCCURS 0, CHECKBOX LIKE ABGR-KZART, ARBGB LIKE T100-ARBGB, MSGNR LIKE T100-MSGNR, TEXT LIKE T100-TEXT, END OF IT_T100. DATA:PROGRAM TYPE SY-REPID VALUE SY-REPID. TYPE-POOLS SLIS. DATA:IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, WA_FIELDCAT LIKE LINE OF IT_FIELDCAT. DEFINE FIELDCATALOG. WA_FIELDCAT-FIELDNAME = &1. WA_FIELDCAT-TABNAME = 'IT_T100'. WA_FIELDCAT-SELTEXT_M = &2. WA_FIELDCAT-EMPHASIZE = &3. "highlight columns in color APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT. END-OF-DEFINITION. START-OF-SELECTION. SELECT * FROM T100 INTO TABLE IT_T100 UP TO 100 ROWS. FIELDCATALOG: 'CHECKBOX' 'CHECKBOX' 'C210', 'ARBGB' 'ARBGB' 'C310', 'MSGNR' 'MSGNR' 'C410', 'TEXT' 'TEXT' 'C510'. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = PROGRAM IT_FIELDCAT = IT_FIELDCAT TABLES T_OUTTAB = IT_T100. ->EMPHASIZE = 'Cxyz'. ->(X:'1'-'9'; Y,Z: '0'=OFF '1'=ON) ->'X' = COLUMN IS COLORED WITH THE DEFAULT COLUMN HIGHLIGHT COLOR. ->'Cxyz' = COLUMN IS COLORED WITH A CODED COLOR: ->C: COLOR (CODING MUST BEGIN WITH C) ->X: COLOR NUMBER ->Y: BOLD ->Z: INVERSE
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Sending email with pdf attachment
- ABAP - Step by step tutorial on Smart Forms - Template Node
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
Hi, Excellent tutorials. Any thing on OOPS ALV will be very much appreciated.
ReplyDelete