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 record from internal table

Former Member
0 Kudos
296

hi,

i want to delete record from internal table compring the 2nd field.

for example:

x 5

y 5

then the second record should be deleted . the comparision should be on the basis of 2nd field.

regards

nilabichi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
242

Hi..

your requirment is not clear please provide more detail

watever i understood from question on that basis u shd.

sort the table and then loop it...

regards

vivek

7 REPLIES 7
Read only

Former Member
0 Kudos
243

Hi..

your requirment is not clear please provide more detail

watever i understood from question on that basis u shd.

sort the table and then loop it...

regards

vivek

Read only

Former Member
0 Kudos
242

hii

delete itab-y where y = 5.

thanks

Read only

Former Member
0 Kudos
242

Try this out

DELETE itab WHERE 2ndfield = ' value ' .

Regards,

Linda

Read only

former_member206439
Contributor
0 Kudos
242

Hi

sort itab.

delete adjacent duplecates comparing (that second filed)

try this one

Read only

Former Member
0 Kudos
242

Hi,

Use

DELETE ADJACENT DUPLICATES FROM itab comparing field2.

Regrads,

Dhan

Read only

Subhankar
Active Contributor
0 Kudos
242

Hi

please see this example..

DATA: i_mara TYPE STANDARD TABLE OF mara INITIAL SIZE 0,

wa_mara TYPE mara.

SELECT *

UP TO 10 ROWS

FROM mara

INto TABLE i_mara.

READ TABLE i_mara INTO wa_mara INDEX 2.

if wa_mara-ERSDA <> 'ABC'.

delete i_mara index 2 .

endif.

LOOP at i_mara INTO wa_mara.

WRITE: / wa_mara-matnr.

ENDLOOP.

Read only

Former Member
0 Kudos
242

HI



data:
  w_temp1 like itab-f2,
  w_temp2 like itab-f2.

loop at itab.
 w_temp1 = itab-f2.
   if w_temp1 eq w_temp2.
      delete itab.
   endif.
 w_temp2 = w_temp1.
endloop

Regards,

Sunil Kumar M