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

SELECT ALL & DESELECT ALL in Table Control

Former Member
0 Likes
1,303

Hi All

I would like to know the keyword to be used for coding SELECT ALL and DESELECT ALL functionality in TABLE CONTROL.

And also I would like to know on how to identify within the code the records selected using by clicking on a single row.

Thanks in Advance

Amol

Hi All

I would like to know the keyword to be used for coding SELECT ALL and DESELECT ALL functionality in TABLE CONTROL.

And also I would like to know on how to identify within the code the records selected using by clicking on a single row.

Thanks in Advance

Amol

1 REPLY 1
Read only

Former Member
0 Likes
389

Hi,

SELECTALL / DESELECT ALL

When you create the table control you would have give a variable for column selection.

Selection col. name GV_LINESEL..I am assuming it to be GV_LINESEL.

Have a column called LINSEL in your internal table ITAB for the table control.

PROCESS AFTER INPUT.

LOOP AT ITAB.

MODULE CHECK.

ENDLOOP.

MODULE USER_COMMAND.

  • MODULES CODE.

MODULE CHECK.

ITAB-LINESEL = GV_LINESEL.

MODIFY ITAB INDEX tc_crossover-current_line.

ENDMODULE.

MODULE USER_COMMAND.

CASE SY-UCOMM.

WHEN 'SELECTALL'.

ITAB = 'X'.

MODIFY ITAB TRANSPORTING LINESEL WHERE LINESEL IS INITIAL.

WHEN 'DESELECTALL'.

ITAB = ' '.

MODIFY ITAB TRANSPORTING LINESEL WHERE NOT LINESEL IS INITIAL.

ENDCASE.

ENDMODULE.

PROCESS BEFORE OUTPUT.

LOOP AT ITAB WITH CONTROL TC.

MODULE SET_CHECK.

ENDLOOP.

MODULE SET_CHECK.

GV_LINESEL = ITAB-LINESEL.

ENDMODULE.

Thanks,

Naren