Quantcast
Channel: SCN : All Content - SAP Business Warehouse
Viewing all articles
Browse latest Browse all 5981

How to skip duplicate records in End Routine

$
0
0

Hi All,

 

I have written End routine in Transformation to lookup and  get "DOC_NUMBER" and "NETVAL_INV"  from /BIC/AZOFIBIS00 while loading data from DSO1  to DSO2. The number of records in "DSO1" say for example 14 records and no of records in "BIC/AZOFIBIS00" in 4 records .

 

"BILL_NUMBER" in <RESULT_FIELDS> have duplicate records , because of that KF "NETVAL_INV"  entered  multiple times  in DSO2 .How to skip duplicate records  while doing  lookup.


Please see code.

 

DATA : ITAB TYPE STANDARD TABLE OF /BIC/AZOFIBIS00.

DATA : WA_ITAB TYPE  /BIC/AZOFIBIS00.

 

LOOP AT RESULT_PACKAGE  ASSIGNING <RESULT_FIELDS>.

 

 

SELECT * FROM /BIC/AZOFIBIS00 INTO TABLE ITAB

WHERE /BIC/ZSITSSTNO = <RESULT_FIELDS>-/BIC/ZSITSSTNO

and

DOC_type = <RESULT_FIELDS>-doc_type and

DOC_NUMBER = <RESULT_FIELDS>-BILL_NUM.

 

 

READ TABLE ITAB INTO WA_ITAB WITH KEY

/BIC/ZSITSSTNO = <RESULT_FIELDS>-/BIC/ZSITSSTNO.

 

 

       IF SY-SUBRC = 0.

       MOVE WA_ITAB-BILL_NUM TO <RESULT_FIELDS>-DOC_NUMBER.

       MOVE WA_ITAB-NETVAL_INV TO <RESULT_FIELDS>-NETVAL_INV.

       ENDIF.

ENDLOOP.

 

 

Thanks

Hari


Viewing all articles
Browse latest Browse all 5981

Trending Articles