Hello,
It is pending on the version of SAP B1 you are using. In newer versions (9.x, 8.82). and the customized logic such as product subsitutions, product trees, and of course the WH management logic, and etc. Here is a simple logic
You may do the following.
1. Open CRD and use SAP Business One Data connector or OLEBD to connect to MS SQL database
2. You need tables from OPOR, POR1, OITW, OITM (this is not really needed, just for safeness)
You can join OITM to POR1 on OITM.ItemCode = POR1.ItemCode and OITM.ItemCode = OITW.ItemCode
also OITW.ItemCode = POR1.ItemCode and OITW.WhsCode = POR1.WhsCode
and the last POR1.DocEntry = OPOR.DocEntry
So there is and issue: if the product comes more than 1 lines in PO, than you will retreive duplicate rows, so this is not possible.
BTW there is a Bult in ATP check in SAP B1 since 8.81 and it is always getting approved version by version.
Cheers
János