Hello Experts,
This is a Proxy-JDBC scenario.
Three tables are getting updated in a single interface .
Header Information
Details Information
Serial Number
As per the requirement for the Serial number table, if any Material has multiple quantity, multiple number of unique serial numbers will be created. To fulfill this requirement the ABAP code is written in such a way that the quantity field is repeated multiple times. And in PI side we are maintaining only one interface to update the three tables : Header, Details and Serial Number.
InvoiceNumber | CustomerCode | MaterialNumber | Quantity | Date |
---|---|---|---|---|
INV100 | XYZ | FFS0-FS1440 | 3 | 19-02-2015 |
INV100 | XYZ | FFS0-FS1440 | 3 | 19-02-2015 |
INV100 | XYZ | FFS0-FS1440 | 3 | 19-02-2015 |
INV111 | XYZ | FFS0-FS1443 | 2 | 19-02-2015 |
INV111 | XYZ | FFS0-FS1443 | 2 | 19-02-2015 |
<INVOICE> ---------------
<InvoiceNo>1130033531</InvoiceNo>
<Date>2011-12-31</Date>
<CustomerNo>DIST63</CustomerNo>
<SONo>15218418</SONo>
<MaterialCode>FFS0-FS1440-35BH</MaterialCode>
<Quantity>3</Quantity>
<GrossPrice>300</GrossPrice>
<SerialNumber>AAF2014111</SerialNumber>
</INVOICE>
<INVOICE>
<InvoiceNo>1130033531</InvoiceNo>
<Date>2011-12-31</Date>
<CustomerNo>DIST63</CustomerNo> Duplicate Records only the serial number is different
<SONo>15218418</SONo>
<MaterialCode>FFS0-FS1440-35BH</MaterialCode>
<Quantity>3</Quantity>
<GrossPrice>300</GrossPrice>
<SerialNumber>AAF2014112</SerialNumber>
</INVOICE>
<INVOICE>
<InvoiceNo>1130033531</InvoiceNo>
<Date>2011-12-31</Date>
<CustomerNo>DIST63</CustomerNo>
<SONo>15218418</SONo>
<MaterialCode>FFS0-FS1440-35BH</MaterialCode>
<Quantity>3</Quantity>
<GrossPrice>300</GrossPrice>
<SerialNumber>AAF2014113</SerialNumber> ----------------------------------------------
</INVOICE>
<INVOICE>
<InvoiceNo>1130033537</InvoiceNo>
<Date>2011-12-31</Date>
<CustomerNo>DIST63</CustomerNo>
<SONo>15218418</SONo>
<MaterialCode>FFS0-FS1440-35BH</MaterialCode>
<Quantity>2</Quantity>
<GrossPrice>300</GrossPrice>
<SerialNumber>ABF2014111</SerialNumber>
</INVOICE>
<INVOICE>
<InvoiceNo>1130033537</InvoiceNo>
<Date>2011-12-31</Date>
<CustomerNo>DIST63</CustomerNo>
<SONo>15218418</SONo>
<MaterialCode>FFS0-FS1440-35BH</MaterialCode>
<Quantity>2</Quantity>
<GrossPrice>300</GrossPrice>
<SerialNumber>ABF2014112</SerialNumber>
</INVOICE>
Due to this reason the Header and Detail tables are getting updated as mentioned below:
It should updated as:
Header Table
pi id | sales org | division | vendor name | Quantity | invoice no | date |
---|---|---|---|---|---|---|
617984 | INDL | EX | SIFY | 3 | 1130033532 | 19-02-2015 |
617985 | INDL | EX | SIFY | 2 | 1130033531 | 19-02-2015 |
Detail Table
det id | invoice no | material code | price | qty |
---|---|---|---|---|
617984 | 1130033532 | FFS0-FS1440 | 300 | 3 |
617985 | 1130033531 | FFS0-FS1443 | 200 | 2 |
Please let me know how to handle with these duplicate records in SAP PI
Regards,
Sayanti