2008 Jan 22 2:53 PM
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
2008 Jan 22 3:06 PM
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
2008 Jan 22 3:11 PM
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