Sei sulla pagina 1di 2

Subject: OEOIMP: Script To Populate Order Import Interface Tables From Existing Sales Order Doc ID: Note:436215.

1 Type: SAMPLE CODE Last Revision Date: 05-JUL-2007 Status: PUBLISHED In this Document Purpose Software Requirements/Prerequisites Configuring the Sample Code Running the Sample Code Caution Sample Code Sample Code Output References

--------------------------------------------------------------------------------

Applies to: Oracle Order Management - Version: 11.5.10 Information in this document applies to any platform. OEOIMP, Order Import Interface Purpose This script may be used to populate the Order Import interface tables using data from an existing sales order. This is useful for users who are not familiar wit h how to populate the interface tables for different import scenarios (like ATO models, discounts etc), or in cases where the order import fails but a similar o rder can be created via the Sales Order form. The script will use the existing s ales order data in the base tables (oe_order_headers_all, oe_order_lines_all, oe _price_adjustments, oe_payments, oe_sales_credits, oe_lot_serial_numbers) to pop ulate the interface tables, effectively creating a mirror image of the existing sales order. The interface tables populated are: oe_headers_iface_all, oe_lines_iface_all, oe_price_adjs_iface_all, oe_payments_i nterface, oe_credits_iface_all, oe_lotserials_iface_all Software Requirements/Prerequisites The script is intended to be run from SQL*Plus. The script executes the public API OE_Inf_Populate_Pub.Populate_Interface. There fore the SQL*Plus user must have privileges to execute this object. Usually the APPS user has this privilege. Configuring the Sample Code The sample code below should be copied and pasted into a file named "run_inf.sql ". This script should be executed from SQL*Plus as the APPS user. Login to SQL*Plus as APPS/<pwd> SQL> @run_inf.sql Running the Sample Code Input: Sales Order Number, Order Source ID Output: A debug file is generated in the OM Debug Log Directory 1. The script sets the orig_sys_document_ref to the value of the order number pr ovided. This means that you cannot run the script twice for the same sales order number since the 'orig_sys_document_ref + order source' combination must be uni que.

2. The script prompts for order_source_id but does not use it when querying the existing sales orders. It only uses the order number. This means that if multipl e matches are found for the order number (in different org_ids) they will all be inserted into the interface tables with the same orig_sys_document_ref. 3. The interface table is populated with the same order_source_id provided, thus if you desire the imported orders to use a different order source, the value fo r order_source_id should be updated in the interface table prior to running the import. 4. After the script completes, please issue an explicit commit to save the data. Then submit the Order Import program to pull the data into OM. Caution This sample code is provided for educational purposes only and not supported by Oracle Support Services. It has been tested internally, however, and works as do cumented. We do not guarantee that it will work for you, so be sure to test it i n your environment before relying on it. Proofread this sample code before using it! Due to the differences in the way te xt editors, e-mail packages and operating systems handle text formatting (spaces , tabs and carriage returns), this sample code may not be in an executable state when you first receive it. Check over the sample code to ensure that errors of this type are corrected. Sample Code declare l_return_status varchar2(1); l_order_number_from number; l_order_source_id number; begin apps.oe_debug_pub.debug_on; apps.oe_debug_pub.initialize; apps.oe_debug_pub.add('Before oe_inf_populate_pub call',1); apps.oe_inf_populate_pub.populate_interface( p_api_version_number => 1.0 , x_return_status => l_return_status , p_order_number_from => &order_number_from, p_order_source_id => &order_source_id ); apps.oe_debug_pub.add('Before oe_inf_populate_pub call',1); commit; end; / Sample Code Output Upon completion, the script will write data to the Order Import interface tables . This data may be viewed through the Order Import Corrections form: OM responsibility > Orders, Returns > Order Import > Corrections Enter the order number used when executing the script as the Order Reference and the Order Source, then query. This script generates a debug file in the directory pointed to by the profile op tion "OM: Debug Log Directory". References Bug 6009894 - VIEW ADJUSTMENT IS NOT SHOWING THE PBH MODIIER APPLIED

Potrebbero piacerti anche