03-15-2007 2:07 PM
hallow
i have internal table with lot of data and i wont to delete row in the table
if i find some value in field.
like that
loop at itab into wa_itab
if wa_itab-field = '5'
delete row
endloop.
<b>delete just the row in my itab that value in some field = 5.</b>how can i do that?
regards
03-15-2007 2:08 PM
Hello antonio,
U can delete like this.
DELETE TABLE ITAB WHERE FIELD = '5'.
REgards,
Vasanht
03-15-2007 2:12 PM
hi Vasanth M
i wont to delete just one row(the row that i fined 5) in my itab not all rows
regards
03-15-2007 2:14 PM
hi
what if there are 3 records with the same filed value say 5??
what would u like to do then??
regards,
madhu
03-15-2007 2:19 PM
hi Madhumitha Vasudevan
no i all the recored is diffrent than 5
regards
03-15-2007 2:09 PM
Hi Antonio,
Use the DELETE statement with WHERE clause.
<b>DELETE ITAB WHERE FIELD = '5'.</b>
It is not recommended to useDELETE statement inside LOOP...ENDLOOP.
Check this link to know about DELETE statement
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/delete_i.htm
Thanks,
Vinay
03-15-2007 2:10 PM
you can try this...
loop at itab into wa_itab
if wa_itab-field = '5'
DELETE wa_itab index sy-tabix.
endif.
endloop.
03-15-2007 2:10 PM
Hi Antonio,
No need to loop internal table itab.
You can use delete statement, please try this.
delete itab where field = '5'.
Regards,
Ferry Lianto
03-15-2007 2:11 PM
03-15-2007 2:11 PM
Hi,
A simple statement will solve your problem.
DELETE TAB_DEST WHERE K = KVAL.
Good Luck and thanks
AK
03-15-2007 2:12 PM
03-15-2007 2:12 PM
03-15-2007 2:22 PM
Hi Antonio,
If you want to delete one row which has value '5' only then do as follows:
loop at itab into wa_itab
if wa_itab-field = '5'.
<b>DELETE ITAB INDEX SY-TABIX.</b>
EXIT.
endif.
endloop.
Plz mark all helpful answers.
Thanks,
Vinay
03-15-2007 2:33 PM
Hi,
Look at this snippet i used this many a times.
loop at it into wt
if wt-fld = '5'
DELETE it index sy-tabix.
endif.
endloop.
Reward helpful answers.
Regards,
Ravi Kumar
03-16-2007 9:57 AM
hi
pai
*******************
LOOP AT it_bill .
FIELD is_bill-mark " this should be in screen attribute w/selcolumn
MODULE delete_entry.
ENDLOOP.
MODULE delete_entry INPUT.
MODIFY it_bill FROM is_bill INDEX tablecontrol1-current_line.
ENDMODULE.
**************************
hope this may help u
regards
shinu
03-16-2007 10:08 AM
Hi ,
For deleting one row from the internal table whose value = 5,
loop at itab into wa_itab
if wa_itab-value = 5.
DELETE ITAB INDEX SY-TABIX.
exit.
endif.
endloop.
This will delete the first matched record and then exit
regards,
Priya.