ATP database tables

Hello,

On my customization I’m getting the available quantity (ATPQty) for a PartNum by using the ATP dll.
I need to allocate PO numbers to an OrderRel based on what is returned from ATP, but I have no idea about where the data comes from.

I know the ATP is calculated based on POs, Orders, etc… but I don’t know where to see the query, how the tables are joning and more important, how to get the PO numbers from that data.

This is the code that I´m using for getting the ATP Qty:

Erp.Adapters.ATPAdapter adATP = new Erp.Adapters.ATPAdapter(this.oTrans);
adATP.BOConnect();
adATP.OnChangePlant(partNum, Plant);
Erp.BO.ATPDataSet ds = adATP.ATPData;