Skip to Content
0
Former Member
Mar 14, 2016 at 07:42 AM

CR Help - Showed duplicate records in CR

20 Views

Hi,

With the query below, some of the delivery show duplicate records in CR, but in SAP, there is only one records.

It happen on certain delivery, not all of them

For example:

In SAP:

Item | Delivery | Qty

A001 | 12345 | 10

In CR:

Item | Delivery | Qty

A001 | 12345 | 10

A001 | 12345 | 10


Query:


SELECT

T0.[DocDate],

T0.[DocNum],

T0.[CardName],

T0.[CardCode],

T1.[ItemCode],

T1.[Quantity],

T1.[Currency],

T1.[PriceBefDi],

T1.[LineTotal],

T1.[TotalFrgn],

T1.[StockPrice],

T2.[AvgPrice],

T3.[ItmsGrpNam],

T2.[U_PROD_GROUP],

T4.[Number],

T0.[DocRate],

T6.[DocNum],

T5.[BaseType]

FROM ODLN T0

INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry

LEFT JOIN OITM T2 ON T1.ItemCode = T2.ItemCode

LEFT JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod

LEFT JOIN OJDT T4 ON T0.TransId = T4.TransId

JOIN INV1 T5 ON T1.TrgetEntry = T5.DocEntry and T1.linenum=T5.baseline and T1.TargetType=T5.ObjType

JOIN OINV T6 ON T5.DocEntry = T6.DocEntry

Thanks