Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

To determine the number of rows selected in a table view (BSP)


My requirement is:

I would be selecting 1 row from a table view ( which is made multiselect for another requirement) , and press a button.

The functionality of button is to open a popup window based on the row selected.

I want to display an error message if more than 1 row is selected, and button is clicked.

Message will say that "you cannot select more than 1 row".

For this, I need to know how I can get the number of selected rows in a table view.

I tried using the below code.

But I feel this will work only in DO_HANDLE_DATA method.

The popup would open, even before control comes in this method.

CALL METHOD cl_hrrcf_iterator=>get_tv_index


p_id = p_tableview_id

pt_form_fields = table_form_fields


pt_indices = sel_row_index_tab.

Could you please provide me with a solution.

Quick replies will be highly appreciated.


Nisha Vengal.

Former Member
Not what you were looking for? View more on this topic or Ask a question