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

delete table control row

Former Member
0 Likes
560

hello experts,

i need help in table control because im having problem when im trying to delete the selected rows of the said table control. when i select all the rows of the control and then press the delete button that i created, the entire row are not deleted. some rows still remain. can you give me sample code and technique in dealing with Table Control.

Thanks in advance.

below is the code that im using:

PROCESS BEFORE OUTPUT.

LOOP AT i_rec INTO wa_rec WITH CONTROL

tc_itm CURSOR tc_itm-current_line.

ENDLOOP.

PROCESS AFTER INPUT.

LOOP AT i_rec.

module modify_itab_0200.

ENDLOOP.

MODULE modify_itab_0200 INPUT.

CHECK wa_rec-sel EQ 'X'.

DELETE i_rec

WHERE ean11 = wa_rec-ean11

AND ebeln = wa_rec-ebeln

AND abeln = wa_rec-abeln

AND filnr = wa_rec-filnr.

ENDMODULE.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
498

Sample program for Table Control

http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm

http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_highlight.htm

Hope this helps u.

Also refer this program <b>RSDEMO02</b> for deletion

U can specify like this

PROCESS AFTER INPUT.
LOOP AT i_rec .
module modify_itab_0200.
ENDLOOP.

MODULE modify_itab_0200 INPUT.
CHECK wa_rec-sel EQ 'X'.
<b> DELETE i_rec.</b>
ENDMODULE.

Message was edited by: Judith Jessie Selvi

5 REPLIES 5
Read only

Former Member
0 Likes
499

Sample program for Table Control

http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_basic.htm

http://www.sapdevelopment.co.uk/dialog/tabcontrol/tc_highlight.htm

Hope this helps u.

Also refer this program <b>RSDEMO02</b> for deletion

U can specify like this

PROCESS AFTER INPUT.
LOOP AT i_rec .
module modify_itab_0200.
ENDLOOP.

MODULE modify_itab_0200 INPUT.
CHECK wa_rec-sel EQ 'X'.
<b> DELETE i_rec.</b>
ENDMODULE.

Message was edited by: Judith Jessie Selvi

Read only

0 Likes
498

Check this out

For Inserting a Row

For Deletion of a Row

Read only

Former Member
0 Likes
498

Hi,

did you check the Program <b>RSDEMO02</b>.

Regards

vijay

Read only

Former Member
0 Likes
498

In ur code, u can delete the table rows in the loop..endloop or u can write the code after the loop..endloop.

This is better u write the delte code after loop..endloop because, when u select the rows and press the delete button the rows were deleted. Suppose u have a button named 'SELECT ALL'. Then the rows will not be deleted. Because u will carry the business logic after the loop.

So, its better u write is as

PROCESS AFTER INPUT.

LOOP AT i_rec.

module modify_itab_0200.

ENDLOOP.

module Chng_itab_0200.

module modify_itab_200.

move-corresponding wa_rec to i_rec.

modify i_rec index i_rec-current_line.

if sy-subrc ne 0.

append i_rec.

endif.

endmodule.

module Chng_itab_0200.

*code for deletion

loop at i_rec where sel = 'X'.

delete i_rec.

endloop.

endmodule

if helpful reward points

Read only

Former Member
0 Likes
498

hi jesus,

try this...

CASE sy-ucomm.

WHEN 'DELE'.

DELETE itab where chk eq 'X'.

DESCRIBE TABLE itab LINES tc1-lines.

........

under pai give

module modify.

in se38.

MODULE modify INPUT.

IF v_check = 'X'.

itab-chk = 'X'.

MODIFY itabindex tc1-current_line.

ELSE.

CLEAR itab-chk .

ENDIF.

ENDMODULE. " modify INPUT

hope this helps,

priya.