在sap abap editor 中如何改变 关键字颜色
- 提问者网友:杀手的诗
- 2021-05-02 00:35
- 五星知识达人网友:上分大魔王
- 2021-05-02 01:16
- 1楼网友:舊物识亽
- 2021-05-02 01:49
Yes. Here is an example. Pay an attention to the field "GT_DATA-2" =========== REPORT ztest NO STANDARD PAGE HEADING. * ALV TYPE-POOLS: slis. TYPES: BEGIN OF ty_data, key(10), 2 type string, text TYPE c LENGTH 50, END OF ty_data. DATA: gt_fieldcat TYPE slis_t_fieldcat_alv, gs_layout TYPE slis_layout_alv. * Data to be displayed DATA: gt_data TYPE TABLE OF ty_data WITH KEY key WITH HEADER LINE. *---------------------------------------------------------------------* INITIALIZATION. PERFORM e01_fieldcat_init USING gt_fieldcat[]. . *---------------------------------------------------------------------* START-OF-SELECTION. PERFORM selection. *---------------------------------------------------------------------* END-OF-SELECTION. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' * CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = sy-repid is_layout = gs_layout it_fieldcat = gt_fieldcat[] TABLES t_outtab = gt_data EXCEPTIONS program_error = 1 OTHERS = 2. *---------------------------------------------------------------------* * --> E01_LT_FIELDCAT * *---------------------------------------------------------------------* FORM e01_fieldcat_init USING e01_lt_fieldcat TYPE slis_t_fieldcat_alv. DATA: ls_fieldcat TYPE slis_fieldcat_alv. * Key CLEAR ls_fieldcat. ls_fieldcat-fieldname = 'KEY'. ls_fieldcat-tabname = 'GT_DATA'. ls_fieldcat-reptext_ddic = 'KEY'. ls_fieldcat-outputlen = 10. APPEND ls_fieldcat TO e01_lt_fieldcat. * Test number CLEAR ls_fieldcat. ls_fieldcat-fieldname = '2'. ls_fieldcat-tabname = 'GT_DATA'. ls_fieldcat-reptext_ddic = 'Ord#'. ls_fieldcat-emphasize = 'C611'. " red ls_fieldcat-outputlen = 5. APPEND ls_fieldcat TO e01_lt_fieldcat. * Text CLEAR ls_fieldcat. ls_fieldcat-fieldname = 'TEXT'. ls_fieldcat-tabname = 'GT_DATA'. ls_fieldcat-reptext_ddic = 'Text'. ls_fieldcat-outputlen = 40. APPEND ls_fieldcat TO e01_lt_fieldcat. ENDFORM. "e01_fieldcat_init *---------------------------------------------------------------------* * FORM SELECTION * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* FORM selection. gt_data-key = 'Group 1'. gt_data-2 = '19734'. gt_data-text = 'This is group 1'. APPEND gt_data. gt_data-key = 'Group 2'. gt_data-text = 'This is group 2'. APPEND gt_data. ENDFORM. "selection
看看这个行不行