2009 Feb 17 5:23 PM
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.
activate ALV generic Functions
DATA: lr_functions TYPE REF TO cl_salv_functions_list.
TRY.
lr_functions = gr_table->get_functions( ).
lr_functions->set_default( abap_true ).
gr_columns = gr_table->get_columns( ).
*******************************************************
PERFORM change_columns_text USING gr_columns.
*******************************************************
gr_columns->set_exception_column( value = 'LIGHTS' ).
CATCH cx_salv_data_error.
CLEANUP.
ENDTRY.
CALL METHOD gr_table->display.
Problem:
Can someone give me tips on how to change the Column text of the return table gr_table in my code.
I would like to change the text before CALL METHOD gr_table->display.
Thanks
Blacky
2009 Feb 17 5:29 PM
You need to get the perticular column object from the COLUMNS object
Like:
data: lr_columns type ref to cl_salv_columns_table,
lr_column type ref to cl_salv_column_table.
lr_columns = gr_table->get_columns( ).
try.
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.
Check report: SALV_DEMO_TABLE_COLUMNS
Regards,
Naimesh Patel
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.
activate ALV generic Functions
DATA: lr_functions TYPE REF TO cl_salv_functions_list.
TRY.
lr_functions = gr_table->get_functions( ).
lr_functions->set_default( abap_true ).
gr_columns = gr_table->get_columns( ).
*******************************************************
PERFORM change_columns_text USING gr_columns.
*******************************************************
gr_columns->set_exception_column( value = 'LIGHTS' ).
CATCH cx_salv_data_error.
CLEANUP.
ENDTRY.
CALL METHOD gr_table->display.
Problem:
Can someone give me tips on how to change the Column text of the return table gr_table in my code.
I would like to change the text before CALL METHOD gr_table->display.
Thanks
Blacky
2009 Feb 17 5:29 PM
You need to get the perticular column object from the COLUMNS object
Like:
data: lr_columns type ref to cl_salv_columns_table,
lr_column type ref to cl_salv_column_table.
lr_columns = gr_table->get_columns( ).
try.
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.
Check report: SALV_DEMO_TABLE_COLUMNS
Regards,
Naimesh Patel
2009 Feb 17 7:51 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |