on 12-24-2014 4:48 AM
Dear experts,
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'
EXPORTING
INPUT = WA_SOURCEPACKAGE-****R
IMPORTING
OUTPUT = wa_temp-****no.
append wa_temp to it_temp.
clear wa_temp.
endloop.
* 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' '.
* ENDIF.
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 =
WA_SOURCEPACKAGE-LIFNR
AC_DOC_NO =
WA_SOURCEPACKAGE-BELNR
/BIC/ZSERIALNO =
WA_SOURCEPACKAGE-XBLNR
BINARY SEARCH.
IF SY-SUBRC = 0 and wa_bic-/BIC/****** = ''. "Changes
delete from /BIC/AZFIAPO0300 WHERE CREDITOR = wa_bic-creditor
and AC_DOC_NO =
wa_bic-ac_doc_no
and /BIC/ZSERIALNO =
wa_bic-/bic/zserialno
and /BIC/ZDA_REF = ''.
endif.
clear : WA_SOURCEPACKAGE, wa_bic.
endloop.
Hi,
instaed select * form use the specifc fields.
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' '.
use the spefic fields for the required.
IF SOURCE_PACKAGE IS NOT INITIAL.
SELECT x
x
x
x
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' '.
if you use the select * form - it will read the total table fields.
Thanks,
Phani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also if only idea is to delete data from active table then you can include ABAP type in process chain and use a custom program once DSO is loaded. Program will take same conditions and will delete data from active table. Custom program will be called once DSO is activated and it has data loaded.
You are not updating anything in source package only deletion is being done so this is not the right thing that you should do in source package.
Thanks & Regards,
Mahen
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.