Friday, August 9, 2013
Specifying the own wording of the Column Header
To specify the wording of the column header, we use the methods of class CL_SALV_WD_COLUMN_HEADER. We can specify the text to be displayed with the following options as the column header.- We can enter any text.
- We can enter a separate DDIC data element whose field label is to be used as the column header.
Check the ALV demo program for step by step process to create ALV in Web Dynpro ABAP.
METHOD SET_COLUMN_HEADINGS . "Create an instance of ALV component Usage DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE. LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ). IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL. LO_CMP_USAGE->CREATE_COMPONENT( ). ENDIF. "Create an instance of ALV Interface Controller DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE . LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV( ). "Configuration of the ALV Output DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE. LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL( ). DATA LR_COLUMN_SETTINGS TYPE REF TO IF_SALV_WD_COLUMN_SETTINGS. DATA LT_COLUMNS TYPE SALV_WD_T_COLUMN_REF. DATA LS_COLUMNS LIKE LINE OF LT_COLUMNS. DATA:LS_COLUMN_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER . LR_COLUMN_SETTINGS ?= LV_VALUE. LT_COLUMNS = LR_COLUMN_SETTINGS->GET_COLUMNS( ). LOOP AT LT_COLUMNS INTO LS_COLUMNS. LS_COLUMN_HEADER = LS_COLUMNS-R_COLUMN->GET_HEADER( ) . LS_COLUMN_HEADER->SET_DDIC_BINDING_FIELD( IF_SALV_WD_C_COLUMN_SETTINGS=>DDIC_BIND_NONE ). CASE LS_COLUMNS-ID. WHEN 'PERNR'. LS_COLUMN_HEADER->SET_TEXT( 'Pers. No.' ). WHEN 'ENAME'. LS_COLUMN_HEADER->SET_TEXT( 'Name' ). WHEN 'STELL'. LS_COLUMN_HEADER->SET_TEXT( 'Job ID' ). WHEN 'STELL_TXT'. LS_COLUMN_HEADER->SET_TEXT( 'Job Description' ). WHEN 'PLANS'. LS_COLUMN_HEADER->SET_TEXT( 'Position ID' ). WHEN 'PLANS_TXT'. LS_COLUMN_HEADER->SET_TEXT( 'Position Description' ). ENDCASE. ENDLOOP. ENDMETHOD.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- 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
Fantastic website for knowledge sharing...!! Great Job...!!!
ReplyDelete