Hi Vicky,
To set the default sorting order, set the field 'SORT' to 'A'(asc) or 'D'(desc).
Write the below code on your htm page to give the default sorting order.
DATA: lv_xml_inp TYPE bsp_dlc_xml,
lv_xml TYPE string,
ls_config TYPE bsp_dlc_table_descr,
lt_columns TYPE bsp_dlc_column_descr_tab.
FIELD-SYMBOLS <ls_column> TYPE bsp_dlc_column_descr.
lv_xml_inp = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).
ls_config = cl_bsp_dlc_table_utility=>conf_xml_to_abap( lv_xml_inp ).
READ TABLE LS_CONFIG-COLUMNDEFINITION ASSIGNING <LS_COLUMN> WITH KEY name = 'fieldname'.
if sy-subrc = 0.
<LS_COLUMN>-SORT = 'D'.
endif.
lv_xml = cl_bsp_dlc_table_utility=>CONF_ABAP_TO_XML( ls_config ).
controller->configuration_descr->set_config_data(
EXPORTING
IV_CONFIG_DATA = lv_xml
).
Regards,
Ritu