Skip to Content
author's profile photo Former Member
Former Member

query problem - PO linked to PO ?



The PO is used for products purchase but also separately for transport services (there are transport items for send and delivery transport services).

So in reality the transport PO is linked to SO and also situations are that product PO is linked to transport PO's.

Everything is fine when the PO linked to SO but I'm having a problem with showing data when PO is linked to PO..

I've made a query that runs fine for SO vs PO but II'm stuck with how to show results PO vs PO:

SELECT T0.[CreateDate] AS 'data utw.ZZ', T0.[CardCode], T1.[ItemCode], T0.[DocNum] AS 'Nr.ZZ', 
T1.[Price], T2.[DocNum] as 'Nr.ZS', T2.[U_U_p4] as 'MSC. ZALAD.', T2.[U_U_p5]  AS 'MSC.ROZL.', 
FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN ORDR T2 ON T2.U_z1 = T0.Docnum 
WHERE T1.[ItemCode] Like '04.TRAN.%' AND T0.[CreateDate] >=[%0] AND T0.[CreateDate] <=[%1] 
AND T0.[CardCode]=[%2] 
ORDER BY T0.[CreateDate], T0.[DocNum]

The transport items in PO are: 04.TRAN.WYS% for sending products with SO or 04.TRAN.DOS% is for receiving products with PO.

Any help would be appreciated.

Thank you,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jan 13, 2012 at 11:11 AM


    There is no link field as such for PO vs PO.

    How have you linked the Item PO to Transport PO. Any specific field which is common in both the PO? If it is a UDF field and is common, then you can use the subquery to find out such PO's.

    Kind Regards,


    SAP Business One Forum Team

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      In the given example query is for SO (products) with PO (trans) do answering your question PO is T0.

      The first goal would be to hava a query to show PO (products) with PO (trans).

      The second goal would be to have a query to show PO and SO (products witn PO (trans).

      Any help would be appreciated.

      Thank you,


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.