Skip to Content
0
Jan 13, 2023 at 05:22 AM

join the query of AR Invoice to AR credit memo with Incoming payment SAP Business One HANA

148 Views

Hi all,

In below query , If I can use the ORCT , RCT2 table with OINV then query data is not come properly.

I need to join the query of AR Invoice to AR credit memo with Incoming payment.

SELECT T0."DocNum" AS "Invoice Number", T2."DocNum" AS "Credit Memo Number" ,

T9."DocDate"

FROM OINV T0

INNER JOIN INV1 T1 ON T1."DocEntry" = T0."DocEntry"

INNER JOIN ORIN t2 ON t2."ObjType" = T1."TargetType"

INNER JOIN RIN1 t3 ON T3."DocEntry" = T2."DocEntry" AND T3."BaseEntry" = T0."DocEntry"

LEFT join RCT2 T8 ON T8."DocEntry" = T0."DocEntry"

INNER JOIN ORCT T9 ON T9."DocNum" = T8."DocNum"

GROUP BY T0."DocNum", T2."DocNum"

ORDER BY T0."DocNum";

SAP Business One HANA

Regards,

Nikunj