cancel
Showing results for 
Search instead for 
Did you mean: 

Relationship between ORCT and OINV

Former Member
0 Kudos
9,950

Dear Experts,

I need to create a report of history transaction, and need to get :

-INVOICE / DP NO

-AMOUNT INVOICE / DP

-INCOMING PAYMENT NO

-AMOUNT INCOMING PAYMENT PER INVOICE / DP

Does anyone can help the relationship table between ORCT and OINV/ODPI?

Thank you,

-Flo

View Entire Topic
anrodse
Participant
0 Kudos

Correct answer is:

SELECT
FROM
   OINV T0
   LEFT JOIN RCT2 TC1 ON T0."DocEntry" = TC1."baseAbs" AND TC1."InvType" = 13
   LEFT JOIN ORCT TC0 ON TC0."DocEntry" = TC1."DocNum"
WHERE T0."Canceled"='N' AND TC0."Canceled"='N'

Yo need to tell the base document type for payment. 13 for invoices.

henry_le
Discoverer
0 Kudos
Hi, I think matching TC0."DocNum" = TC1."DocNum" would be better because sometimes DocNum and DocEntry of a single record are different