Deleting Duplicate records
we have a requirement of deleting duplicate records based on reference key.it needs to be done between datasource and dso.i already develop the code .when i test it it takes long time can u please suggest what are the changes i need to do.
actually the senario first the key cantains nothing ie sapce now they are updating the space with some other no in ecc so we need to update that field with updated key and delete that record.
TYPES : begin of ty_temp,
serialno type /BIC/OI******NO,
END OF ty_temp.
DATA:IT_BIC TYPE TABLE OF /BIC/AZFIAPO0300,
WA_BIC LIKE LINE OF IT_BIC.
DATA: WA_SOURCEPACKAGE like LINE OF SOURCE_PACKAGE.
DATA : it_temp type STANDARD TABLE OF ty_temp,
wa_temp type ty_temp.
loop at SOURCE_PACKAGE into WA_SOURCEPACKAGE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
INPUT = WA_SOURCEPACKAGE-****R
OUTPUT = wa_temp-****no.
append wa_temp to it_temp.
* IF SOURCE_PACKAGE IS NOT INITIAL.
SELECT * FROM /BIC/*****O0300
INTO TABLE IT_BIC
FOR ALL ENTRIES IN it_temp
where /BIC/****NO = it_temp-*****no.
" Dont have the same type
* WHERE /BIC/ZDA_REF = ' '. "Changes
* AND ZDA_REF = LT_RESULT-XREF1' '.
sort it_bic by CREDITOR AC_DOC_NO /BIC/*****NO.
LOOP AT SOURCE_PACKAGE INTO WA_SOURCEPACKAGE.
READ TABLE it_bic INTO WA_bic WITH KEY CREDITOR =
IF SY-SUBRC = 0 and wa_bic-/BIC/****** = ''. "Changes
delete from /BIC/AZFIAPO0300 WHERE CREDITOR = wa_bic-creditor
and AC_DOC_NO =
and /BIC/ZSERIALNO =
and /BIC/ZDA_REF = ''.
clear : WA_SOURCEPACKAGE, wa_bic.