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 - select all

Former Member
0 Likes
2,169

Hello,

In table control i am providing a Select all icon, if the user selects the icon then

all the records in the table control has to be selected.

Plz let me know how can i do that .

Rgds,

karthi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,225

Hi,

In User Command Subroutine of PAI.

if OK_CODE = 'SELALL'.

Loop at Internal table (populated in Tab cntrl).

table-mark = 'X'.

modify table.

endloop

endif.

Then pass this table in the PBO.

Thanks & Regards,

Vamsi.

5 REPLIES 5
Read only

Former Member
0 Likes
1,225

Do a recording in BDC and generate a program, see what OK code is being used for select all. Use the OK code statement from the generated program in your original program where it is required.

Do repond if it works fine.

Thanks,

Navita

Read only

Former Member
0 Likes
1,226

Hi,

In User Command Subroutine of PAI.

if OK_CODE = 'SELALL'.

Loop at Internal table (populated in Tab cntrl).

table-mark = 'X'.

modify table.

endloop

endif.

Then pass this table in the PBO.

Thanks & Regards,

Vamsi.

Read only

0 Likes
1,225

hi,

WHEN 'ALL'.

LOOP AT I_ITAB.

I_ITAB-SEL_COM = 'X'.

MODIFY I_ITAB.

ENDLOOP.

n in the layout check w/selcolumn for the table control.

Read only

former_member761936
Active Participant
0 Likes
1,225

Hi,

When you click on that button, there will be one field in table ctrl ATTRIBUTES to make row as selected( I did not rember that).So loop at TCTRL and make that filed 'X' for each record and modify the table ctrl, then it will work.

Hope this will help you.

Thanks and Regards,

Narendra.Somarouthu

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,225

in the internal table create a field 'SEL'.

Then in table control screen properties set the 'with selection column multiple option' and give this field name 'WA-SEL'.

Now when the icon is clicked.

in pbo.

LOOP WITH CONTROL tab_con.

MODULE fill_tab_con.

ENDLOOP.

module fill_tab_con.

READ TABLE itab into wa INDEX tab_con-CURRENT_LINE

endmodule.

in PAI.

if sy-ucomm = 'ALL'.

loop at itab into wa1.

wa1-sel = 'X'.

modify itab from wa1 transporting sel where sel = space.

endloop.

endif.