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: 

How to delete a particular record from internal table

Former Member
0 Kudos

Hi,

I have some records in internal table, i want to delete some records from the internal table how to do that?

For example in my internal table i have records with the key KSCHL. i want to del one record from the internal table if the kschl value = zfi4.

How to do this?

Mohana

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Mohana,

It is always not advisable to delete records from an itab,try to have a sepeate flag for deletion indicator and then you can use logic as per this.

regards,

kavitha

7 REPLIES 7

Former Member
0 Kudos

DELETE TABLE ITAB WITH TABLE KEY KSCHL = 'ZF14'.

Message was edited by:

Muthurajan Ramkumar

Former Member
0 Kudos

PARAMETERS p_carrid TYPE scarr-carrid.

DATA scarr_tab TYPE SORTED TABLE OF scarr

WITH UNIQUE KEY carrid.

SELECT *

FROM scarr

INTO TABLE scarr_tab.

DELETE TABLE scarr_tab WITH TABLE KEY carrid = p_carrid.

Former Member
0 Kudos

Hi,

delete itab where keyfield1 = <value>

and keyfield2 = <value2>..

regards,

Omkar.

Former Member
0 Kudos

Hi

Use the below code snippet.

DELETE itab where field1 < '0.010' and field2 < '0.010'.

<b>Reward if useful.</b>

former_member386202
Active Contributor
0 Kudos

Hi,

Do like this

DELETE TABLE ITAB WITH TABLE KEY KSCHL = 'ZF14'. otherwise

Loop at itab.

if itab-kschl = 'ZF14'.

delete itab.

endif.

endloop.

Regards,

Prashant

Former Member
0 Kudos

Hi,

sort the internal table and u can use DELETE ADJACENT DUPLICATES FROM itab.

hope this helps...

regards,

karthik.

Former Member
0 Kudos

Hi Mohana,

It is always not advisable to delete records from an itab,try to have a sepeate flag for deletion indicator and then you can use logic as per this.

regards,

kavitha