SALV_WD_TABLE new entry and sort issue
I have a dynamic SALV_WD_TABLE, and I do INSERT ROW with a custom button (just adds to context node DATA).
There is also one sorted column, and I am having index issues for ON_CELL_ACTION handlers.
The user INSERTS a new row, fills in some key cells, one of them affected by the sort, so before he hits enter this line is the 1st one in the table.
Now when he hits enter, the ON_CELL_ACTION triggers and it tells me R_PARAM-INDEX was 1 - as in first row.
But if I use that index to get the element from the context it's wrong, because context is already sorted, and this line is there under i.e. 7.
This is confusing, any hints?
Michal Szczerbowski replied
Weeell so it seems i shot myself in the foot again, because that behaviour is controlled with these settings:
lr_table_settings->set_refresh_on_data_change( if_salv_wd_c_table_settings=>refresh_and_apply_services ).
lr_table_settings->set_refresh_on_data_check( if_salv_wd_c_table_settings=>refresh_data_only ).
Once understood, it works as expected.