Hi,
Try this:
ELECT T0.[DocNum], T1.[ItemCode], T3.[IntrSerial] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry left join SRI1 T2 on T2.[BaseNum] = T0.[DocNum] and T2.[BaseType] = T0.[ObjType] and T2.[BaseLinNum] = T1.[LineNum] inner JOIN OSRI T3 ON T2.SysSerial = T3.SysSerial and T2.[ItemCode] = T3.[ItemCode] WHERE T1.[TargetType] not in ('14') GROUP BY T0.[DocNum], T1.[ItemCode], T3.[IntrSerial]
Thanks & Regards,
Nagarajan