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: 

Table control - select all

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

former_member761936
Active Participant
0 Kudos

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

kesavadas_thekkillath
Active Contributor
0 Kudos

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.