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: 

How to deselect the rows in an ALV (created using cl_salv_table)

ansonabraham
Participant
0 Kudos

Hi,

How to deselect the rows in an ALV (created using cl_salv_table).

I have used the method CL_SALV_SELECTIONS->SET_SELECTION_MODE( IF_SALV_C_SELECTION_MODE=>NONE ), but it doesn't solve my problem.

1 ACCEPTED SOLUTION

former_member184569
Active Contributor
0 Kudos

Try the method GET_SELECTIONS which returns a reference to instance of class CL_SALV_SELECTIONS. This class has method SET_SELECTED_ROWS which can be used to select rows using index.

http://www.consolut.com/en/s/sap-ides-access/d/s/doc/YF-CL_SALV_SELECTIONS~~~~~~~~~~~~SET_SELECTED_R...

Accordingly, you can pass appropriate parameters to this method to deselect all rows in table. (probably  by passing an empty table to set selected rows)

5 REPLIES 5

Former Member

former_member201275
Active Contributor
0 Kudos

Have you tried: REFRESH_TABLE_DISPLAY?

hiriyappa_myageri
Participant
0 Kudos

Hi Anson,

In Field Catlog u can Pass hotspot 'X'.

it will not show the selection at all.

it_fldcat1-edit   = 'X'.

it_fldcat1-hotspot   = 'X'.

append it_fldcat1.

if pass like this to any one filed means it will not selection icon in ur ALV Report.


Ragards,

Hiriz

former_member184569
Active Contributor
0 Kudos

Try the method GET_SELECTIONS which returns a reference to instance of class CL_SALV_SELECTIONS. This class has method SET_SELECTED_ROWS which can be used to select rows using index.

http://www.consolut.com/en/s/sap-ides-access/d/s/doc/YF-CL_SALV_SELECTIONS~~~~~~~~~~~~SET_SELECTED_R...

Accordingly, you can pass appropriate parameters to this method to deselect all rows in table. (probably  by passing an empty table to set selected rows)

Former Member
0 Kudos

Hi,

Can u try below code and let me know.

  data lo_nd type REF TO if_wd_context_node. 

  data lv_old_index type i.

  data lv_new_index type i.

  lv_new_index = r_param->index.

  lv_old_index = r_param->old_index.

  IF lv_old_index = lv_new_index.

    lo_nd = wd_context->get_child_node( 'INT_TAB' ). "INT_TAB is the name of the context node that  is passed to the ALV component

    lo_nd->set_lead_selection_index( if_wd_context_node=>no_selection ).

  ENDIF.

Best Regards,

Abirami