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

Getting selected rows in ALV grid output

Former Member
0 Likes
886

Hi All,

As per my requirement, in the ALV output i have 3 push buttons (Display, Edit and Print).

Using the below code, I am trying to get the selected rows from the output.

CALL METHOD ob_grid->check_changed_data

CHANGING

c_refresh = w_x.

CALL METHOD ob_grid->get_selected_rows

IMPORTING

et_index_rows = is_rows.

When I execute the code wid Display/Edit push buttons it is working fine as long as Print button is not used.

If I use the Print button and then try to select any other push button, I am not getting the entries in is_rows internal table.

Kindly help me.

Thanks in Advance.

Hi All,

As per my requirement, in the ALV output i have 3 push buttons (Display, Edit and Print).

Using the below code, I am trying to get the selected rows from the output.

CALL METHOD ob_grid->check_changed_data

CHANGING

c_refresh = w_x.

CALL METHOD ob_grid->get_selected_rows

IMPORTING

et_index_rows = is_rows.

When I execute the code wid Display/Edit push buttons it is working fine as long as Print button is not used.

If I use the Print button and then try to select any other push button, I am not getting the entries in is_rows internal table.

Kindly help me.

Thanks in Advance.

3 REPLIES 3
Read only

Former Member
0 Likes
529

Would your user actually select a row if they wanted simply to print? I don't see that you're checking to see if the user actually selected a row ( after et_index_rows = is_rows, need to be sure is_rows is not initial (zero)). Debug should show you exactly what is happening in the situation you described.

Read only

0 Likes
529

Yes. We have added the code further by making use of the entries obtained in is_rows.

I have tried debugging and found at that point that the entries are not getting filled in this internal table

Read only

0 Likes
529

The entries will not be populated in is_rows if you press the Print button.

Print will print the whole ALV.