‎2006 May 09 9:27 AM
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.
‎2006 May 09 9:32 AM
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
‎2006 May 09 9:32 AM
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
‎2006 May 09 9:44 AM
‎2006 May 09 9:45 AM
‎2006 May 09 9:55 AM
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
‎2006 May 09 10:00 AM
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.