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

internal table process

Former Member
0 Likes
891

Hi Experts,

Please give me the logic for the given below scenario

I-Table

A B

1 a

1 b

1 c

2 d

3 a

3 e

3 f

4 g

4 g

In the above itab , itab have lot of records (1000000). i want to display what are all having multiple values only in column A.i want to delete single records (like 2 d(4th row)this row will be delete ) if column A and column B having same value i want to delete that rows.

Thanks & Regards,

Rajan

Message was edited by:

raja rajan

8 REPLIES 8
Read only

Former Member
0 Likes
866

hi Raja,

use ...

delete table <internal table> where sno = ...

Regards,

Jayant

Read only

suresh_datti
Active Contributor
0 Likes
866

sort itab by Sno.

delete itab index 4.

delete itab index 8.

delete itab index 9.

~Suresh

Read only

Former Member
0 Likes
866

Hi Raja,

Looks to be a pretty strange one.

In the records 4,8 & 9 the key is the no. field of value 2. They are all multiples of 2.

4th record - 2

8th record - 4

9th record - 4

so you can delete based on this logic, multiples of 2.

Tushar

Read only

Former Member
0 Likes
866

Hi Raja....

if you are taking about the particular tab then you can hard code the value for

sy-tabix...

delete <internal table name> where sy-tabix = '<hard code the tab>'.

in this case no matter what the record is ..always that particular row will be deleted...

Regards,

Jayant

Read only

Former Member
0 Likes
866

hi,

delete itab where sno = '4' and sno = '8' and sno =' 9'.

Read only

Former Member
0 Likes
866

Hi Raja,

Refer this code :

loop at itab.

delete itab where sy-tabix = 4.

delete itab where sy-tabix = 8.

delete itab where sy-tabix = 9.

endloop.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
866

Hi,

If you want to directly delete the records corresponding Sr no

delete itab where num eq 4 or num eq 8 or num eq 9.

Thanks

Sandeep

Read only

Former Member
0 Likes
866

hi try this.

loop at itab.

do sy-tfill times.

if itab-a = itab-b.

delete itab index sy-tabix.

endif.

enddo.

endloop.

  • the above deletes the fiels of equal values.

take 2 fields m and n.

m = 1.

loop at itab.

do sy-tfill times.

if m <> itab-a.

m = itab-a.

skip.

read table itab index sy-index.

if itab-a <> m.

delete itab index sy-index.

endif.

endif.

enddo.

endloop.

  • this should remove the single values.

check it n let me kno if this works.

regards,

ramesh.