Skip to Content

How to link ORDR and OPOR tables of sales order and purchase order in SAP B19.2?.

Hi all,

How to link ORDR and OPOR tables of Sales Order and Purchase Order?

I created purchase order from sales order (drop ship warehouse) so now I want to do the query which will show me DocNum, CardCode of Sales order and its linked Doc Num, CardCode purchase order

How can I do that the query?

Please anyone can help me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 20, 2017 at 04:26 PM

    Hi Rurangwa,

    Try this:

    SELECT 
    	T3.CardCode AS [Sales order CardCode],
    	T3.DocNum AS [Sales order DocNum],
    	T2.ItemCode AS [Item sales order],
    	T2.Quantity AS [Qty sales order],
    	T1.CardCode AS [Purchase order CardCode],
    	T1.DocNum AS [Purchase order DocNum],
    	T0.ItemCode AS [Item purchase order],
    	T0.Quantity AS [Qty purchase order]
    FROM 
    	POR1 T0
    	INNER JOIN OPOR T1 ON T0.DocEntry = T1.DocEntry
    	INNER JOIN RDR1 T2 ON T2.DocEntry = T0.BaseEntry AND T0.BaseType = 17
    	INNER JOIN ORDR T3 ON T3.DocEntry = T2.DocEntry
    

    You can find the reference of sales order in purchase order line looking the field baseEntry, baseType and baseLine.

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 21, 2017 at 05:36 AM

    Hi,

    Try this,

    SELECT T3.CardCode AS [Sales order CardCode], T3.DocNum AS [Sales order DocNum], T2.ItemCode AS [Item sales order], T2.Quantity AS [Qty sales order], T1.CardCode AS [Purchase order CardCode], T1.DocNum AS [Purchase order DocNum], T0.ItemCode AS [Item purchase order], T0.Quantity AS [Qty purchase order] FROM POR1 T0 INNER JOIN OPOR T1 ON T0.DocEntry = T1.DocEntry INNER JOIN RDR1 T2 ON T2.DocEntry = T0.BaseEntry AND T0.BaseType = 17 and T1.Docnum = T2.PoTrgNum INNER JOIN ORDR T3 ON T3.DocEntry = T2.DocEntry

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 03 at 07:29 AM

    Hi,

    Duplicate records for multiple PO.

    Add comment
    10|10000 characters needed characters exceeded