Use function module ATP_CALCULATE_MDPS. It's interface asks you to provide material information, MRP info and plant and calculates and provide you all kind of info you get it from CO09.
It internally calls FM ATP_CHECK_BASIS which calls forms BUILD_ATP_STACK_05 and that calls form PICK_OFF_ATP_03. This is same form you see when you debug CO09. I hope it helps.