Application Development and Automation 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: 
Read only

Deselect rows in ALV after processing

Former Member
0 Likes
4,155

Hi Experts,

I have the following requirement ...

- in an ALV you can select severals rows, press a button for a Special processing and when the processing is done, the selected rows should be automatically deselected.

How can I manage the deselection?

Can you please help? Thanks!!

Monika

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,948

Depending on ALV tool :

  • Modify the internal table (reset the BOX field as defined in layout) and trigger a REFRESH (either by OO ALV method (e.g. CL_GUI_ALV_GRID->REFRESH_TABLE_DISPLAY) or USER_COMMAND parameter RS_SELFIELD-REFRESH.
  • Use a OO ALV deselecting method (e.g. method SET_SELECTED_ROWS of CL_SALV_SELECTIONS)

Regards,

Raymond

5 REPLIES 5
Read only

nishantbansal91
Active Contributor
0 Likes
1,948

HI,

Are you creating ALV using function or classes?

THanks

NIshant

Read only

0 Likes
1,948

I'm using classes (cl_salv_table)

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,949

Depending on ALV tool :

  • Modify the internal table (reset the BOX field as defined in layout) and trigger a REFRESH (either by OO ALV method (e.g. CL_GUI_ALV_GRID->REFRESH_TABLE_DISPLAY) or USER_COMMAND parameter RS_SELFIELD-REFRESH.
  • Use a OO ALV deselecting method (e.g. method SET_SELECTED_ROWS of CL_SALV_SELECTIONS)

Regards,

Raymond

Read only

GSerfiotis
Participant
0 Likes
1,948

Are you referring to a custom developed program? If yes, in case you are using ALV functions you need to:

  1. Set to blank the box field of the internal table displayed for the lines you are interested in
  2. Refresh the ALV for the changes in the internal table to be transported to the ALV output.

Both of the above in the subroutine used to implement the user actions (i.e., the one defined the the i_callback_user_command parameter of FM REUSE_ALV_GRID_DISPLAY).

For example, if BOX is the name of the field (you will find it in a statement like ls_layout-box_fieldname     = 'BOX':

loop at itable where box eq 'X'.

  itable-box = space.

  modify itable transporting box.

endloop.

ps_selfield-refresh = 'X'. (where selfield is the name of the import parameter of type slis_selfield)

Read only

Former Member
0 Likes
1,948

Hi Monika,

Use following codes..

refresh lt_rows.

CALL METHOD (Here name your Grid)->set_selected_rows

       EXPORTING

         it_index_rows = lt_rows.


Hope it would solve your problem.


Thanks

Srimanta