Thursday, January 11, 2007

OE_ORDER_PUB.PROCESS_ORDER

This API drove me like crazy today. I made the code real simple and straightforward for testing, but guess what, it took me the whole day to figure out what's wrong. Thanks to Metalink, the DBAs and my teammates :)

Here are my errors:
ORA-01403: no data found in Package OE_Order_PVT Procedure Header_Scredits
This salesperson already has order-level sales credit
Validation failed for the field - Salesperson
Header ID does not exist on this record or does not match ID specified on header record. You require a valid header ID if the operation is Create.
Values have not been entered for one or more required segments.


OK, the solution: pretty simple.
1. Call Oe_Msg_Pub.initialize prior to running the API. This fixed all the errors except for the invalid salesperson ID.
2. Run this package from a Concurrent Request to assign the CLIENT_INFO. I was running it from TOAD that's why it's not getting anything from the RA_SALESREPS view.
or
from Metalink:
Note <146898.1>: Process Order API Validation FailuresExtract from Note 2.--------------------------
symptom: Validation failed for the field - Salesperson
symptom: Customer is using a custom stored procedure to call the Process Order API
change: NOTE ROLE: 'Value' can be derived from the Sales Order Window. Go to Help -> Diagnostics -> Examine. Block: $Profiles%, Field: Org_Id. Value = ?
cause: Org_id is a derived valued. When calling the Process Order API from a stored procedure, the system could not derive the org_id.
Fix:
Include the following in your custom stored procedure:fnd_client_info.set_org_context('Value').

Now I can get a good night's sleep :)

3 comments:

sjosyam said...

Hi

i know its been quite some time you put this blog. But I am getting the below error:

Header ID does not exist on this record or does not match ID specified on header record. You require a valid header ID if the operation is Create

I initialized APPS by using the fnd_client_info..... but still the same error. Any inputs would hlep me.

thnaks

Unknown said...

Before Initializing values to line rec

Include below line in the code

lr_line_tbl.DELETE;

Gayathri Ramamurthy said...

thanks this helped a lot