Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL query to link OPOR (a/p purchase order) and ODPO (a/p down payment) in SAP B1

0 Kudos

I can usually tease these out, but I'm having a hard time linking these two tables. What I ultimately need is PO info with the paidtodate from the a/p down payment invoice. I started to just go with Journal Entries, but was still having issues getting back to the PO.

  • SAP Managed Tags:
2 REPLIES 2

0 Kudos

Can anyone help me out , i need a relation between OPOR and ODPO tables, as I want a query in which i can get a/p down payment data related to Purchase order.

Regards

Vinayak

  • SAP Managed Tags:

mgregur
Active Contributor
0 Kudos

Hi,

try this:

SELECT *
FROM OPOR T0
INNER JOIN POR1 T1 ON T0."DocEntry" = T1."DocEntry"
LEFT JOIN DPO1 T2 ON T1."ObjType" = T2."BaseType" AND T1."DocEntry" = T2."BaseEntry" AND T1."LineNum" = T2."BaseLine"
LEFT JOIN ODPO T3 ON T2."DocEntry" = T3."DocEntry"

Of course, change the SELECT part to fit your needs.

BR,

Matija

  • SAP Managed Tags: