Settings
SALV IDA framework also provides the flexibility to change Column settings. Lets
check how to change to change the column settings in SALV IDA.
Preface
In the last article SALV IDA New Calculated Fields, we added couple of new
columns in the ALV. Since these calculated fields are not part of the DB structure
obviously they dont have proper column headings. Lets try to make it better!
Column Description
o SET_FIELD_HEADER_TEXTS
o SET_DATA_ELEMENT
o SET_CURRENCY_REFERENCE_FIELD
o SET_FIXED_CURRENCY
o SET_FIXED_UNIT
o SET_UNIT_REFERENCE_FIELD
Disable methods
o DISABLE_SORT
o DISABLE_FILTER
o DISABLE_AGGREGATION
Code Lines
Code lines to set the settings for the columns. This code is based on the template
available in article SALV IDA Introduction
*$*$1
METHODS:
column_settings.
*$*$1
*$*$2
me->column_settings( ).
*$*$2
METHOD column_settings.
* Column Description
TRY.
o_salv_ida->field_catalog( )->set_field_header_texts(
iv_field_name = 'UCASE_TEXT'
iv_header_text = 'Text in Upper case' ).
CATCH cx_salv_ida_unknown_name
cx_salv_call_after_1st_display.
ENDTRY.
TRY.
* Column Description
o_salv_ida->field_catalog( )->set_field_header_texts(
iv_field_name = 'COUNT_PH'
iv_header_text = 'Placeholder Count' ).
CATCH cx_salv_ida_unknown_name
cx_salv_call_after_1st_display.
ENDTRY.
* Disable Sort
TRY.
o_salv_ida->field_catalog( )->disable_sort(
iv_field_name = 'MSGNR' ).
CATCH cx_salv_ida_unknown_name
cx_salv_call_after_1st_display.
ENDTRY.
* Disable Filter
TRY.
o_salv_ida->field_catalog( )->disable_filter(
iv_field_name = 'SPRSL' ).
CATCH cx_salv_ida_unknown_name
cx_salv_call_after_1st_display.
ENDTRY.
TRY.
o_salv_ida->field_catalog( )->enable_text_search(
iv_field_name = 'TEXT' ).
CATCH cx_salv_ida_unknown_name
cx_salv_call_after_1st_display.
ENDTRY.
ENDMETHOD.
*$*$3
Output
So, now the added columns has description
Sort is disabled on the Message Number