Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

After SALV Refresh, rows are still selected in display

Former Member
0 Kudos

I have an SALV output (simple list) that updates a database table based upon user action. During the user_command processing, I modify the internal table for the SALV, removing the rows that have been updated by the user, and clearing my index row table created from the get selects methods (this appears to prevent this problem in older ALV versions). Then, I do a alv->refresh( ).

Upon re-entry to the SALV display, all the data is correct, but the rows that were previously selected by the user are highlighted. For example, if the user updated row 1, I do the processing and return to the SALV display after refresh. Row 1 (formerly row 2) is now highlighted.

If the user updated rows 1 and 3, upon return to the screen 1 and 3 are still selected (were 2 and 4 before the update). . If the user updated the last row, the SALV display has no rows highlighted and cursor is on row 1, column 1, which would seem to be the correct behavior after the refresh.

SALV_DEMO* programs don't appear to handle this, and I don't find any method that will let me reset that prior user selection.

Any suggestions to correct the "memory" feature of the SALV display?

6 REPLIES 6

Former Member
0 Kudos

Hi ,

Try to free your container before clearing your alv grid.

try the below code.

CALL METHOD containername->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

CLEAR containername.

CALL METHOD grid name->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

CLEAR grid name.

Regards,

Chitra

0 Kudos

Thanks, but please note the post>>>.

SALV.....simple list.....there's no container.

Former Member
0 Kudos

While there is no container needed for simple table lists with SALV, the reply prompted research and a different course of action:

Upon update of the database, I call method

"screen_close", then execute the ALV output subroutine again....essentially, restarting the entire output process. This solves the "remembered" rows problem.

Former Member
0 Kudos

reopen for points award error.

Former Member
0 Kudos

Sorry, Chitra. I tried to award very helpful answer points, but the network will not allow that...keeps giving an error and will not allow me to mark as correct....

Former Member
0 Kudos

x