(ABAP 코드) Custom column names in CL_SALV_TABLE
출처:
https://answers.sap.com/questions/5523128/changing-column-header-text-ol-alv-object-ref-clsa.html
Changing Column header text ol ALV: Object ref cl_salv_table | SAP Community
Hi Friends, my code: TRY. CALL METHOD cl_salv_table=>factory( EXPORTING r_container = gv_custom_container container_name = 'CUSTOM_300' IMPORTING r_salv_table = gr_table CHANGING t_table = gt_itab_email ). CATCH cx_salv_msg. "#EC NO_HANDLER CLEANUP. ENDTRY
answers.sap.com
data: lr_columns type ref to cl_salv_columns_table,
lr_column type ref to cl_salv_column_table.
lr_display type ref ro cl_salv_display_settings.
lr_columns = gr_table->get_columns( ).
try.
lr_display = ir_salv_tab->get_display_settings( ).
lr_display->set_striped_pattern( cl_salv_display_settings=>true ).
lr_display->set_list_header( 'Custom Header' ).
lr_column ?= lr_columns->get_column( 'FIELD1' ).
lr_column->set_short_text( 'Custom Text' ).
lr_column->set_medium_text( 'Custom Text' ).
lr_column->set_long_text( 'Custom Text' ).
catch cx_salv_not_found. "#EC NO_HANDLER
endtry.