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 entries from custom table....

Former Member
0 Kudos

Hello all,

I have 3 Customized Ze tables Z1,Z2 and Z3.All the 3 tables has very large volume of data.In terms of Gb (~10^10 entries).

Z1,Z2 and Z3 tables has primary key as doc_num.

I need to compare doc_num from Z1 table with ERDK table opbel.If the entry is not present in ERDK then I need to delete from Z1,Z2 and Z3 tables.

Please suggest how to approach this.As the volume of the data in tables is extremely high I need to take care of performance also.Please suggest

thanks in advance

2 REPLIES 2

Former Member
0 Kudos

select doc_num from Z1 into table itab.

if sy-subrc = 0.

sort itab by doc_num.

delete adjacent duplicates from itab comparing doc_num.

endif.

select opbel from ERDK into table itab2.

if sy-subrc = 0.

sort itab2 by opbel.

delete adjacent duplicates from itab2 comparing opbel.

endif.

loop at itab.

read table itab2 with key opbel = itab-doc_num binary search.

if sy-subrc <> 0.

itab3-doc_num = itab-doc_num.

append itab3.

clear itab3.

endif.

endloop.

if not itab3[] is initial.

loop at itab3.

delete Z1 where doc_num = itab3-doc_num.

delete Z2 where doc_num = itab3-doc_num.

delete Z3 where doc_num = itab3-doc_num.

endloop.

endif.

Regards

Vasu

Former Member
0 Kudos

Hi,

Try this,

DATA: itab1 type standard table of z1,

BEGIN of itab2 OCCURS 0,

doc type opbel,

end of itab2.

select docnum from ERDK

into table itab2.

check itab2[] is not initial.

select * from Z1

into table itab1

for all entries in itab2

where doc_num NE itab2-doc.

if sy-subrc is initial.

DELETE z1 FROM TABLE itab1.

endif.

NOTE: I have coded only for Z1. You can repeat the same for Z2 and Z3 if you find it satisfactory.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jan 22, 2008 12:05 PM