Performance Issue calling OE_ORDER_PUB.PROCESS_ORDER
********
Based on my observation below, I would like to know if the validation for DEFAULT DELIVER_TO_ORG_ID and SOLD_TO can be bypass when creating an RMA, by calling calling OE_ORDER_PUB.PROCESS_ORDER. I may open a TAR with Oracle Support after I dicuss with the APPS team. Let me know if you need more information.
Background
**********
I have some custom code that calls OE_ORDER_PUB.PROCESS_ORDER to create an RMA. This particular Customer has about 2M addresses/sites. I did a trace and found 2 SQL's that are causing the delay. I have named the SQL, SQL-01 and SQL-02. SQL-01 is part of OE_DEFAULT_PVT.GET_PRIMARY_DELIVER_TO. this SP is called by ONT_HEADER_DEF_HDLR.DEFAULT_RECORD. This SP is called only when the OE_ORDER_PUB.HEADER_REC_TYPE.DELIVER_TO_ORG_ID is NULL when calling OE_ORDER_PUB.PROCESS_ORDER The same thing happens to SOLD_TO (SQL-02)