Skip to Content
0

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

Jan 20, 2017 at 12:42 PM

627

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
DIEGO LOTHER Jan 20, 2017 at 04:26 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K Jan 21, 2017 at 05:36 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you all.

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

Hi,

Duplicate records for multiple PO.

Share
10 |10000 characters needed characters left characters exceeded