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: 

delete row in titab

Former Member
0 Kudos

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

15 REPLIES 15

Former Member
0 Kudos

Hello antonio,

U can delete like this.

DELETE TABLE ITAB WHERE FIELD = '5'.

REgards,

Vasanht

0 Kudos

hi Vasanth M

i wont to delete just one row(the row that i fined 5) in my itab not all rows

regards

0 Kudos

hi

what if there are 3 records with the same filed value say 5??

what would u like to do then??

regards,

madhu

0 Kudos

hi Madhumitha Vasudevan

no i all the recored is diffrent than 5

regards

Former Member
0 Kudos

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

former_member187255
Active Contributor
0 Kudos

you can try this...

loop at itab into wa_itab

if wa_itab-field = '5'

DELETE wa_itab index sy-tabix.

endif.

endloop.

ferry_lianto
Active Contributor
0 Kudos

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

former_member533584
Contributor
0 Kudos

hai

DELETE TABLE ITAB WHERE FIELD = '5'.

regards

ananth.

ashok_kumar24
Contributor
0 Kudos

Hi,

A simple statement will solve your problem.

DELETE TAB_DEST WHERE K = KVAL.

Good Luck and thanks

AK

Former Member
0 Kudos

hi

DELETE itab WHERE field = '5'.

regards,

madhu.

Former Member
0 Kudos

Hi,

Delete itab where field = '5'.

Regards,

Sruthi

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.