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

Table control multiple line selection

Former Member
0 Likes
2,536

Hi

I have a table control where i have to select multiple lines and pass the selected line data into another internal table.

Example.

I have table control which displays 20 rowss. I can randomly select the rows in the 20. If suppose i have selected 1,2,5,8,9,13,16,19,20 rows. then i need to pass these rows data into another internal table pls guide me on this

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
895

There should be a "MARK" field in your internal table. This is how you know which ones are selected. Loop at the internal table where MARK = 'X'.

Loop at itab where mark = 'X'.
move-coresponding fields of itab to itab2.
append itab2.
endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
895

Hi,

This MARK field should be part of the table control parameters.

Svetlin

Read only

0 Likes
895

To clarify.

The "mark" field is part of the internal table which is shown in the table control. If you generated the table control with the wizard, most likely it wanted to know what your "MARK" field is in the internal table. If you said MARK, then there has to be a field in your internal table named MARK. The wizard would have then generated this module.



module itabcon_mark input.
  modify <b>itab</b>    index itabcon-current_line
    transporting <b>MARK</b> .
endmodule.

This module is the code that actually updates the internal table when you select it.

Then, its just a matter of LOOPing and check this MARK = 'X'.

Regards,

Rich Heilman

Read only

0 Likes
895

If these answers have been helpful, please don't forget to awared points accordingly. Thanks.

Regards

Rich Heilman

Read only

0 Likes
895

Thanks a lot......Rich Heilman .

I have strugled with the same problem from past 4 hours and its solved with your logic.

Thanks SDN and alll

Sridhar.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
895

Hi,

Check this link for details about selecting multiple lines in table control.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table control in abap.pdf

If it is useful,click the star on the left of the reply.If you need clarifications,kindly get back.

Read only

Former Member
0 Likes
895

Hi,

Try this methos,

CALL METHOD go_grid->get_selected_rows

IMPORTING

et_index_rows = gi_index_rows.

Regs,

Venkat

Read only

Former Member
0 Likes
895

Hi Vamsi,

Hope u r doing fine.

Check this sample program:

DEMO_DYNPRO_TABCONT_LOOP_AT

Regards,

Anjali