You are on page 1of 9

ORACLE EDI GATEWAY (R10.

7, R11) E-COMMERCE GATEWAY (R11I)


Support Document Outbound Transactions: Print and EDI Extract
Creation Date: December 13, 1999 Updated: Oct. 24, 2000

Implementation of this custom solution is not supported by Oracle Support. This document was written as a guideline to assist you in expediting a custom solution.

05/02/2002 2:30 PM

Page 1

Contents
Overview Document Purpose Reference Document Documentation Changes Parallel Printing and EDI Transaction Resetting Print/EDI Flags Invoice (INO) Sample Code Purchase Order (POO) and PO Change (POCO) Sample Code 3 3 3 3 4 5 5 6

05/02/2002 2:30 PM

Page 2

Overview
Document Purpose
Several Oracle transactions do not allow both the printing and creation of the outbound EDI transaction. You need a work around until the base product can provide that. There are plans to enhance the Oracle application to allow you to do both. Until that is available (date not determined), this document may assist you as a work around The purpose of this document is to provide a guideline on the custom code you need to do the following: . Process the EDI transaction through the EDI Gateway or e-Commerce Gateway, AND Print the same document from the base application.

Reference Document
Reference the Oracle R11i Oracle e-Commerce Gateway Implementation Manual for a list of data elements that are updated in the transactions in the base application tables when an EDI transaction is extracted. These are the fields that need to be reset by the process described below. Confirm that these are the same fields in R10.7 and R11. They may have changed. Confirm in the base application manuals whether their procedures allow both the EDI transaction and the printing of the document.

Documentation Changes
The sample code in this document may not be exact. The table names and columns may have changed across releases. The sample code may need adjustments. We would like to have sample code for each transaction for each release until the standard product can provide this feature. Please send your recommendation for improving this document and sample code to Bonnie.Williams@Oracle.com.

05/02/2002 2:30 PM

Page 3

Parallel Printing and EDI Transaction, Method 1

The following procedure will work for the following transactions that do not allow both printing of the document and the EDI transaction extraction: Outbound Invoice (INO) Outbound Purchase Order (POO) Outbound Purchase Order Change (POCO) Others to be determined

These steps can be followed: 1. 2. 3. Run the Oracle EDI Gateway process first to extract transactions Reset the print flag in the base application (custom code) given the transactions just extracted Run the print document request.

1. Run the Oracle EDI Gateway process first Running the EDI Gateway process first will assure that the interface file for the EDI transactions is created. This process will update key data elements in the base Application tables. This file will provide the list of document/transactions extracted by the first process. Because the EDI Gateway and the base application share the same flags and indicators in the base application tables to prevent duplicate processing, the flags must be reset for the second process to be successful.. 2. Reset the print flag in the base application (Custom Code) Custom code is needed to read through control (0010) records to identify which transactions were extracted. These transactions are found in the file just created by the EDI Gateway. Given the transaction identifier (for example, purchase order number), read the base Oracle application to reset the appropriate flags and codes that prevented the transaction from being processed again. 3. Run the print document request. Run the base Oracle applications regular process to produce paper documents.

05/02/2002 2:30 PM

Page 4

Resetting Print/EDI Flags


Invoice (INO) Sample Code
undefine 1 update ra_customer_trx set printing_pending = 'Y', edi_processed_flag = 'N', edi_processed_status = NULL where trx_number = '&1'; This sample accepts a starting and ending date range as well as a customer ID and shows how many invoices would be reset by the operation. I reset several other values, in particular the LAST_PRINTED_SEQUENCE_NUM, that in my experience HAD to be decremented. The INO is the only one I ever had to reset. set serveroutput on size 10000 DECLARE START_TRX_DATE DATE; END_TRX_DATE DATE; CUSTOMER_TO_RESET NUMBER; INVOICE_COUNT number; BEGIN START_TRX_DATE := '&1'; END_TRX_DATE := '&2'; CUSTOMER_TO_RESET := '&3'; begin SELECT COUNT(*) INTO INVOICE_COUNT FROM ra_customer_trx WHERE trx_date between START_TRX_DATE AND END_TRX_DATE and SOLD_TO_CUSTOMER_ID = CUSTOMER_TO_RESET; EXCEPTION when OTHERS THEN invoice_count := 0; end; DBMS_OUTPUT.PUT_LINE('Invoice count: '||TO_CHAR(INVOICE_COUNT)); update ra_customer_trx set printing_pending = 'Y', printing_count = NULL, printing_last_printed = NULL, printing_original_date = NULL, EDI_processed_flag = 'N', EDI_processed_status = NULL, LAST_PRINTED_SEQUENCE_NUM = DECODE((LAST_PRINTED_SEQUENCE_NUM-1), -1, 0,(LAST_PRINTED_SEQUENCE_NUM-1)) WHERE trx_date between START_TRX_DATE AND END_TRX_DATE and SOLD_TO_CUSTOMER_ID = CUSTOMER_TO_RESET; COMMIT; END; /

05/02/2002 2:30 PM

Page 5

Purchase Order (POO) and PO Change (POCO) Sample Code

NOTE: PO outbound and PO Change Outbound update the same fields on the po_headers table and the po_headers_archive table (printed_date, print_count, edi_processed_flag). The difference is that the POCO SQL sets the edi_processed_flag in the po_headers table to Y. In other words: if the edi_processed_flag is Y the POCO process extracts the order else the POO process extracts the order __________________________________________________________________________________________ REM The following script will reenable a Standard or REM Blanket PO for extraction by the POO transaction. UPDATE po_headers SET printed_date = NULL, print_count = 0, edi_processed_flag = NULL WHERE segment1 = &PO_NUMBER; COMMIT; UPDATE po_headers_archive SET printed_date = NULL, print_count = 0, edi_processed_flag = NULL WHERE segment1 = &PO_NUMBER AND latest_external_flag = 'Y'; COMMIT; --------------------------------------------------------------------------------------update apps.po_headers_all set print_count = 0, printed_date = NULL, edi_processed_flag = NULL where apps.po_headers_all.segment1 = (select a.po_num from temp_head1 a where a.doc_type = apps.po_headers_all.type_lookup_code and a.po_num = apps.po_headers_all.segment1 ) ; update apps.po_headers_archive_all set print_count = 0, printed_date = NULL, edi_processed_flag = NULL where apps.po_headers_archive_all.segment1 = (select a.po_num from temp_head1 a where a.doc_type = apps.po_headers_archive_all.type_lookup_code and a.po_num = apps.po_headers_archive_all.segment1 ) and apps.po_headers_archive_all.latest_external_flag = 'Y' /

05/02/2002 2:30 PM

Page 6

update apps.po_releases_all set print_count = 0, printed_date = NULL, edi_processed_flag = NULL where apps.po_releases_all.po_header_id = (select b.po_header_id from temp_rel1 a, apps.po_headers_all b where b.po_header_id = apps.po_releases_all.po_header_id and b.type_lookup_code = a.doc_type and b.segment1 = a.po_num and a.rel_num = apps.po_releases_all.release_num) ; update apps.po_releases_archive_all set print_count = 0, printed_date = NULL, edi_processed_flag = NULL where apps.po_releases_archive_all.po_header_id = (select b.po_header_id from temp_rel1 a, apps.po_headers_all b where b.po_header_id = apps.po_releases_archive_all.po_header_id and b.type_lookup_code = a.doc_type and b.segment1 = a.po_num and a.rel_num = apps.po_releases_archive_all.release_num) and apps.po_releases_archive_all.latest_external_flag = 'Y' /

05/02/2002 2:30 PM

Page 7

Parallel Printing and EDI Transaction, Method 2


This is an alternative manual procedure that may be viable for some organizations. A company used this for invoices. You may try it for other transactions. INVOICES: The solution requires the user to connect to the Application using the EDI Gateway responsibility. Once connected follow the following navigation path. Navigation --> Trading Partner --> Query the Trading Partner --> Open the Trading Partner --> Select the Detail Alternate region --> Disable the Invoice Outbound reference by click on the Enable box; Save the transaction. Once this is done the regular invoice process will print the document. Upon completion, the customer MUST then reinstate the INO process using the above navigation.

You MUST REINSTATE the Trading Partner for the outbound invoice in the Gateway again; otherwise, the EDI invoices will not be extracted when the Concurrent Manager Request is run again.

05/02/2002 2:30 PM

Page 8

Oracle EDI Gateway, Oracle e-Commerce Gateway October 2000 Author: Bonnie Shebat Williams Contributing Authors: Geoff Scott-Baker, Oracle UK Stephen Douglas Nelson Copyright Oracle Corporation 2000 All Rights Reserved Printed in the U.S.A. This document is provided for informational purposes only and the information herein is subject to change without notice. Please report any errors herein to Oracle Corporation. Oracle Corporation does not provide any warranties covering and specifically disclaims any liability in connection with this document. Oracle is a registered trademark and Enabling the Information Age, Oracle, Oracle EDI Gateway, Oracle e-Commerce Gateway are trademarks of Oracle Corporation.

Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: 650.506.7000 Fax 650.506.7200 Copyright Oracle Corporation 2000 All Rights Reserved

05/02/2002 2:30 PM

Page 9

You might also like