cancel
Showing results for 
Search instead for 
Did you mean: 

SALV_WD_TABLE new entry and sort issue

Szczerbowski
Active Participant
0 Kudos

Hi,

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?

Accepted Solutions (1)

Accepted Solutions (1)

Szczerbowski
Active Participant
0 Kudos

So it seems the order is:


- ON_DATA_CHECK

- table sort

- ON_CELL_ACTION

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.

Szczerbowski
Active Participant
0 Kudos

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.

Answers (0)