Skip to Content

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    May 20, 2016 at 09:31 AM

    So it seems the order is:


    - table sort


    Then the index in DATA used on context node gives me the right element, and the one in CELL_ACTION is useless, it could be well enough a random number.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.