Upload
ashwin-kumar
View
147
Download
1
Tags:
Embed Size (px)
Citation preview
Conversion/Interface Strategy:
Data Mapping
During the data mapping process, list of all the data sets and data elements that will need to be moved into the Oracle tables as part of conversion are identified. Data mapping tables are prepared as part of this activity that show what are the data elements that are needed by the target system to meet the business requirements and from where they will be extracted in the old system.
Download Programs
After the conversion data mapping is complete, download programs are developed that are used to extract the identified conversion data elements from the current systems in the form of an ASCII flat file. The structure of the flat file must match the structure of the Oracle standard interface tables. These flat files generated may be in text form or a comma or space delimited, variable or fixed format data file.
Upload Program
Once the data has been extracted to a flat file, it is then moved to the target file system and the data from the file is loaded into user defined staging tables in the target database using SQL Loader or UTL_FILE utilities. Then programs are written and run which validate the data in the staging tables and insert the same into the Oracle provided standard Interface tables.
Interface Program
Once the interface tables are populated, the respective interface program (each data element interface has a specific interface program to run) is submitted. The interface programs validate the data, derive and assign the default values and ultimately populate the production base tables.
Interface/Conversion examples and details:
The below list of interfaces/conversions are covered in this section. Details like pre-requisites required, interface tables, interface program, base tables, validations that need to be performed after inserting the details into the interface tables and required columns that need to be populated in the interface table are discussed for each interface.
Order Import Interface (Sales Order Conversion)
Item import (Item conversion)
Inventory On-hand quantity Interface
Customer conversion
Auto Invoice Interface
AR Receipts
Lockbox Interface
AP Invoices
Vendor
Purchase Orders
Requisition
Receiving
Journal import
Budget import
Daily Conversion Rates
Order Import Interface (Sales Order Conversion)
Order Import enables you to import Sales Orders into Oracle Applications instead of manually entering them.
Pre-requisites:
Order Type
Line Type
Items
Customers
Ship Method/ Freight Carrier
Sales Person
Sales Territories
Customer Order Holds
Sub Inventory/ Locations
On hand Quantity
Interface tables:
OE_HEADERS_IFACE_ALL
OE_LINES_IFACE_ALL
OE_ACTIONS_IFACE_ALL
OE_ORDER_CUST_IFACE_ALL
OE_PRICE_ADJS_IFACE_ALL
OE_PRICE_ATTS_IFACE_ALL
Base tables:
OE_ORDER_HEADERS_ALL
OE_ORDER_LINES_ALL
Pricing tables: QP_PRICING_ATTRIBUTES
Concurrent Program:
Order Import
Validations:
Check for sold_to_org_id. If does not exist, create new customer by calling create_new_cust_info API.
Check for sales_rep_id. Should exist for a booked order.
Ordered_date should exist (header level)
Delivery_lead_time should exist (line level)
Earliest_acceptable_date should exist.
Freight_terms should exist
Notes:
During import of orders, shipping tables are not populated.
If importing customers together with the order, OE_ORDER_CUST_IFACE_ALL has to be populated and the base tables are HZ_PARTIES, HZ_LOCATIONS.
Orders can be categorized based on their status:
1. Entered orders
2. Booked orders
3. Closed orders
Order Import API OE_ORDER_PUB.GET_ORDER and PROCESS_ORDER can also be used to import orders.
Some important columns that need to populated in the interface tables:
OE_HEADERS_IFACE_ALL:
ORIG_SYS_DOCUMENT_REF
ORDER_SOURCE
CONVERSION_RATE
ORG_ID
ORDER_TYPE_ID
PRICE_LIST
SOLD_FROM_ORG_ID
SOLD_TO_ORG_ID
SHIP_TO_ORG_ID
SHIP_FROM_ORG_ID
CUSTOMER_NAME
INVOICE_TO_ORG_ID
OPERATION_CODE
OE_LINES_IFACE_ALL
ORDER_SOURCE_ID
ORIG_SYS_DOCUMENT_REF
ORIG_SYS_LINE_REF
ORIG_SYS_SHIPMENT_REF
INVENTORY_ITEM_ID
LINK_TO_LINE_REF
REQUEST_DATE
DELIVERY_LEAD_TIME
DELIVERY_ID
ORDERED_QUANTITY
ORDER_QUANTITY_UOM
SHIPPING_QUANTITY
PRICING_QUANTITY
PRICING_QUANTITY_UOM
SOLD_FROM_ORG_ID
SOLD_TO_ORG_ID
INVOICE_TO_ ORG_ID
SHIP_TO_ORG_ID
PRICE_LIST_ID
PAYMENT_TERM_ID
Item import (Item conversion)
The Item Interface lets you import items into Oracle Inventory.
Pre-requisites:
Creating an Organization
Code Combinations
Templates
Defining Item Status Codes
Defining Item Types
Interface tables:
MTL_SYSTEM_ITEMS_INTERFACE
MTL_ITEM_REVISIONS_INTERFACE (If importing revisions)
MTL_ITEM_CATEGORIES_INTERFACE (If importing categories)
MTL_INTERFACE_ERRORS (View errors after import)
Concurrent Program:
Item import
In the item import parameters form, for the parameter ‘set process id’, specify
the ‘set process id’ value given in the mtl_item_categories_interface table. The
parameter ‘Create or Update’ can have any value. Through the import process, we
can only create item category assignment(s). Updating or Deletion of item category assignment is not supported.
Base tables:
MTL_SYSTEM_ITEMS_B
MTL_ITEM_REVISIONS_B
MTL_CATEGORIES_B
MTL_CATEGORY_SETS_B
MTL_ITEM_STATUS
MTL_ITEM_TEMPLATES
Validations:
Check for valid item type.
Check for valid part_id/segment of the source table.
Validate part_id/segment1 for master org.
Validate and translate template id of the source table.
Check for valid template id. (Attributes are already set for items, default attributes for
that template, i.e., purchasable, stockable, etc)
Check for valid item status.
Validate primary uom of the source table.
Validate attribute values.
Validate other UOMs of the source table.
Check for unique item type. Discard the item, if part has non-unique item type.
Check for description, inv_um uniqueness
Validate organization id.
Load master records and category records only if all validations are passed.
Load child record if no error found.
Some important columns that need to populated in the interface tables:
MTL_SYSTEM_ITEMS_INTERFACE:
PROCESS_FLAG = 1 (1= Pending, 2= Assign Complete,
3= Assign/Validation Failed, 4= Validation succeeded; Import failed, 5 = Import in Process,
7 = Import succeeded)
TRANSACTION_TYPE = ‘CREATE’, ‘UPDATE’
SET_PROCESS_ID = 1
ORGANIZATION_ID
DESCRIPTION
ITEM_NUMBER and/or SEGMENT (n)
MATERIAL_COST
REVISION
TEMPLATE_ID
SUMMARY_FLAG
ENABLED_FLAG
PURCHASING_ITEM_FLAG
SALES_ACCOUNT (defaulted from
MTL_PARAMETERS.SALES_ACCOUNT)
COST_OF_SALES_ACCOUNT (defaulted from MTL_PARAMETERS.
COST_OF_SALES_ACCOUNT)
MTL_ITEM_CATEGORIES_INTERFACE:
INVENTORY_ITEM_ID or ITEM_NUMBER.
ORGANIZATION_ID or ORGANIZATION_CODE or both.
TRANSACTION_TYPE = ‘CREATE’ (‘UPDATE’ or ‘DELETE’ is not
possible through Item Import).
CATEGORY_SET_ID or CATEGORY_SET_NAME or both.
CATEGORY_ID or CATEGORY_NAME or both.
PROCESS_FLAG = 1
SET_PROCESS_ID (The item and category interface records should have the
same set_process_id, if you are importing item and category assignment together)
MTL_ITEM_REVISIONS_INTERFACE:
INVENTORY_ITEM_ID or ITEM_NUMBER (Must match the item_number in mtl_system_items_interface table)
ORGANIZATION_ID or ORGANIZATION_CODE or both
REVISION
CHANGE_NOTICE
ECN_INITIATION_DATE
IMPLEMENTATION_DATE
IMPLEMENTED_SERIAL_NUMBER
EFFECTIVITY_DATE
ATTRIBUTE_CATEGORY
ATTRIBUTEn
REVISED_ITEM_SEQUENCE_ID
DESCRIPTION
PROCESS_FLAG = 1
TRANSACTION_TYPE = ‘CREATE’
SET_PROCESS_ID = 1
Each row in the mtl_item_revisions_interface table must have the REVISION
and EFFECTIVITY_DATE in alphabetical (ASCII sort) and chronological
order.
Inventory On-hand quantity Interface
This interface lets you import the on hand inventory into Oracle.
Interface tables:
MTL_TRANSACTIONS_INTERFACE
MTL_MTL_TRANSACTION_LOTS_INTERFACE (If the item is Lot controlled)
MTL_SERIAL_NUMBERS_INTERFACE (If the item is Serial controlled)
Concurrent Program:
Launch the Transaction Manager through Interface Manager or explicitly call the API – INV_TXN_MANAGER_PUB.PROCESS_TRANSACTIONS () to launch a dedicated transaction worker to process them.
The Transaction Manager picks up the rows to process based on the LOCK_FLAG, TRANSACTION_MODE, and PROCESS_FLAG. Only records with TRANSACTION_MODE of 3, LOCK_FLAG of ’2 , and ′PROCESS_FLAG of ’1 will be picked up by the Transaction Manager and assigned to a Transaction ′Worker. If a record fails to process completely, then PROCESS_FLAG will be set to ’3 and ERROR_CODE ′and ERROR_EXPLANATION will be populated with the cause for the error.
Base Tables:
MTL_ON_HAND_QUANTITIES
MTL_LOT_NUMBERS
MTL_SERIAL_NUMBERS
Validations:
Validate organization_id
Check if item is assigned to organization
Validate disposition_id
Check if the item for the org is lot controlled before inserting into the Lots interface table.
Check if the item for the org is serial controlled before inserting into Serial interface table.
Check if inventory already exists for that item in that org and for a lot.
Validate organization_id, organization_code.
Validate inventory item id.
Transaction period must be open.
Some important columns that need to be populated in the interface tables:
MTL_TRANSACTIONS_INTERFACE:
TRANSACTION_SOURCE_NAME (ANY USER DEFINED VALUE),
TRANSACTION_HEADER_ID (MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL)
TRANSACTION_INTERFACE_ID (MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL – If item is lot or serial controlled, use this field to link to mtl_transactions_interface otherwise leave it as NULL),
TRANSACTION_DATE,
TRANSACTION_TYPE_ID,
PROCESS_FLAG (1 = Yet to be processed, 2 = Processed, 3= Error)
TRANSACTION_MODE (2 = Concurrent – to launch a dedicated transaction worker
to explicitly process a set of transactions.
3 = Background – will be picked up by transaction manager
polling process and assigned to transaction
worker. These will not be picked up until the
transaction manager is running)
SOURCE_CODE,
SOURCE_HEADER_ID,
SOURCE_LINE_ID (Details about the source like Order Entry etc for tracking purposes)
TRANSACTION_SOURCE_ID
Source Type Foreign Key Reference
Account GL_CODE_COMBINATIONS.CODE_COMBINATION_ID
Account Alias MTL_GENERIC_DISPOSITIONS.DISPOSITION_ID
Job or schedule WIP_ENTITIES.WIP_ENTITY_ID
Sales Order MTL_SALES_ORDERS.SALES_ORDER_ID
ITEM_SEGMENT1 TO 20,
TRANSACTION_QTY,
TRANSACTION_UOM,
SUBINVENTORY_CODE,
ORGANIZATION_ID,
LOC_SEGMENT1 TO 20.
MTL_TRANSACTION_LOTS_INTERFACE:
TRANSACTION_INTERFACE_ID,
LOT_NUMBER,
LOT_EXPIRATION_DATE,
TRANSACTION_QUANTITY,
SERIAL_TRANSACTION_TEMP_ID (This is required for items under both lot and serial control to identify child records in mtl_serial_numbers_interface)
MTL_SERIAL_NUMBERS_INTERFACE:
TRANSACTION_INTERFACE_ID,
FM_SERIAL_NUMBER,
TO_SERIAL_NUMBER,
VENDOR_SERIAL_NUMBER
Customer conversion
Customer Interface helps you create customers in Oracle Applications.
Interface tables:
RA_CUSTOMERS_INTERFACE_ALL
RA_CUSTOMER_PROFILES_INT_ALL
RA_CONTACT_PHONES_INT_ALL
RA_CUSTOMER_BANKS_INT_ALL
RA_CUST_PAY_METHOD_INT_ALL
Base tables:
RA_CUSTOMERS
RA_ADDRESSES_ALL
RA_CUSTOMER_RELATIONSHIPS_ALL
RA_SITE_USES_ALL
Concurrent program:
Customer Interface
Validations:
Check if legacy values fetched are valid.
Check if customer address site is already created.
Check if customer site use is already created.
Check is customer header is already created.
Check whether the ship_to_site has associated bill_to_site
Check whether associated bill_to_site is created or not.
Profile amounts validation:
Validate cust_account_id, validate customer status.
Check if the location already exists in HZ_LOCATIONS. If does not exist, create new location.
Some important columns that need to be populated in the interface tables:
RA_CUSTOMERS_INTERFACE_ALL:
ORIG_SYSTEM_CUSTOMER_REF
SITE_USE_CODE
ORIG_SYSTEM_ADDRESS_REF
INSERT_UPDATE_FLAG (I = Insert, U = Update)
CUSTOMER_NAME
CUSTOMER_NUMBER
CUSTOMER_STATUS
PRIMARY_SITE_USE_FLAG
LOCATION
ADDRESS1
ADDRESS2
ADDRESS3
ADDRESS4
CITY
STATE
PROVINCE
COUNTY
POSTAL_CODE
COUNTRY
CUSTOMER_ATTRIBUTE1
CUSTOMER_ATTRIBUTE2
CUSTOMER_ATTRIBUTE3
CUSTOMER_ATTRIBUTE4
CUSTOMER_ATTRIBUTE5
LAST_UPDATED_BY
LAST_UPDATE_DATE
CREATED_BY
CREATION_DATE
ORG_ID
CUSTOMER_NAME_PHONETIC
RA_CUSTOMER_PROFILES_INT_ALL:
INSERT_UPDATE_FLAG
ORIG_SYSTEM_CUSTOMER_REF
ORIG_SYSTEM_ADDRESS_REF
CUSTOMER_PROFILE_CLASS_NAME
CREDIT_HOLD
LAST_UPDATED_BY
LAST_UPDATE_DATE
CREATION_DATE
CREATED_BY
ORG_ID
RA_CONTACT_PHONES_INT_ALL:
ORIG_SYSTEM_CONTACT_REF
ORIG_SYSTEM_TELEPHONE_REF
ORIG_SYSTEM_CUSTOMER_REF
ORIG_SYSTEM_ADDRESS_REF
INSERT_UPDATE_FLAG
CONTACT_FIRST_NAME
CONTACT_LAST_NAME
CONTACT_TITLE
CONTACT_JOB_TITLE
TELEPHONE
TELEPHONE_EXTENSION
TELEPHONE_TYPE
TELEPHONE_AREA_CODE
LAST_UPDATE_DATE
LAST_UPDATED_BY
LAST_UPDATE_LOGIN
CREATION_DATE
CREATED_BY
EMAIL_ADDRESS
ORG_ID
Customer API
Trading Community Architecture (TCA) is an architecture concept designed to support complex
trading communities. These APIs utilize the new TCA model, inserting directly to the HZ tables.
API Details:
Set the organization id
Exec dbms_application_info.set_client_info(’204 );′
Create a party and an account
HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCOUNT()
HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE
HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE
HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE
Create a physical location
HZ_LOCATION_V2PUB.CREATE_LOCATION()
HZ_LOCATION_V2PUB.LOCATION_REC_TYPE
Create a party site using party_id you get from step 2 and location_id from step 3.
HZ_PARTY_SITE_V2PUB.CREATE_PARTY_SITE()
HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE
Create an account site using account_id you get from step 2 and party_site_id from step 4.
HZ_CUST_ACCOUNT_SITE_V2PUB.CREATE_CUST_ACCT_SITE()
HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_ACCT_SITE_REC_TYPE
Create an account site use using cust_acct_site_id you get from step 5 ans site_use_code = ‘BILL_TO’.
HZ_CUST_ACCOUNT_SITE_V2PUB.CREATE_CUST_SITE_USE()
HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_SITE_USE_REC_TYPE
HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE
Base table:
HZ_PARTIES
HZ_PARTY_SITES
HZ_LOCATIONS
HZ_CUST_ACCOUNTS
HZ_CUST_SITE_USES_ALL
HZ_CUST_ACCT_SITES_ALL
HZ_PARTY_SITE_USES
Validations:
Check if legacy values fetched are valid.
Check if customer address site is already created.
Check if customer site use is already created.
Check is customer header is already created.
Check whether the ship_to_site has associated bill_to_site
Check whether associated bill_to_site is created or not.
Profile amounts validation:
Validate cust_account_id, validate customer status.
Check if the location already exists in HZ_LOCATIONS. If does not exist, create new location.
For detailed explanation refer to the below article:
http://www.erpschools.com/Apps/oracle-applications/articles/financials/Receivables/Customer-TCA-Architecture-and-API/index.aspx
Auto Invoice interface
This interface is used to import Customer invoices, Credit memos, Debit memos and On Account credits.
Pre-requisites:
Set of Books
Code combinations
Items
Sales representatives
Customers
Sales Tax rate
Payment Terms
Transaction Types
Freight Carriers
FOB
Batch Sources
Accounting Rules
Interface tables:
RA_INTERFACE_LINES_ALL
RA_INTERFACE_SALESCREDITS
RA_INTERFACE_DISTRIBUTIONS
RA_INTERFACE_ERRORS (details about the failed records)
Base tables:
RA_BATCHES
RA_CUSTOMER_TRX_ALL
RA_CUSTOMER_TRX_LINES_ALL
AR_PAYMENT_SCHEDULES_ALL RA_CUSTOMER_TRX_LINE_SALESREPS
RA_CUST_TRX_GL_DIST_ALL
RA_CUSTOMER_TRX_TYPES_ALL
Concurrent Program:
Auto invoice master program
Validations:
Check for amount, batch source name, conversion rate, conversion type.
Validate orig_system_bill_customer_id, orig_system_bill_address_id, quantity.
Validate if the amount includes tax flag.
Some important columns that need to be populated in the interface tables:
RA_INTERFACE_LINES_ALL:
AGREEMENT_ID
COMMENTS
CONVERSION_DATE
CONVERSION_RATE
CONVERSION_TYPE
CREDIT_METHOD_FOR_ACCT_RULE
CREDIT_METHOD_FOR_INSTALLMENTS
CURRENCY_CODE
CUSTOMER_BANK_ACCOUNT_ID
CUST_TRX_TYPE_ID
DOCUMENT_NUMBER
DOCUMENT_NUMBER_SEQUENCE_ID
GL_DATE
HEADER_ATTRIBUTE1–15
HEADER_ATTRIBUTE_CATEGORY
INITIAL_CUSTOMER_TRX_ID
INTERNAL_NOTES
INVOICING_RULE_ID
ORIG_SYSTEM_BILL_ADDRESS_ID
ORIG_SYSTEM_BILL_CONTACT_ID
ORIG_SYSTEM_BILL_CUSTOMER_ID
ORIG_SYSTEM_SHIP_ADDRESS_ID
ORIG_SYSTEM_SHIP_CONTACT_ID
ORIG_SYSTEM_SHIP_CUSTOMER_ID
ORIG_SYSTEM_SOLD_CUSTOMER_ID
ORIG_SYSTEM_BATCH_NAME
PAYMENT_SERVER_ORDER_ID
PREVIOUS_CUSTOMER_TRX_ID
PRIMARY_SALESREP_ID
PRINTING_OPTION
PURCHASE_ORDER
PURCHASE_ORDER_DATE
PURCHASE_ORDER_REVISION
REASON_CODE
RECEIPT_METHOD_ID
RELATED_CUSTOMER_TRX_ID
SET_OF_BOOKS_ID
TERM_ID
TERRITORY_ID
TRX_DATE
TRX_NUMBER
Receipt API
To bring in Unapplied Receipts and Conversion Receipts for Open Debit items to reduce the balance to the original amount due.
Pre-requisites:
Set of Books
Code combinations
Items
Quick Codes
Sales representatives
Customers
Sales Tax rate
API:
AR_RECEIPT_API_PUB.CREATE_CASH
AR_RECEIPT_API_PUB.CREATE_AND_APPLY
Base tables:
AR_CASH_RECEIPTS
Validations:
Check the currency and the exchange rate type to assign the exchange rate.
Validate bill to the customer.
Get bill to site use id.
Get the customer trx id for this particular transaction number.
Get payment schedule date for the customer trx id.
Lockbox interface
AutoLockbox lets us automatically process receipts that are sent directly to the bank instead of manually feeding them in Oracle Receivables.
AutoLockbox is a three step process:
1. Import: During this step, Lockbox reads and formats the data from your bank file
into interface table AR_PAYMENTS_INTERFACE_ALL using a SQL *Loader
script.
2. Validation: The validation program checks data in this interface table for
compatibility with Receivables. Once validated, the data is transferred into
QuickCash tables (AR_INTERIM_CASH_RECEIPTS_ALL and
AR_INTERIM_CASH_RCPT_LINES_ALL).
3. Post QuickCash: This step applies the receipts and updates your customer’s
balances.
Pre-Requisites:
Banks
Receipt Class
Payment Method
Receipt Source
Lockbox
Transmission format
AutoCash Rule sets
Interface tables:
AR_PAYMENTS_INTERFACE_ALL (Importdata from bank file)
AR_INTERIM_CASH_RECEIPTS_ALL
AR_INTERIM_CASH_RCPT_LINES_ALL (Validate data in interface table and place in quick cash tables)
Base Tables:
AR_CASH_RECEIPTS
AR_RECEIVABLES_APPLICATIONS
AR_ADJUSTMENTS
AR_DISTRIBUTIONS_ALL
AR_PAYMENT_SCHEDULES_ALL
Concurrent program:
Lockbox
Validations:
Check for valid record type, transmission record id.
Validate sum of the payments within the transmission.
Identify the lockbox number (no given by a bank to identify a lockbox).
Some important columns that need to be populated in the interface tables:
AR_PAYMENTS_INTERFACE_ALL:
STATUS
RECORD_TYPE
LOCKBOX_NUMBER
BATCH_NAME
TRANSIT_ROUTING_NUMBER
ACCOUNT
CHECK_NUMBER
REMITTANCE_AMOUNT
DEPOSIT_DATE
ITEM_NUMBER
CURRENCY_CODE
DEPOSIT_TIME
AP invoice interface
This interface helps us to import vendor invoices into Oracle applications from external systems into Oracle Applications.
Pre-requisites:
Set of Books
Code combinations
Employees
Lookups
Interface tables:
AP_INVOICES_INTERFACE
AP_INVOICE_LINES_INTERFACE
Base tables:
AP_INVOICES_ALL – header information
AP_INVOICE_DISTRIBUTIONS_ALL – lines info
Concurrent program:
Payables Open Interface Import
Validations:
Check for valid vendor
Check for Source, Location, org_id, currency_code’s validity
Check for valid vendor site code.
Check if record already exists in payables interface table.
Some important columns that need to be populated in the interface tables:
AP_INVOICES_INTERFACE:
INVOICE_ID
INVOICE_NUM
INVOICE_DATE
VENDOR_NUM
VENDOR_SITE_ID
INVOICE_AMOUNT
INVOICE_CURRENCY_CODE
EXCHANGE_RATE
EXCHANGE_RATE_TYPE
EXCHANGE_DATE
DESCRIPTION
SOURCE
PO_NUMBER
PAYMENT_METHOD_LOOKUP_CODE
PAY_GROUP_LOOKUP_CODE
ATTRIBUTE1 TO 15
ORG_ID
AP_INVOICE_LINES_INTERFACE:
INVOICE_ID
INVOICE_LINE_ID
LINE_TYPE_LOOKUP_CODE
AMOUNT
DESCRIPTION
TAX_CODE
PO_NUMBER
PO_LINE_NUMBER
PO_SHIPMENT_NUM
PO_DISTRIBUTION_NUM
PO_UNIT_OF_MEASURE
QUANTITY_INVOICED
DIST_CODE_CONCATENATED
DIST_CODE_COMBINATION_ID
ATTRIBUTE1
ATTRIBUTE2
ATTRIBUTE3
ATTRIBUTE4
ATTRIBUTE5
ORG_ID
Vendor conversion/interface
This interface is used to import suppliers, supplier sites and site contacts into Oracle applications.
Pre-requisites setup’s required:
Payment terms
Pay Groups
CCID
Supplier classifications
Bank Accounts
Employees (if employees have to set up as vendors)
Interface tables:
AP_SUPPLIERS_INT
AP_SUPPLIER_SITES_INT
AP_SUP_SITE_CONTACT_INT
Base Tables:
PO_VENDORS
PO_VENDOR_SITES_ALL
PO_VENDOR_CONTACTS
Interface programs:
Supplier Open Interface Import
Supplier Sites Open Interface Import
Supplier Site Contacts Open Interface Import
Validations:
Check if vendor already exists
Check if vendor site already exists
Check if site contact already exists
Check if term is defined.
Some important columns that need to be populated in the interface tables:
AP_SUPPLIERS_INT:
VENDOR_NUMBER, VENDOR_NAME, VENDOR_TYPE, STATE_REPORTABLE, FED_REPORTABLE, NUM_1099, TYPE_1099, PAY_GROUP_LOOKUP_CODE, VENDOR_ID is auto generated.
AP_SUPPLIER_SITES_INT:
VENDOR_SITE_ID, ORG_ID, VENDOR_SITE_CODE, INACTIVE_DATE, PAY_SITE, PURCHASING_SITE, SITE_PAYMENT_TERM, ADDRESS1, ADDRESS2.ADDRESS3, CITY, STATE, COUNTRY, ZIP, PH_NUM, FAX_NUMBER, TAX_REPORTING_SITE_FLAG.
AP_SUP_SITE_CONTACTS_INT:
VENDOR_ID, VENDOR_SITE_ID, FIRST_NAME, LAST_NAME, AREA_CODE, PHONE, EMAIL, ORG_ID
Purchase Order conversion:
The Purchasing Document Open Interface concurrent program was replaced by two new concurrent programs Import Price Catalogs and Import Standard Purchase Orders. Import Price Catalogs concurrent program is used to import Catalog Quotations, Standard Quotations, and Blanket Purchase Agreements. Import Standard Purchase Orders concurrent program is used to import Unapproved or Approved Standard Purchase Orders.
Import Standard Purchase Orders
Pre-requisites:
Suppliers, sites and contacts
Buyers
Line Types
Items
PO Charge account setup
Interface Tables:
PO_HEADERS_INTERFACE
PO_LINES_INTERFACE
PO_DISTRIBUTIONS_INTERFACE
PO_INTERFACE_ERRORS (Fallouts)
Interface Program:
Import Standard Purchase Orders.
Base Tables:
PO_HEADERS_ALL
PO_LINES_ALL
PO_DISTRIBUTIONS_ALL
PO_LINE_LOCATIONS_ALL
Validations:
Header:
Check if OU name is valid
Check if Supplier is valid
Check if Supplier site is valid
Check if buyer is valid
Check if Payment term is valid
Check if Bill to and ship to are valid
Check if FOB, freight terms are valid
Lines:
Check if Line_type, ship_to_org, item, uom, ship_to_location_id, requestor, charge_account, deliver_to_location are valid
General:
Check for duplicate records in interface tables
Check if the record already exists in base tables.
Some important columns that need to be populated in the interface tables:
PO_HEADERS_INTERFACE:
INTERFACE_HEADER_ID (PO_HEADERS_INTERFACE_S.NEXTVAL), BATCH_ID, ORG_ID, INTERFACE_SOURCE_CODE, ACTION (‘ORIGINAL’,'UPDATE’,'REPLACE’), GROUP_CODE, DOCUMENT_TYPE_CODE, PO_HEADER_ID (NULL), RELEASE_ID, RELEASE_NUM, CURRENCY_CODE, RATE, AGENT_NAME, VENDOR_ID, VENDOR_SITE_ID, SHIP_TO_LOCATION, BILL_TO_LOCATION, PAYMENT_TERMS
PO_LINES_INTERFACE:
INTERFACE_LINE_ID, INTERFACE_HEADER_ID, LINE_NUM, SHIPMENT_NUM, ITEM, REQUISITION_LINE_ID, UOM, UNIT_PRICE, FREIGHT_TERMS, FOB
PO_DISTRIBUTIONS_INTERFACE:
INTERFACE_LINE_ID, INTERFACE_HEADER_ID, INTERFACE_DISTRIBUTION_ID, DISTRIBUTION_NUM, QUANTITY_ORDERED, QTY_DELIVERED, QTY_BILLED, QTY_CANCELLED, DELIVER_TO_LOCATION_ID, DELIVER_TO_PERSON_ID, SET_OF_BOOKS, CHARGE_ACCT, AMOUNT_BILLED.
Import Blanket Purchase Agreements:
Interface Tables:
PO_HEADERS_INTERFACE
PO_LINES_INTERFACE
Interface program:
Import Price Catalogs
Base tables:
PO_HEADERS_ALL
PO_LINES_ALL
PO_LINE_LOCATIONS_ALL
Example:
Suppose you want to create a blanket with one line and two price breaks and the details for the price break are as below:
1) Quantity = 500, price = 10, effective date from ’01-JAN-2006 to′
’31-JUN-2006′
2) Quantity = 500, price = 11, effective date from ’01-JUL-2006 to′
’01-JAN-2007′
To create the above the BPA, you would create ONE record in PO_HEADERS_INTERFACE and THREE records in PO_LINES_INTERFACE
LINE1: It will have only the line information. LINE NUM would be 1.
LINE2: For the first Price Break details, LINE NUM will be the same as above i.e. 1. SHIPMENT_NUM would be 1 and SHIPMENT_TYPE would be ‘PRICE BREAK’
LINE3: For the second Price Break details, LINE NUM will be the same as above i.e. 1. SHIPMENT_NUM would be 2 and SHIPMENT_TYPE would be ‘PRICE BREAK’
All the line-level records above must have the same INTERFACE_HEADER_ID.
For detailed explanation refer to the below article:
http://www.erpschools.com/Apps/oracle-applications/articles/financials/Purchasing/Import-Blanket-Purchase-Agreements/index.aspx
Requisition import
You can automatically import requisitions into Oracle Applications using the Requisitions Open Interface
Pre-requisites:
Set of Books
Code combinations
Employees
Items
Define a Requisition Import Group-By method in the Default region of the Purchasing
Options window.
Associate a customer with your deliver-to location using the Customer Addresses
window for internally sourced requisitions.
Interface tables:
PO_REQUISITIONS_INTERFACE_ALL
PO_REQ_DIST_INTERFACE_ALL
Base tables:
PO_REQUISITIONS_HEADERS_ALL
PO_REQUISITION_LINES_ALL
PO_REQ_DISTRIBUTIONS_ALL
Concurrent program:
REQUISITION IMPORT
Validations:
Check for interface transaction source code, requisition destination type.
Check for quantity ordered, authorization status type.
Some important columns that need to be populated in the interface tables:
PO_REQUISITIONS_INTERFACE_ALL:
INTERFACE_SOURCE_CODE (to identify the source of your imported
Requisitions)
DESTINATION_TYPE_CODE
AUTHORIZATION_STATUS
PREPARER_ID or PREPARER_NAME
QUANTITY
CHARGE_ACCOUNT_ID or charge account segment values
DESTINATION_ORGANIZATION_ID or DESTINATION_ORGANIZATION_
CODE
DELIVER_TO_LOCATION_ID or DELIVER_TO_LOCATION_CODE
DELIVER_TO_REQUESTOR_ID or DELIVER_TO_REQUESTOR_NAME
ORG_ID
ITEM_ID or item segment values (values if the SOURCE_TYPE_CODE or
DESTINATION_TYPE_CODE is ‘INVENTORY’)
PO_REQ_DIST_INTERFACE_ALL:
CHARGE_ACCOUNT_ID or charge account segment values
DISTRIBUTION_NUMBER
DESTINATION_ORGANIZATION_ID
DESTINATION_TYPE_CODE
INTERFACE_SOURCE_CODE
ORG_ID
DIST_SEQUENCE_ID (if MULTI_DISTRIBUTIONS is set to Y)
PO Receipts Interface
The Receiving Open Interface is used for processing and validating receipt data that
comes from sources other than the Receipts window in Purchasing.
Pre-requisites:
Set of Books
Code combinations
Employees
Items
Interface tables:
RCV_HEADERS_INTERFACE
RCV_TRANSACTIONS_INTERFACE
PO_INTERFACE_ERRORS
Concurrent program:
RECEIVING OPEN INTERFACE
Base tables:
RCV_SHIPMENT_HEADERS
RCV_SHIPMENT_LINES
RCV_TRANSACTIONS
Validations:
Check that SHIPPED_DATE should not be later than today.
Check if vendor is valid.
If Invoice number is passed, check for its validity
Check if Item is valid
Some important columns that need to be populated in the interface tables:
RCV_HEADERS_INTERFACE:
HEADER_INTERFACE_ID
GROUP_ID
PROCESSING_STATUS_
CODE
RECEIPT_SOURCE_CODE
TRANSACTION_TYPE
SHIPMENT_NUM
RECEIPT_NUM
VENDOR_NAME
SHIP_TO_
ORGANIZATION_CODE
SHIPPED_DATE
INVOICE_NUM
INVOICE_DATE
TOTAL_INVOICE_
AMOUNT
PAYMENT_TERMS_ID
EMPLOYEE_NAME
VALIDATION_FLAG (Indicates whether to validate a row or not, values ‘Y’, ‘N’)
RCV_TRANSACTIONS_INTERFACE:
INTERFACE_TRANSACTION_ID
GROUP_ID
TRANSACTION_TYPE (‘SHIP’ for a standard shipment (an ASN or ASBN)
or ‘RECEIVE’ for a standard receipt)
TRANSACTION_DATE
PROCESSING_STATUS_CODE =’PENDING’
CATEGORY_ID
QUANTITY
UNIT_OF_MEASURE
ITEM_DESCRIPTION
ITEM_REVISION
EMPLOYEE_ID
AUTO_TRANSACT_CODE
SHIP_TO_LOCATION_ID
RECEIPT_SOURCE_CODE
TO_ORGANIZATION_CODE
SOURCE_DOCUMENT_CODE
PO_HEADER_ID
PO_RELEASE_ID
PO_LINE_ID
PO_LINE_LOCATION_ID
PO_DISTRIBUTION_ID
SUBINVENTORY
HEADER_INTERFACE_ID
DELIVER_TO_PERSON_NAME
DELIVER_TO_LOCATION_CODE
VALIDATION_FLAG
ITEM_NUM
VENDOR_ITEM_NUM
VENDOR_ID
VENDOR_SITE_ID
ITEM_ID
ITEM_DESCRIPTION
SHIP_TO_LOCATION_ID
GL Journal interface
This interface lets you import journals from other applications like Receivables, Payables etc to integrate the information with General Ledger.
Pre-requisites:
Set of Books
Flex field Value sets
Code Combinations
Currencies
Categories
Journal Sources
Interface tables:
GL_INTERFACE
Base tables:
GL_JE_HEADERS
GL_JE_LINES
GL_JE_BACTHES
Concurrent Program:
Journal Import
Journal Posting — populates GL_BALANCES
Validations:
Validate SOB, journal source name, journal category name, actual flag
A – Actual amounts
B – Budget amounts
E – Encumbrance amount
If you enter E in the interface table, then enter appropriate encumbrance ID, if
B enter budget id.
Check if accounting date or GL date based period name is valid (i.e., not closed).
Check if accounting date falls in open or future open period status.
Check chart of accounts id based on Sob id.
Check if code combination is valid and enabled.
Check if record already exists in GL interface table.
Check if already journal exists in GL application.
Some important columns that need to be populated in the interface tables:
GL_INTERFACE:
STATUS
SET_OF_BOOKS_ID
ACCOUNTING_DATE
CURRENCY_CODE
DATE_CREATED
CREATED_BY
ACTUAL_FLAG
USER_JE_CATEGORY_NAME
USER_JE_SOURCE_NAME
CURRENCY_CONVERSION_DATE
ENCUMBRANCE_TYPE_ID
BUDGET_VERSION_ID
USER_CURRENCY_CONVERSION_TYPE
CURRENCY_CONVERSION_RATE
SEGMENT1 to
ENTERED_DR
ENTERED_CR
ACCOUNTED_DR
ACCOUNTED_CR
TRANSACTION_DATE
PERIOD_NAME
JE_LINE_NUM
CHART_OF_ACCOUNTS_ID
FUNCTIONAL_CURRENCY_CODE
CODE_COMBINATION_ID
DATE_CREATED_IN_GL
GROUP_ID
GL budget interface
Budget interface lets you load budget data from external sources into Oracle Applications.
Pre-requisites:
Set of Books
Flex field Value sets
Code Combinations
Interface tables:
GL_BUDGET_INTERFACE
Base tables:
GL_BUDGETS
GL_BUDGET_ASSIGNMENTS
GL_BUDGET_TYPES
Concurrent program:
Budget Upload
Validations:
Check if CURRENCY_CODE is valid.
Check if SET_OF_BOOKS_ID is valid.
Check if BUDGET_ENTITY_NAME (budget organization) is valid.
Some important columns that need to be populated in the interface tables:
GL_BUDGET_INTERFACE:
BUDGET_NAME NOT
BUDGET_ENTITY_NAME
CURRENCY_CODE
FISCAL_YEAR
UPDATE_LOGIC_TYPE
BUDGET_ENTITY_ID
SET_OF_BOOKS_ID
CODE_COMBINATION_ID
BUDGET_VERSION_ID
PERIOD_TYPE
DR_FLAG
STATUS
ACCOUNT_TYPE
PERIOD1_AMOUNT through PERIOD60_AMOUNT
SEGMENT1 through SEGMENT30
GL daily conversion rates
This interface lets you load the rates automatically into General Ledger.
Pre-requisites:
Currencies
Conversion rate Types
Interface tables:
GL_DAILY_RATES_INTERFACE
Base tables:
GL_DAILY_RATES
GL_DAILY_CONVERSION_TYPES
Concurrent Program:
You do not need to run any import programs. The insert, update, or
deletion of rates in GL_DAILY_RATES is done automatically by database
triggers on the GL_DAILY_RATES_INTERFACE. All that is required is to
develop program to populate the interface table with daily rates
information.
Validations:
Check if
FROM_CURRENCY and TO_CURRENCY are valid.
Check if USER_CONVERSION_TYPE is valid.
Some important columns that need to be populated in the interface tables:
GL_DAILY_RATES_INTERFACE:
FROM_CURRENCY
TO_CURRENCY
FROM_CONVERSION_DATE
TO_CONVERSION_DATE
USER_CONVERSION_TYPE
CONVERSION_RATE
MODE_FLAG (D= Delete, I = Insert, U = Update)
INVERSE_CONVERSION_RATE
DECLARE gpr_return_status VARCHAR2 (1) := NULL; gpr_msg_count NUMBER := 0; gpr_msg_data VARCHAR2 (2000); gpr_price_list_rec qp_price_list_pub.price_list_rec_type; gpr_price_list_val_rec qp_price_list_pub.price_list_val_rec_type; gpr_price_list_line_tbl qp_price_list_pub.price_list_line_tbl_type; gpr_price_list_line_val_tbl qp_price_list_pub.price_list_line_val_tbl_type; gpr_qualifiers_tbl qp_qualifier_rules_pub.qualifiers_tbl_type; gpr_qualifiers_val_tbl qp_qualifier_rules_pub.qualifiers_val_tbl_type; gpr_pricing_attr_tbl qp_price_list_pub.pricing_attr_tbl_type; gpr_pricing_attr_val_tbl qp_price_list_pub.pricing_attr_val_tbl_type; ppr_price_list_rec qp_price_list_pub.price_list_rec_type; ppr_price_list_val_rec qp_price_list_pub.price_list_val_rec_type; ppr_price_list_line_tbl qp_price_list_pub.price_list_line_tbl_type; ppr_price_list_line_val_tbl qp_price_list_pub.price_list_line_val_tbl_type; ppr_qualifiers_tbl qp_qualifier_rules_pub.qualifiers_tbl_type; ppr_qualifiers_val_tbl qp_qualifier_rules_pub.qualifiers_val_tbl_type; ppr_pricing_attr_tbl qp_price_list_pub.pricing_attr_tbl_type; ppr_pricing_attr_val_tbl qp_price_list_pub.pricing_attr_val_tbl_type; k NUMBER := 1; j NUMBER := 1; BEGIN -- INITIALIZATION REQUIRED FOR R12 mo_global.set_policy_context ('S', 308); mo_global.init('ONT');
fnd_global.apps_initialize (user_id => 1138, resp_id => 21623, resp_appl_id => 660);
gpr_price_list_rec.list_header_id := 33019; -- Enter the list_header_id from qp_list_headers gpr_price_list_rec.NAME := 'TST_PRICE_LIST'; -- Enter the price list name gpr_price_list_rec.list_type_code := 'PRL'; gpr_price_list_rec.description := 'TEST PRICE LIST'; --Enter the price list Description gpr_price_list_rec.operation := qp_globals.g_opr_update;
k := 1; -- create the price list line rec
gpr_price_list_line_tbl (k).list_header_id := 33019; -- Enter the list_header_id from qp_list_headers gpr_price_list_line_tbl (k).list_line_id := fnd_api.g_miss_num; gpr_price_list_line_tbl (k).list_line_type_code := 'PLL'; gpr_price_list_line_tbl (k).operation := qp_globals.g_opr_create; gpr_price_list_line_tbl (k).operand := 10; --Enter the Unit Price gpr_price_list_line_tbl (k).arithmetic_operator := 'UNIT_PRICE'; j := 1;
gpr_pricing_attr_tbl (j).pricing_attribute_id := fnd_api.g_miss_num; gpr_pricing_attr_tbl (j).list_line_id := fnd_api.g_miss_num; gpr_pricing_attr_tbl (j).product_attribute_context := 'ITEM'; gpr_pricing_attr_tbl (j).product_attribute := 'PRICING_ATTRIBUTE1'; gpr_pricing_attr_tbl (j).product_attr_value := '102785'; -- Enter the inventory_item_id gpr_pricing_attr_tbl (j).product_uom_code := 'EA'; -- Enter the UOM gpr_pricing_attr_tbl (j).excluder_flag := 'N'; gpr_pricing_attr_tbl (j).attribute_grouping_no := 1; gpr_pricing_attr_tbl (j).price_list_line_index := 1; gpr_pricing_attr_tbl (j).operation := qp_globals.g_opr_create;
dbms_output.put_line('Calling qp_price_list_pub.process_price_list API to Enter Item Into Price List'); dbms_output.put_line('============================ =================');
qp_price_list_pub.process_price_list (p_api_version_number => 1, p_init_msg_list => fnd_api.g_false, p_return_values => fnd_api.g_false, p_commit => fnd_api.g_false, x_return_status => gpr_return_status, x_msg_count => gpr_msg_count, x_msg_data => gpr_msg_data, p_price_list_rec => gpr_price_list_rec, p_price_list_line_tbl => gpr_price_list_line_tbl, p_pricing_attr_tbl => gpr_pricing_attr_tbl, x_price_list_rec => ppr_price_list_rec, x_price_list_val_rec => ppr_price_list_val_rec, x_price_list_line_tbl => ppr_price_list_line_tbl, x_price_list_line_val_tbl => ppr_price_list_line_val_tbl, x_qualifiers_tbl => ppr_qualifiers_tbl, x_qualifiers_val_tbl => ppr_qualifiers_val_tbl, x_pricing_attr_tbl => ppr_pricing_attr_tbl, x_pricing_attr_val_tbl => ppr_pricing_attr_val_tbl);
IF ppr_price_list_line_tbl.count > 0 THEN FOR k in 1 .. ppr_price_list_line_tbl.count LOOP dbms_output.put_line('No Of Record Got Insterted=> '|| k); dbms_output.put_line('Return Status = '|| ppr_price_list_line_tbl(k).return_status); END LOOP; END IF;
IF ppr_price_list_line_tbl(k).return_status = fnd_api.g_ret_sts_success THEN Commit; DBMS_OUTPUT.put_line ('The Item has been successfully loaded into the price list'); Else Rollback; DBMS_OUTPUT.put_line ('The Item has not been loaded into the price list'); end if;
FOR k in 1 .. gpr_msg_count LOOP gpr_msg_data := oe_msg_pub.get( p_msg_index => k, p_encoded => 'F');
dbms_output.put_line('The Error Message Due to which The Item has not been loaded to Price List '|| k ||' is: '|| gpr_msg_data);
-END LOOP;
=
I think this procedure will solve your problem PROCEDURE Prepare_end_date_prc (p_header_id IN NUMBER, p_list_line_id IN NUMBER, p_end_date IN DATE,
x_return_status OUT VARCHAR2,x_error_message OUT VARCHAR2) IS c_return_status VARCHAR2(20); c_error_data VARCHAR2(20000); n_msg_count NUMBER; c_msg_data VARCHAR2(20000); n_err_count NUMBER; n_line_index
NUMBER; n_attr_index
NUMBER; BEGIN g_process_ind := 11; print_msg_prc('Inside Prepare_end_date_prc '); print_msg_prc('Header Id
: '||p_header_id); print_msg_prc('List line Id
: '||p_list_line_id); print_msg_prc('End date
: '|| p_end_date); l_price_list_line_tbl.DELETE; l_pricing_attr_tbl.DELETE; n_line_index := 0; n_attr_index := 0; n_line_index := n_line_index + 1;
l_price_list_line_tbl(n_line_index).list_heade r_id := p_header_id;
l_price_list_line_tbl(n_line_index).list_line_ id
:= p_list_line_id;
l_price_list_line_tbl(n_line_index).end_date_a ctive := p_end_date;
l_price_list_line_tbl(n_line_index).operation := 'UPDATE';
Qp_Price_List_Pub.process_price_list
(
p_api_version_number
=> 1.0
,
p_init_msg_list
=> Fnd_Api.g_false
,
p_return_values
=> Fnd_Api.g_false
,
p_commit
=> Fnd_Api.g_false
,
x_return_status
=> c_return_status
,
x_msg_count
=> n_msg_count
,
x_msg_data
=> c_msg_data
,
p_price_list_rec
=> l_price_list_rec
,
p_price_list_val_rec
=> l_price_list_val_rec
,
p_price_list_line_tbl
=> l_price_list_line_tbl
,
p_price_list_line_val_tbl
=> l_price_list_line_val_tbl
,
p_qualifiers_tbl
=> l_qualifiers_tbl
,
p_qualifiers_val_tbl
=> l_qualifiers_val_tbl
,
p_pricing_attr_tbl
=> l_pricing_attr_tbl
,
p_pricing_attr_val_tbl
=> l_pricing_attr_val_tbl
,
x_price_list_rec
=> x_price_list_rec
,
x_price_list_val_rec
=> x_price_list_val_rec
,
x_price_list_line_tbl
=> x_price_list_line_tbl
,
x_price_list_line_val_tbl
=> x_price_list_line_val_tbl
,
x_qualifiers_tbl
=> x_qualifiers_tbl
,
x_qualifiers_val_tbl
=> x_qualifiers_val_tbl
,
x_pricing_attr_tbl
=> x_pricing_attr_tbl
,
x_pricing_attr_val_tbl
=> x_pricing_attr_val_tbl
);
print_msg_prc('Prepare_end_date_prc - c_return_status : '||c_return_status);
x_return_status :=c_return_status;
IF (c_return_status <> Fnd_Api.g_ret_sts_success ) THEN
ROLLBACK;
Oe_Msg_Pub.Count_And_Get(p_count => n_err_count,p_data => c_error_Data);
c_error_data := NULL;
FOR i IN 1..n_err_count LOOP
c_msg_Data := Oe_Msg_Pub.Get(p_msg_index => Oe_Msg_Pub.G_NEXT,p_encoded => Fnd_Api.G_FALSE);
c_error_data := c_error_Data || c_msg_data;
END LOOP;
x_error_message := 'Error in Prepare_end_date_prc :'||c_error_data;
print_log_prc(x_error_message);
ELSE
COMMIT;
END IF; END Prepare_end_date_prc;
Updating Price List Lines - API Approach Script for Updating Price
Issue :- Need to update unit price of items which are in given Price List ans having unit price as $9999999.
Process Followed :- First end date all the lines in QP_LIST_LINES which falls under above conditions and then insert new records in QP_LIST_LINES.
API Used :- qp_price_list_pub.process_price_list(Both for Insert and Update)
Steps Followed :- 1. Create a staging table to store Item_Id, New Unit_Price, Transaction_ID, Status and Errror_Message.2. Created a synonym, sequence, trigger and index on staging table.3. Validated Items Ids given (For Duplicate Records, Null Records and existence of item ids) in the data file).4. Send List_Header_Id, List_Line_Id, Pricing_Attribute_Id and field that has to be updated (In this example, end_date_active) and operation should be qp_globals.g_opr_update.
===========================================================================Staging Table , Synonym, Sequence, Trigger Creation
SET serverout on size 1000000CL SCR;
PROMPT +------------------------------------------------------------------------+PROMPT Execution of script startsPROMPT +------------------------------------------------------------------------+
--drop table lss_unit_price_stg;
CREATE TABLE lss_unit_price_stg(transaction_id_stg NUMBER NOT NULL,status_stg VARCHAR2(2),item_id NUMBER,unit_price NUMBER,error_message VARCHAR2(2000));
--drop synonym lss_unit_price_stg;
CREATE SYNONYM lss_unit_price_stg FOR lss.lss_unit_price_stg;
--drop index lss_unit_price_stg_ui;
CREATE UNIQUE INDEX lss_unit_price_stg_ui ON lss_unit_price_stg(transaction_id_stg);
--drop sequence lss_unit_price_stg_s1;
CREATE SEQUENCE lss_unit_price_stg_s1START WITH 1INCREMENT BY 1;
-- Creation Of Trigger
CREATE OR REPLACE TRIGGER lss_unit_price_stg_trg BEFORE INSERT ON lss_unit_price_stg FOR EACH ROWBEGIN IF :NEW.transaction_id_stg IS NULL THEN SELECT lss_unit_price_stg_s1.NEXTVAL, 'N' INTO :NEW.transaction_id_stg, :NEW.status_stg FROM DUAL; END IF;END;/============================Package Specification
CREATE OR REPLACE PACKAGE lss_unit_price_update_pkgIS PROCEDURE unit_price_validate (p_list_header_id IN NUMBER);
PROCEDURE unit_price_load (p_list_header_id IN NUMBER);END lss_unit_price_update_pkg;/===============================Package Body
CREATE OR REPLACE PACKAGE BODY lss_unit_price_update_pkgIS PROCEDURE unit_price_validate (p_list_header_id IN NUMBER) IS l_error_msg VARCHAR2 (3000); l_item_id NUMBER;
CURSOR item_stg_cur IS SELECT item_id, transaction_id_stg FROM lss_unit_price_stg WHERE status_stg IN ('N', 'VE');
CURSOR dup_item_cur IS SELECT item_id FROM lss_unit_price_stg GROUP BY item_id HAVING COUNT (*) > 1;
CURSOR item_nul_cur IS SELECT transaction_id_stg FROM lss_unit_price_stg WHERE item_id IS NULL; BEGIN-- Validating Item_Id FOR item_stg_rec IN item_stg_cur LOOP BEGIN SELECT DISTINCT inventory_item_id INTO l_item_id FROM qp_list_lines WHERE 1 = 1
AND list_header_id = p_list_header_id --AND operand = 9999999 --AND end_date_active IS NULL AND inventory_item_id = item_stg_rec.item_id; EXCEPTION WHEN OTHERS THEN l_error_msg := 'Inventory Item Id Not Found' || SQLERRM || ';;';
UPDATE lss_unit_price_stg SET status_stg = 'VE', error_message = error_message || l_error_msg WHERE 1 = 1 AND item_id = item_stg_rec.item_id;
COMMIT; END; END LOOP;
DBMS_OUTPUT.put_line ('Vallidating ItemID');
-- Validating for Duplicate records FOR dup_item_rec IN dup_item_cur LOOP BEGIN l_error_msg := 'Duplicate Item Id ;;';
UPDATE lss_unit_price_stg SET status_stg = 'VE', error_message = error_message || l_error_msg WHERE item_id = dup_item_rec.item_id;
COMMIT; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ( 'Error While updating Staging Table for the Item(Duplicate)' || dup_item_rec.item_id ); END; END LOOP;
DBMS_OUTPUT.put_line ('Vallidating Duplicate Records');
-- Validating Null Item Ids
FOR item_nul_rec IN item_nul_cur LOOP BEGIN l_error_msg := 'Given Item Id is Null ;;';
UPDATE lss_unit_price_stg SET status_stg = 'VE', error_message = error_message || l_error_msg WHERE transaction_id_stg = item_nul_rec.transaction_id_stg;
COMMIT; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ( 'Error While updating Staging Table for the Transaction(NULL)' || item_nul_rec.transaction_id_stg ); END; END LOOP;
DBMS_OUTPUT.put_line ('Vallidating D');
BEGIN UPDATE lss_unit_price_stg SET status_stg = 'V' WHERE status_stg = 'N' AND error_message IS NULL;
COMMIT; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ('Exception while updating staging table for successfully calidated records' ); END; END unit_price_validate;
PROCEDURE unit_price_load (p_list_header_id IN NUMBER) AS pl_code VARCHAR2 (2000); l_price NUMBER; l_count NUMBER; l_msg_dummy VARCHAR2 (2000); l_output VARCHAR2 (2000); l_msg_data VARCHAR2 (2000);
l_msg_count NUMBER; l_list_line_id NUMBER; l_pricing_attribute_id NUMBER; l_item_id NUMBER; gpr_return_status VARCHAR2 (10) := NULL; gpr_msg_count NUMBER := 0; gpr_msg_data VARCHAR2 (2000); gpr_price_list_rec qp_price_list_pub.price_list_rec_type; gpr_price_list_val_rec qp_price_list_pub.price_list_val_rec_type; gpr_price_list_line_tbl qp_price_list_pub.price_list_line_tbl_type; gpr_price_list_line_val_tbl qp_price_list_pub.price_list_line_val_tbl_type; gpr_qualifiers_tbl qp_qualifier_rules_pub.qualifiers_tbl_type; gpr_qualifiers_val_tbl qp_qualifier_rules_pub.qualifiers_val_tbl_type; gpr_pricing_attr_tbl qp_price_list_pub.pricing_attr_tbl_type; gpr_pricing_attr_val_tbl qp_price_list_pub.pricing_attr_val_tbl_type; ppr_price_list_rec qp_price_list_pub.price_list_rec_type; ppr_price_list_val_rec qp_price_list_pub.price_list_val_rec_type; ppr_price_list_line_tbl qp_price_list_pub.price_list_line_tbl_type; ppr_price_list_line_val_tbl qp_price_list_pub.price_list_line_val_tbl_type; ppr_qualifiers_tbl qp_qualifier_rules_pub.qualifiers_tbl_type; ppr_qualifiers_val_tbl qp_qualifier_rules_pub.qualifiers_val_tbl_type; ppr_pricing_attr_tbl qp_price_list_pub.pricing_attr_tbl_type; ppr_pricing_attr_val_tbl qp_price_list_pub.pricing_attr_val_tbl_type; i NUMBER := 1; k NUMBER := 0; j NUMBER := 0; v_userid NUMBER; v_applid NUMBER; v_respid NUMBER; v_loginid NUMBER;
CURSOR item_stg_cur IS SELECT item_id, transaction_id_stg FROM lss_unit_price_stg WHERE status_stg = 'V'; BEGIN DBMS_OUTPUT.put_line (p_list_header_id);
BEGIN fnd_client_info.set_org_context (141); END;
BEGIN SELECT user_id INTO v_userid
FROM fnd_user WHERE user_name LIKE 'XXXX'; EXCEPTION WHEN NO_DATA_FOUND THEN v_userid := NULL; END;
BEGIN SELECT MAX (login_id) INTO v_loginid FROM fnd_logins WHERE 1 = 1 AND user_id = v_userid; EXCEPTION WHEN NO_DATA_FOUND THEN v_loginid := NULL; END;
BEGIN SELECT application_id, responsibility_id INTO v_applid, v_respid FROM fnd_responsibility_tl WHERE responsibility_name LIKE 'Oracle Pricing Manager'; EXCEPTION WHEN NO_DATA_FOUND THEN v_applid := NULL; v_respid := NULL; END;
fnd_global.apps_initialize (v_userid, v_respid, v_applid); -- Prod
FOR item_stg_rec IN item_stg_cur LOOP BEGIN DBMS_OUTPUT.put_line ('Entered Loop');
SELECT qpll.list_line_id, qppa.pricing_attribute_id, qpll.inventory_item_id INTO l_list_line_id, l_pricing_attribute_id, l_item_id FROM qp_list_lines qpll, qp_pricing_attributes qppa WHERE qpll.list_line_id = qppa.list_line_id AND qpll.list_header_id = p_list_header_id AND qpll.inventory_item_id = item_stg_rec.item_id;
DBMS_OUTPUT.put_line ('Retrieving The Price List'); gpr_price_list_rec.list_header_id := p_list_header_id; gpr_price_list_rec.list_type_code := 'PRL'; gpr_price_list_rec.NAME := 'Test_Price_List_API_990'; gpr_price_list_rec.description := 'Test_Price_List_API_990'; gpr_price_list_rec.currency_code := 'USD'; pl_code := NULL; gpr_price_list_rec.operation := qp_globals.g_opr_update; gpr_pricing_attr_tbl.DELETE; k := 1; gpr_price_list_line_tbl (k).list_line_id := l_list_line_id; gpr_price_list_line_tbl (k).operation := qp_globals.g_opr_update; gpr_price_list_line_tbl (k).end_date_active := NULL; gpr_price_list_line_tbl (k).last_updated_by := v_userid; gpr_price_list_line_tbl (k).last_update_login := v_loginid; gpr_pricing_attr_tbl (k).pricing_attribute_id := l_pricing_attribute_id; gpr_pricing_attr_tbl (k).list_line_id := l_list_line_id; gpr_pricing_attr_tbl (k).product_attr_value := TO_CHAR (l_item_id); gpr_pricing_attr_tbl (k).operation := qp_globals.g_opr_update;
BEGIN qp_price_list_pub.process_price_list (p_api_version_number => 1, p_init_msg_list => fnd_api.g_false, p_return_values => fnd_api.g_false, p_commit => fnd_api.g_false, x_return_status => gpr_return_status, x_msg_count => gpr_msg_count, x_msg_data => gpr_msg_data, p_price_list_rec => gpr_price_list_rec, p_price_list_line_tbl => gpr_price_list_line_tbl, p_pricing_attr_tbl => gpr_pricing_attr_tbl, x_price_list_rec => ppr_price_list_rec, x_price_list_val_rec => ppr_price_list_val_rec, x_price_list_line_tbl => ppr_price_list_line_tbl, x_price_list_line_val_tbl => ppr_price_list_line_val_tbl, x_qualifiers_tbl => ppr_qualifiers_tbl, x_qualifiers_val_tbl => ppr_qualifiers_val_tbl, x_pricing_attr_tbl => ppr_pricing_attr_tbl, x_pricing_attr_val_tbl => ppr_pricing_attr_val_tbl ); DBMS_OUTPUT.put_line ('The Price List Line' || k || 'is inserted' );
DBMS_OUTPUT.put_line ( 'Price List line : ' || gpr_pricing_attr_tbl (k).product_attr_value ); COMMIT;
BEGIN UPDATE lss_unit_price_stg SET status_stg = 'L' WHERE transaction_id_stg = item_stg_rec.transaction_id_stg; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ( 'Excpetion when updating Staging table for Item(Updated Item)' || l_item_id ); END;
IF gpr_return_status <> 'S' THEN oe_msg_pub.get (k, fnd_api.g_false, gpr_msg_data, l_msg_dummy ); l_output := (TO_CHAR (k) || ': ' || l_msg_data); DBMS_OUTPUT.put_line (l_output);
BEGIN UPDATE lss_unit_price_stg SET status_stg = 'LE', error_message = error_message || l_output || ';;' WHERE transaction_id_stg = item_stg_rec.transaction_id_stg; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ( 'Excpetion when updating Staging table for Item(Update Failed)' || l_item_id ); END; END IF; EXCEPTION WHEN OTHERS
THEN BEGIN UPDATE lss_unit_price_stg SET status_stg = 'LE', error_message = error_message || 'Unknown Exception ;;' WHERE transaction_id_stg = item_stg_rec.transaction_id_stg; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ( 'Excpetion when updating Staging table for Item(Update Failed)' || l_item_id ); END;
DBMS_OUTPUT.put_line ('Error Processing The Price List...'); DBMS_OUTPUT.put_line ( 'Price List Name : ' || gpr_price_list_rec.NAME ); DBMS_OUTPUT.put_line (SQLERRM); END; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line (SQLERRM); END; END LOOP; END unit_price_load;END lss_unit_price_update_pkg;
Price List Update Sample Code
PROMPT ===========================================================PROMPT Aurthor: Oscar GarciaPROMPT Date: 31-OCT-2007PROMPTPROMPT This script has been developed to get masked the price lists.PROMPTPROMPT This script does NOT have an automatic commitPROMPT and will spool data before calling the API.PROMPTPROMPT ============================================================
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;WHENEVER OSERROR EXIT FAILURE ROLLBACK;
SET SERVEROUTPUT ON SIZE 1000000SET PAGESIZE 0SET LINESIZE 32767SET TRIMSPOOL ONSET FEEDBACK OFF
SPOOL XXX_PRICING_MASK.txt
select to_char (sysdate, ‘dd/mon/rrrr hh24:mi:ss’) from dual;
PROMPTPROMPTSELECT ‘You are connected to DB:’||NAME from V$DATABASE/
PROMPTPROMPT Hit RETURN Key to Continue..PROMPT
DECLARE
gpr_return_status varchar2(1) := NULL; gpr_msg_count number := 0; gpr_msg_data varchar2(2000); gpr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type; gpr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type; gpr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type; gpr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type; gpr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type; gpr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type; gpr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type; gpr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type; ppr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type; ppr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type; ppr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type; ppr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type; ppr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type; ppr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type; ppr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type; ppr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
CURSOR price_headers_cur IS select qph.list_header_id from qp_list_headers_b qph –(changed b to tl) where 1 = 1 AND qph.list_header_id NOT IN (112598,112601,117556,117566,121113); –AND qph.name NOT LIKE ‘XXXXXX%’; CURSOR price_lines_cur (p_list_header_id qp_list_lines.list_header_id%TYPE ) IS SELECT qpl.list_line_id FROM qp_list_lines qpl WHERE qpl.list_header_id = p_list_header_id;
K number := 0; j number := 1;
l_count_pricelists NUMBER := 0;
BEGIN
oe_debug_pub.initialize; oe_debug_pub.setdebuglevel(5); Oe_Msg_Pub.initialize ; DBMS_OUTPUT.PUT_LINE(’Debug File = ‘ || OE_DEBUG_PUB.G_DIR||’/'||OE_DEBUG_PUB.G_FILE);
FOR price_headers_rec IN price_headers_cur LOOP
— DBMS_OUTPUT.PUT_LINE(’Inside….: price_headers_rec, for: ‘ || price_headers_rec.list_header_id);
/* setup the list_header rec for update */ gpr_price_list_rec.list_header_id := price_headers_rec.list_header_id; gpr_price_list_rec.name := ‘XXXXXXX’||price_headers_rec.list_header_id; gpr_price_list_rec.description := ‘XXXXXXX’; gpr_price_list_rec.active_flag := ‘N’; gpr_price_list_rec.end_date_active := SYSDATE; gpr_price_list_rec.rounding_factor := 2; gpr_price_list_rec.operation := QP_GLOBALS.G_OPR_UPDATE;
l_count_pricelists := l_count_pricelists + 1; K := 0; FOR price_lines_rec IN price_lines_cur ( price_headers_rec.list_header_id ) LOOP K := K + 1; — delete the price list line rec gpr_price_list_line_tbl(K).list_header_id := price_headers_rec.list_header_id; — <price_list_header_id>; gpr_price_list_line_tbl(K).list_line_id := price_lines_rec.list_line_id; — <price_list_line_id>; — gpr_price_list_line_tbl(K).list_line_type_code := ‘PLL’; gpr_price_list_line_tbl(K).operation := QP_GLOBALS.G_OPR_DELETE; END LOOP; QP_PRICE_LIST_PUB.Process_Price_List ( p_api_version_number => 1 , p_init_msg_list => FND_API.G_FALSE , p_return_values => FND_API.G_FALSE , p_commit => FND_API.G_FALSE , x_return_status => gpr_return_status , x_msg_count => gpr_msg_count , x_msg_data => gpr_msg_data , p_PRICE_LIST_rec => gpr_price_list_rec , p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl , p_PRICING_ATTR_tbl => gpr_pricing_attr_tbl , x_PRICE_LIST_rec => ppr_price_list_rec , x_PRICE_LIST_val_rec => ppr_price_list_val_rec
, x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl , x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl , x_QUALIFIERS_tbl => ppr_qualifiers_tbl , x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl , x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl , x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl );
FOR k in 1 .. gpr_price_list_line_tbl.count LOOP gpr_price_list_line_tbl(K).list_header_id := NULL; gpr_price_list_line_tbl(K).list_line_id := NULL; gpr_price_list_line_tbl(K).operation := NULL; END LOOP; DELETE FROM qp_qualifiers WHERE list_header_id = price_headers_rec.list_header_id; DELETE FROM qp_pricing_attributes where list_header_id = price_headers_rec.list_header_id; END LOOP; IF ppr_price_list_line_tbl.count > 0 THEN FOR k in 1 .. ppr_price_list_line_tbl.count LOOP IF ppr_price_list_line_tbl(k).return_status <> ‘S’ THEN dbms_output.put_line(’Record = ‘|| k ||’Return Status = ‘|| ppr_price_list_line_tbl(k).return_status); END IF; END LOOP; END IF;
IF gpr_return_status <> FND_API.G_RET_STS_SUCCESS THEN RAISE FND_API.G_EXC_UNEXPECTED_ERROR; END IF;
— dbms_output.put_line(’after process price list ‘);
for k in 1 .. gpr_msg_count loop gpr_msg_data := oe_msg_pub.get( p_msg_index => k, p_encoded => ‘F’); dbms_output.put_line(’err msg ‘ || k ||’ is: ‘ || gpr_msg_data); end loop;
DBMS_OUTPUT.PUT_LINE(l_count_pricelists ||’ Price Lists Updated and Lines Deleted’);
EXCEPTION
WHEN FND_API.G_EXC_ERROR THEN gpr_return_status := FND_API.G_RET_STS_ERROR;
dbms_output.put_line(’err msg 1 is : ‘ || gpr_msg_data);
WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN gpr_return_status := FND_API.G_RET_STS_UNEXP_ERROR ; dbms_output.put_line(’ msg count 2 is : ‘ || gpr_msg_count);
for k in 1 .. gpr_msg_count loop
gpr_msg_data := oe_msg_pub.get( p_msg_index => k,p_encoded => ‘F’); — Get message count and data dbms_output.put_line(’err msg ‘ || k ||’ is: ‘ || gpr_msg_data); –dbms_output.put_line(’header ‘ ||gpr_price_list_line_tbl(K).list_header_id); –dbms_output.put_line(’line ‘ ||gpr_price_list_line_tbl(K).list_line_id);
end loop; WHEN OTHERS THEN gpr_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
— Get message count and data dbms_output.put_line(’err msg 3 is : ‘ || gpr_msg_data);
end;/
COMMIT;
select to_char (sysdate, ‘dd/mon/rrrr hh24:mi:ss’) from dual;
SPOOL OFF;
EXIT;
Suppliers Update Sample Code
PROMPT ===========================================================PROMPT Aurthor: Oscar GarciaPROMPT Date: 30-OCT-2007PROMPTPROMPT This script has been developed to get masked the supplier infomrationPROMPTPROMPT This script does NOT have an automatic commitPROMPT and will spool data before calling the API.PROMPTPROMPT ============================================================
SET SERVEROUTPUT ON SIZE 1000000SET PAGESIZE 0SET LINESIZE 32767SET TRIMSPOOL ONSET FEEDBACK OFF
SPOOL xxx_SUPPLIER_MASK.txt
select to_char (sysdate, ‘dd/mon/rrrr hh24:mi:ss’) from dual;
PROMPTPROMPTSELECT ‘You are connected to DB:’||NAME from V$DATABASE/
PROMPTPROMPT Hit RETURN Key to Continue..PROMPT
drop table xxx_xx_VENDORS_MASK;
PROMPT xxx_xx_VENDORS_MASK dropped….
create table xxx_xx_VENDORS_MASK asselect pv.vendor_id, pvs.vendor_site_idfrom po_vendors pv, po_vendor_sites_all pvswhere pv.vendor_id = pvs.vendor_idand (pv.vendor_id, pvs.vendor_site_id) not in (select pv.vendor_id, pvs.vendor_site_idfrom po_vendors pv, po_vendor_sites_all pvswhere pv.vendor_id = pvs.vendor_idand ( (pv.vendor_id =374869 and pvs.vendor_site_id = 458826) ) );
PROMPT xxx_xx_VENDORS_MASK created…. PROMPTPROMPT “RUNNING CALL TO THE API..”PROMPT
DECLARE
l_count_customers NUMBER := 0; l_count_cus_sites NUMBER := 0; l_count_site_cont NUMBER := 0; l_count_site_bank NUMBER := 0; l_count_site_bank_h NUMBER := 0; l_tot_sites NUMBER := 0; l_tot_sites_to_mask NUMBER := 0; — variables for the arguments to update_row on the supplier l_vendor_rowid VARCHAR2(255); l_vendor_vendor_id NUMBER; l_vendor_last_update_date DATE; l_vendor_last_updated_by NUMBER; l_vendor_name VARCHAR2(255); l_segment1 VARCHAR2(255); l_summary_flag VARCHAR2(255); l_enabled_flag VARCHAR2(255); l_vendor_last_update_login NUMBER; l_employee_id NUMBER; l_vendor_validation_number NUMBER;
l_vendor_type_lookup_code VARCHAR2(255); l_vendor_customer_num VARCHAR2(255); l_one_time_flag VARCHAR2(255); l_parent_vendor_id NUMBER; l_min_order_amount NUMBER; l_vendor_ship_to_location_id NUMBER; l_vendor_bill_to_location_id NUMBER; l_vendor_ship_via_lookup_code VARCHAR2(255); l_vend_frei_terms_lookup_code VARCHAR2(255); l_vendor_fob_lookup_code VARCHAR2(255); l_vendor_terms_id NUMBER; l_set_of_books_id NUMBER; l_vendor_always_take_disc_flag VARCHAR2(255); l_ven_pay_date_bas_look_code VARCHAR2(255); l_vendor_pay_group_lookup_code VARCHAR2(255); l_vendor_payment_priority NUMBER; l_vendor_invoice_currency_code VARCHAR2(255); l_vendor_payment_currency_code VARCHAR2(255); l_vendor_invoice_amount_limit NUMBER; l_vendor_hold_all_pay_flag VARCHAR2(255); l_vendor_hold_fut_pay_flag VARCHAR2(255); l_vendor_hold_reason VARCHAR2(255); l_vendor_distribution_set_id NUMBER; l_vendor_accts_pay_ccid NUMBER; l_vendor_fut_dated_pay_ccid NUMBER; l_prepay_ccid NUMBER; l_num_1099 VARCHAR2(255); l_type_1099 VARCHAR2(255); l_withholding_stat_lookup_code VARCHAR2(255); l_withholding_start_date DATE; l_org_type_lookup_code VARCHAR2(255); l_vendor_vat_code VARCHAR2(255); l_start_date_active DATE; l_end_date_active DATE; l_qty_rcv_tolerance NUMBER; l_minority_group_lookup_code VARCHAR2(255); l_vendor_pay_meth_lookup_code VARCHAR2(255); l_vendor_bank_account_name VARCHAR2(255); l_vendor_bank_account_num VARCHAR2(255); l_vendor_bank_num VARCHAR2(255); l_vendor_bank_account_type VARCHAR2(255); l_women_owned_flag VARCHAR2(255); l_small_business_flag VARCHAR2(255); l_standard_industry_class VARCHAR2(255); l_vendor_attribute_category VARCHAR2(255); l_vendor_attribute1 VARCHAR2(255); l_vendor_attribute2 VARCHAR2(255); l_vendor_attribute3 VARCHAR2(255); l_vendor_attribute4 VARCHAR2(255); l_vendor_attribute5 VARCHAR2(255); l_hold_flag VARCHAR2(255); l_purchasing_hold_reason VARCHAR2(255); l_hold_by NUMBER; l_hold_date DATE; l_vendor_terms_date_basis VARCHAR2(255); l_price_tolerance NUMBER; l_vendor_attribute10 VARCHAR2(255); l_vendor_attribute11 VARCHAR2(255); l_vendor_attribute12 VARCHAR2(255); l_vendor_attribute13 VARCHAR2(255); l_vendor_attribute14 VARCHAR2(255); l_vendor_attribute15 VARCHAR2(255); l_vendor_attribute6 VARCHAR2(255); l_vendor_attribute7 VARCHAR2(255); l_vendor_attribute8 VARCHAR2(255);
l_vendor_attribute9 VARCHAR2(255); l_days_early_receipt_allowed NUMBER; l_days_late_receipt_allowed NUMBER; l_enforce_ship_to_loc_code VARCHAR2(255); l_vendor_exclusive_pay_flag VARCHAR2(255); l_federal_reportable_flag VARCHAR2(255); l_vendor_hold_unm_inv_flag VARCHAR2(255); l_vendor_match_option VARCHAR2(255); l_vendor_create_dbt_memo_flag VARCHAR2(255); l_inspection_required_flag VARCHAR2(255); l_receipt_required_flag VARCHAR2(255); l_receiving_routing_id NUMBER; l_state_reportable_flag VARCHAR2(255); l_tax_verification_date DATE; l_auto_calculate_interest_flag VARCHAR2(255); l_name_control VARCHAR2(255); l_allow_subst_receipts_flag VARCHAR2(255); l_allow_unord_receipts_flag VARCHAR2(255); l_receipt_days_exception_code VARCHAR2(255); l_qty_rcv_exception_code VARCHAR2(255); l_vendor_offset_tax_flag VARCHAR2(255); l_vendor_ex_freight_from_disc VARCHAR2(255); l_vendor_vat_registration_num VARCHAR2(255); l_tax_reporting_name VARCHAR2(255); l_vendor_awt_group_id NUMBER; l_vendor_check_digits VARCHAR2(255); l_vendor_bank_number VARCHAR2(255); l_vendor_allow_awt_flag VARCHAR2(255); l_vendor_bank_branch_type VARCHAR2(255); l_vendor_edi_payment_method VARCHAR2(255); l_vendor_edi_payment_format VARCHAR2(255); l_vendor_edi_remittance_method VARCHAR2(255); l_vendor_edi_remitt_instruc VARCHAR2(255); l_vendor_edi_transaction_hand VARCHAR2(255); l_vendor_auto_tax_calc_flag VARCHAR2(255); l_vendor_auto_tax_calc_overrid VARCHAR2(255); l_vendor_amount_inc_tax_flag VARCHAR2(255); l_vendor_ap_tax_rounding_rule VARCHAR2(255); l_vendor_name_alt VARCHAR2(255); l_vd_global_attribute_category VARCHAR2(255); l_vendor_global_attribute1 VARCHAR2(255); l_vendor_global_attribute2 VARCHAR2(255); l_vendor_global_attribute3 VARCHAR2(255); l_vendor_global_attribute4 VARCHAR2(255); l_vendor_global_attribute5 VARCHAR2(255); l_vendor_global_attribute6 VARCHAR2(255); l_vendor_global_attribute7 VARCHAR2(255); l_vendor_global_attribute8 VARCHAR2(255); l_vendor_global_attribute9 VARCHAR2(255); l_vendor_global_attribute10 VARCHAR2(255); l_vendor_global_attribute11 VARCHAR2(255); l_vendor_global_attribute12 VARCHAR2(255); l_vendor_global_attribute13 VARCHAR2(255); l_vendor_global_attribute14 VARCHAR2(255); l_vendor_global_attribute15 VARCHAR2(255); l_vendor_global_attribute16 VARCHAR2(255); l_vendor_global_attribute17 VARCHAR2(255); l_vendor_global_attribute18 VARCHAR2(255); l_vendor_global_attribute19 VARCHAR2(255); l_vendor_global_attribute20 VARCHAR2(255); l_vendor_bank_charge_bearer VARCHAR2(255); l_vendor_calling_sequence VARCHAR2(255);
— variables for the arguments to update_row on the supplier site l_vendors_rowid VARCHAR2(255); l_vendor_site_id NUMBER; l_vendors_last_update_date DATE; l_vendors_last_updated_by NUMBER; l_vendors_vendor_id NUMBER; l_vendors_site_code VARCHAR2(255); l_last_update_login NUMBER; l_vendors_creation_date DATE; l_vendors_created_by NUMBER; l_purchasing_site_flag VARCHAR2(255); l_rfq_only_site_flag VARCHAR2(255); l_pay_site_flag VARCHAR2(255); l_attention_ar_flag VARCHAR2(255); l_address_line1 VARCHAR2(255); l_address_line2 VARCHAR2(255); l_address_line3 VARCHAR2(255); l_city VARCHAR2(255); l_state VARCHAR2(255); l_zip VARCHAR2(255); l_province VARCHAR2(255); l_country VARCHAR2(255); l_area_code VARCHAR2(255); l_phone VARCHAR2(255); l_vendors_customer_num VARCHAR2(255); l_vendors_ship_to_location_id NUMBER; l_vendors_bill_to_location_id NUMBER; l_vendors_ship_via_lookup_code VARCHAR2(255); l_vendors_frei_ter_lookup_code VARCHAR2(255); l_vendors_fob_lookup_code VARCHAR2(255); l_inactive_date DATE; l_fax VARCHAR2(255); l_fax_area_code VARCHAR2(255); l_telex VARCHAR2(255); l_vendors_pay_meth_look_code VARCHAR2(255); l_vendors_bank_account_name VARCHAR2(255); l_vendors_bank_account_num VARCHAR2(255); l_vendors_bank_num VARCHAR2(255); l_vendors_bank_account_type VARCHAR2(255); l_vendors_terms_date_basis VARCHAR2(255); l_current_catalog_num VARCHAR2(255); l_vendors_vat_code VARCHAR2(255); l_vendors_distribution_set_id NUMBER; l_vendors_accts_pay_ccid NUMBER; l_vendors_fut_dated_pay_ccid NUMBER; l_prepay_code_combination_id NUMBER; l_vendors_pay_group_look_code VARCHAR2(255); l_vendors_payment_priority NUMBER; l_vendors_terms_id NUMBER; l_vendors_invoice_amount_limit NUMBER; l_vend_pay_date_bas_look_code VARCHAR2(255); l_vendors_alw_take_disc_flag VARCHAR2(255); l_vendors_inv_currency_code VARCHAR2(255); l_vendors_payment_curr_code VARCHAR2(255); l_vendors_hold_all_pay_flag VARCHAR2(255); l_vendors_hold_future_pay_flag VARCHAR2(255); l_vendors_hold_reason VARCHAR2(255); l_vendors_hold_unma_inv_flag VARCHAR2(255); l_vendors_match_option VARCHAR2(255); l_vendors_create_dbt_memo_flag VARCHAR2(255); l_vendors_exclusive_pay_flag VARCHAR2(255); l_tax_reporting_site_flag VARCHAR2(255); l_vendors_attribute_category VARCHAR2(255); l_vendors_attribute1 VARCHAR2(255); l_vendors_attribute2 VARCHAR2(255);
l_vendors_attribute3 VARCHAR2(255); l_vendors_attribute4 VARCHAR2(255); l_vendors_attribute5 VARCHAR2(255); l_vendors_attribute6 VARCHAR2(255); l_vendors_attribute7 VARCHAR2(255); l_vendors_attribute8 VARCHAR2(255); l_vendors_attribute9 VARCHAR2(255); l_vendors_attribute10 VARCHAR2(255); l_vendors_attribute11 VARCHAR2(255); l_vendors_attribute12 VARCHAR2(255); l_vendors_attribute13 VARCHAR2(255); l_vendors_attribute14 VARCHAR2(255); l_vendors_attribute15 VARCHAR2(255); l_vendors_validation_number NUMBER; l_vendors_ex_freight_from_disc VARCHAR2(255); l_vendors_vat_registration_num VARCHAR2(255); l_vendors_offset_tax_flag VARCHAR2(255); l_vendors_check_digits VARCHAR2(255); l_vendors_bank_number VARCHAR2(255); l_address_line4 VARCHAR2(255); l_county VARCHAR2(255); l_address_style VARCHAR2(255); l_language VARCHAR2(255); l_vendors_allow_awt_flag VARCHAR2(255); l_vendors_awt_group_id NUMBER; l_pay_on_code VARCHAR2(255); l_default_pay_site_id NUMBER; l_pay_on_receipt_summary_code VARCHAR2(255); l_vendors_bank_branch_type VARCHAR2(255); l_edi_id_number VARCHAR2(255); l_vendors_edi_payment_method VARCHAR2(255); l_vendors_edi_payment_format VARCHAR2(255); l_vendors_edi_remittance_meth VARCHAR2(255); l_vendors_edi_remittance_inst VARCHAR2(255); l_vendors_edi_transaction_hand VARCHAR2(255); l_vendors_auto_tax_calc_flag VARCHAR2(255); l_vendors_auto_tax_calc_ove VARCHAR2(255); l_vendors_amt_includes_tax_flg VARCHAR2(255); l_vendors_ap_tax_rounding_rule VARCHAR2(255); l_vendors_site_code_alt VARCHAR2(255); l_address_lines_alt VARCHAR2(255); l_vs_global_attribute_category VARCHAR2(255); l_vendors_global_attribute1 VARCHAR2(255); l_vendors_global_attribute2 VARCHAR2(255); l_vendors_global_attribute3 VARCHAR2(255); l_vendors_global_attribute4 VARCHAR2(255); l_vendors_global_attribute5 VARCHAR2(255); l_vendors_global_attribute6 VARCHAR2(255); l_vendors_global_attribute7 VARCHAR2(255); l_vendors_global_attribute8 VARCHAR2(255); l_vendors_global_attribute9 VARCHAR2(255); l_vendors_global_attribute10 VARCHAR2(255); l_vendors_global_attribute11 VARCHAR2(255); l_vendors_global_attribute12 VARCHAR2(255); l_vendors_global_attribute13 VARCHAR2(255); l_vendors_global_attribute14 VARCHAR2(255); l_vendors_global_attribute15 VARCHAR2(255); l_vendors_global_attribute16 VARCHAR2(255); l_vendors_global_attribute17 VARCHAR2(255); l_vendors_global_attribute18 VARCHAR2(255); l_vendors_global_attribute19 VARCHAR2(255); l_vendors_global_attribute20 VARCHAR2(255); l_vendors_bank_charge_bearer VARCHAR2(255); l_ece_tp_location_code VARCHAR2(255); l_pcard_site_flag VARCHAR2(255);
l_country_of_origin_code VARCHAR2(255); l_vendors_calling_sequence VARCHAR2(255); l_supplier_notif_method VARCHAR2(255); l_email_address VARCHAR2(255); l_remittance_email VARCHAR2(255); l_primary_pay_site_flag VARCHAR2(255); l_shipping_control PO_VENDOR_SITES_ALL.SHIPPING_CONTROL%TYPE; l_duns_number PO_VENDOR_SITES_ALL.duns_number%TYPE; — variables for the arguments to update_row on the supplier site contact. l_con_vendor_contact_id po_vendor_contacts.vendor_contact_id%TYPE; — NUMBER; — po_vendor_contacts.vendor_contact_id%TYPE; l_con_first_name po_vendor_contacts.first_name%TYPE; — VARCHAR2 (255); — po_vendor_contacts.first_name%TYPE; l_con_last_name po_vendor_contacts.last_name%TYPE; — VARCHAR2 (255); — po_vendor_contacts.last_name%TYPE; l_con_middle_name po_vendor_contacts.middle_name%TYPE; — VARCHAR2 (255); — po_vendor_contacts.middle_name%TYPE; l_con_prefix po_vendor_contacts.prefix%TYPE; — VARCHAR2 (255); — po_vendor_contacts.prefix%TYPE; l_con_title po_vendor_contacts.title%TYPE; — VARCHAR2 (255); — po_vendor_contacts.title%TYPE; l_con_mail_stop po_vendor_contacts.mail_stop%TYPE; — VARCHAR2 (255); — po_vendor_contacts.mail_stop%TYPE; l_con_area_code po_vendor_contacts.area_code%TYPE; — VARCHAR2 (255); — po_vendor_contacts.area_code%TYPE; l_con_phone po_vendor_contacts.phone%TYPE; — VARCHAR2 (255); — po_vendor_contacts.phone%TYPE; l_con_alt_area_code po_vendor_contacts.alt_area_code%TYPE; — VARCHAR2 (255); — po_vendor_contacts.alt_area_code%TYPE; l_con_alt_phone po_vendor_contacts.alt_phone%TYPE; — VARCHAR2 (255); — po_vendor_contacts.alt_phone%TYPE; l_con_fax_area_code po_vendor_contacts.fax_area_code%TYPE; — VARCHAR2 (255); — po_vendor_contacts.fax_area_code%TYPE; l_con_fax po_vendor_contacts.fax%TYPE; — VARCHAR2 (255); — po_vendor_contacts.fax%TYPE; l_con_email_address po_vendor_contacts.email_address%TYPE; — VARCHAR2 (255); — po_vendor_contacts.email_address%TYPE; l_con_url po_vendor_contacts.url%TYPE; — VARCHAR2 (255); — po_vendor_contacts.url%TYPE; — dummy variables to receive exception data l_status VARCHAR2(1); l_exception_msg VARCHAR2(255); CURSOR vendor_cur IS SELECT rowid , vendor_id , last_update_date , last_updated_by , vendor_name , segment1 , summary_flag , enabled_flag , last_update_login , employee_id , validation_number , vendor_type_lookup_code , customer_num , one_time_flag , parent_vendor_id , min_order_amount , ship_to_location_id , bill_to_location_id , ship_via_lookup_code , freight_terms_lookup_code
, fob_lookup_code , terms_id , set_of_books_id , always_take_disc_flag , pay_date_basis_lookup_code , pay_group_lookup_code , payment_priority , invoice_currency_code , payment_currency_code , invoice_amount_limit , hold_all_payments_flag , hold_future_payments_flag , hold_reason , distribution_set_id , accts_pay_code_combination_id , future_dated_payment_ccid , prepay_code_combination_id , num_1099 , type_1099 , withholding_status_lookup_code , withholding_start_date , organization_type_lookup_code , vat_code , start_date_active , end_date_active , qty_rcv_tolerance , minority_group_lookup_code , payment_method_lookup_code , bank_account_name , bank_account_num , bank_num , bank_account_type , women_owned_flag , small_business_flag , standard_industry_class , attribute_category , attribute1 , attribute2 , attribute3 , attribute4 , attribute5 , hold_flag , purchasing_hold_reason , hold_by , hold_date , terms_date_basis , price_tolerance , attribute10 , attribute11 , attribute12 , attribute13 , attribute14 , attribute15 , attribute6 , attribute7 , attribute8 , attribute9 , days_early_receipt_allowed , days_late_receipt_allowed , enforce_ship_to_location_code , exclusive_payment_flag , federal_reportable_flag , hold_unmatched_invoices_flag , match_option , create_debit_memo_flag
, inspection_required_flag , receipt_required_flag , receiving_routing_id , state_reportable_flag , tax_verification_date , auto_calculate_interest_flag , name_control , allow_substitute_receipts_flag , allow_unordered_receipts_flag , receipt_days_exception_code , qty_rcv_exception_code , offset_tax_flag , exclude_freight_from_discount , vat_registration_num , tax_reporting_name , awt_group_id , check_digits , bank_number , allow_awt_flag , bank_branch_type , edi_payment_method , edi_payment_format , edi_remittance_method , edi_remittance_instruction , edi_transaction_handling , auto_tax_calc_flag , auto_tax_calc_override , amount_includes_tax_flag , ap_tax_rounding_rule , vendor_name_alt , global_attribute_category , global_attribute1 , global_attribute2 , global_attribute3 , global_attribute4 , global_attribute5 , global_attribute6 , global_attribute7 , global_attribute8 , global_attribute9 , global_attribute10 , global_attribute11 , global_attribute12 , global_attribute13 , global_attribute14 , global_attribute15 , global_attribute16 , global_attribute17 , global_attribute18 , global_attribute19 , global_attribute20 , bank_charge_bearer FROM po_vendors WHERE vendor_id IN (SELECT distinct vendor_id FROM xxx_xx_VENDORS_MASK); CURSOR vendor_sites_cur ( p_vendor_id po_vendor_sites.vendor_id%TYPE ) IS SELECT rowid , vendor_site_id , last_update_date , last_updated_by , vendor_id , vendor_site_code , last_update_login , creation_date
, created_by , purchasing_site_flag , rfq_only_site_flag , pay_site_flag , attention_ar_flag , address_line1 , address_line2 , address_line3 , city , state , zip , province , country , area_code , phone , customer_num , ship_to_location_id , bill_to_location_id , ship_via_lookup_code , freight_terms_lookup_code , fob_lookup_code , inactive_date , fax , fax_area_code , telex , payment_method_lookup_code , bank_account_name , bank_account_num , bank_num , bank_account_type , terms_date_basis , current_catalog_num , vat_code , distribution_set_id , accts_pay_code_combination_id , future_dated_payment_ccid , prepay_code_combination_id , pay_group_lookup_code , payment_priority , terms_id , invoice_amount_limit , pay_date_basis_lookup_code , always_take_disc_flag , invoice_currency_code , payment_currency_code , hold_all_payments_flag , hold_future_payments_flag , hold_reason , hold_unmatched_invoices_flag , match_option , create_debit_memo_flag , exclusive_payment_flag , tax_reporting_site_flag , attribute_category , attribute1 , attribute2 , attribute3 , attribute4 , attribute5 , attribute6 , attribute7 , attribute8 , attribute9 , attribute10 , attribute11
, attribute12 , attribute13 , attribute14 , attribute15 , validation_number , exclude_freight_from_discount , vat_registration_num , offset_tax_flag , check_digits , bank_number , address_line4 , county , address_style , language , allow_awt_flag , awt_group_id , pay_on_code , default_pay_site_id , pay_on_receipt_summary_code , bank_branch_type , edi_id_number , edi_payment_method , edi_payment_format , edi_remittance_method , edi_remittance_instruction , edi_transaction_handling , auto_tax_calc_flag , auto_tax_calc_override , amount_includes_tax_flag , ap_tax_rounding_rule , vendor_site_code_alt , address_lines_alt , global_attribute_category , global_attribute1 , global_attribute2 , global_attribute3 , global_attribute4 , global_attribute5 , global_attribute6 , global_attribute7 , global_attribute8 , global_attribute9 , global_attribute10 , global_attribute11 , global_attribute12 , global_attribute13 , global_attribute14 , global_attribute15 , global_attribute16 , global_attribute17 , global_attribute18 , global_attribute19 , global_attribute20 , bank_charge_bearer , ece_tp_location_code , pcard_site_flag , country_of_origin_code , supplier_notif_method , email_address , remittance_email , primary_pay_site_flag , shipping_control , duns_number , org_id FROM po_vendor_sites_all
WHERE vendor_id = p_vendor_id AND vendor_site_id IN (SELECT vendor_site_id FROM xxx_xx_VENDORS_MASK WHERE vendor_id = p_vendor_id); CURSOR vendor_site_contact_cur (p_vendor_site_id po_vendor_contacts.vendor_site_id%TYPE ) IS SELECT rowid , vendor_contact_id , first_name , last_name , middle_name , prefix , title , mail_stop , area_code , phone , alt_area_code , alt_phone , fax_area_code , fax , email_address , url FROM po_vendor_contacts WHERE vendor_site_id = p_vendor_site_id; CURSOR bank_account_uses_cur ( p_vendor_site_id ap_bank_account_uses_all.vendor_site_id%TYPE ) IS SELECT rowid , bank_account_uses_id , vendor_id , vendor_site_id , external_bank_account_id , end_date FROM ap_bank_account_uses_all WHERE vendor_site_id = p_vendor_site_id; CURSOR bank_account_uses_header_cur ( p_vendor_id ap_bank_account_uses_all.vendor_id%TYPE ) IS SELECT rowid , bank_account_uses_id , vendor_id , vendor_site_id , external_bank_account_id , end_date FROM ap_bank_account_uses_all WHERE vendor_id = p_vendor_id AND vendor_site_id IS NULL; BEGIN
FOR vendor_rec IN vendor_cur LOOP l_tot_sites := 0; l_tot_sites_to_mask := 0; SELECT COUNT (*) INTO l_tot_sites FROM po_vendor_sites_all WHERE vendor_id = vendor_rec.vendor_id; SELECT COUNT (*) INTO l_tot_sites_to_mask FROM xxefss_xx_vendors_mask WHERE vendor_id = vendor_rec.vendor_id; IF l_tot_sites = l_tot_sites_to_mask THEN
l_count_customers := l_count_customers + 1; l_vendor_rowid := vendor_rec.rowid; l_vendor_vendor_id := vendor_rec.vendor_id; l_vendor_last_update_date := vendor_rec.last_update_date; l_vendor_last_updated_by := vendor_rec.last_updated_by; l_vendor_name := vendor_rec.vendor_name; l_segment1 := vendor_rec.segment1; l_summary_flag := vendor_rec.summary_flag; l_enabled_flag := vendor_rec.enabled_flag; l_vendor_last_update_login := vendor_rec.last_update_login; — l_employee_id := vendor_rec.employee_id; l_vendor_validation_number := vendor_rec.validation_number; l_vendor_type_lookup_code := vendor_rec.vendor_type_lookup_code; l_vendor_customer_num := vendor_rec.customer_num; l_one_time_flag := vendor_rec.one_time_flag; l_parent_vendor_id := vendor_rec.parent_vendor_id; l_min_order_amount := vendor_rec.min_order_amount; l_vendor_ship_to_location_id := vendor_rec.ship_to_location_id; l_vendor_bill_to_location_id := vendor_rec.bill_to_location_id; l_vendor_ship_via_lookup_code := vendor_rec.ship_via_lookup_code; l_vend_frei_terms_lookup_code := vendor_rec.freight_terms_lookup_code; l_vendor_fob_lookup_code := vendor_rec.fob_lookup_code; l_vendor_terms_id := vendor_rec.terms_id; l_set_of_books_id := vendor_rec.set_of_books_id; l_vendor_always_take_disc_flag := vendor_rec.always_take_disc_flag; l_ven_pay_date_bas_look_code := vendor_rec.pay_date_basis_lookup_code; l_vendor_pay_group_lookup_code := vendor_rec.pay_group_lookup_code; l_vendor_payment_priority := vendor_rec.payment_priority; l_vendor_invoice_currency_code := vendor_rec.invoice_currency_code; l_vendor_payment_currency_code := vendor_rec.payment_currency_code; l_vendor_invoice_amount_limit := vendor_rec.invoice_amount_limit; l_vendor_hold_all_pay_flag := vendor_rec.hold_all_payments_flag; l_vendor_hold_fut_pay_flag := vendor_rec.hold_future_payments_flag; l_vendor_hold_reason := vendor_rec.hold_reason; l_vendor_distribution_set_id := vendor_rec.distribution_set_id; l_vendor_accts_pay_ccid := vendor_rec.accts_pay_code_combination_id; l_vendor_fut_dated_pay_ccid := vendor_rec.future_dated_payment_ccid; l_prepay_ccid := vendor_rec.prepay_code_combination_id; l_num_1099 := vendor_rec.num_1099; l_type_1099 := vendor_rec.type_1099; l_withholding_stat_lookup_code := vendor_rec.withholding_status_lookup_code; l_withholding_start_date := vendor_rec.withholding_start_date; l_org_type_lookup_code := vendor_rec.organization_type_lookup_code; l_vendor_vat_code := vendor_rec.vat_code; l_start_date_active := vendor_rec.start_date_active; l_end_date_active := vendor_rec.end_date_active; l_qty_rcv_tolerance := vendor_rec.qty_rcv_tolerance; l_minority_group_lookup_code := vendor_rec.minority_group_lookup_code; l_vendor_pay_meth_lookup_code := vendor_rec.payment_method_lookup_code; l_vendor_bank_account_name := vendor_rec.bank_account_name; l_vendor_bank_account_num := vendor_rec.bank_account_num; l_vendor_bank_num := vendor_rec.bank_num; l_vendor_bank_account_type := vendor_rec.bank_account_type; l_women_owned_flag := vendor_rec.women_owned_flag; l_small_business_flag := vendor_rec.small_business_flag; l_standard_industry_class := vendor_rec.standard_industry_class; l_vendor_attribute_category := vendor_rec.attribute_category; l_vendor_attribute1 := vendor_rec.attribute1; l_vendor_attribute2 := vendor_rec.attribute2; l_vendor_attribute3 := vendor_rec.attribute3; l_vendor_attribute4 := vendor_rec.attribute4; l_vendor_attribute5 := vendor_rec.attribute5; l_hold_flag := vendor_rec.hold_flag;
l_purchasing_hold_reason := vendor_rec.purchasing_hold_reason; l_hold_by := vendor_rec.hold_by; l_hold_date := vendor_rec.hold_date; l_vendor_terms_date_basis := vendor_rec.terms_date_basis; l_price_tolerance := vendor_rec.price_tolerance; l_vendor_attribute10 := vendor_rec.attribute10; l_vendor_attribute11 := vendor_rec.attribute11; l_vendor_attribute12 := vendor_rec.attribute12; l_vendor_attribute13 := vendor_rec.attribute13; l_vendor_attribute14 := vendor_rec.attribute14; l_vendor_attribute15 := vendor_rec.attribute15; l_vendor_attribute6 := vendor_rec.attribute6; l_vendor_attribute7 := vendor_rec.attribute7; l_vendor_attribute8 := vendor_rec.attribute8; l_vendor_attribute9 := vendor_rec.attribute9; l_days_early_receipt_allowed := vendor_rec.days_early_receipt_allowed; l_days_late_receipt_allowed := vendor_rec.days_late_receipt_allowed; l_enforce_ship_to_loc_code := vendor_rec.enforce_ship_to_location_code; l_vendor_exclusive_pay_flag := vendor_rec.exclusive_payment_flag; l_federal_reportable_flag := vendor_rec.federal_reportable_flag; l_vendor_hold_unm_inv_flag := vendor_rec.hold_unmatched_invoices_flag; l_vendor_match_option := vendor_rec.match_option; l_vendor_create_dbt_memo_flag := vendor_rec.create_debit_memo_flag; l_inspection_required_flag := vendor_rec.inspection_required_flag; l_receipt_required_flag := vendor_rec.receipt_required_flag; l_receiving_routing_id := vendor_rec.receiving_routing_id; l_state_reportable_flag := vendor_rec.state_reportable_flag; l_tax_verification_date := vendor_rec.tax_verification_date; l_auto_calculate_interest_flag := vendor_rec.auto_calculate_interest_flag; l_name_control := vendor_rec.name_control; l_allow_subst_receipts_flag := vendor_rec.allow_substitute_receipts_flag; l_allow_unord_receipts_flag := vendor_rec.allow_unordered_receipts_flag; l_receipt_days_exception_code := vendor_rec.receipt_days_exception_code; l_qty_rcv_exception_code := vendor_rec.qty_rcv_exception_code; l_vendor_offset_tax_flag := vendor_rec.offset_tax_flag; l_vendor_ex_freight_from_disc := vendor_rec.exclude_freight_from_discount; l_vendor_vat_registration_num := vendor_rec.vat_registration_num; l_tax_reporting_name := vendor_rec.tax_reporting_name; l_vendor_awt_group_id := vendor_rec.awt_group_id; l_vendor_check_digits := vendor_rec.check_digits; l_vendor_bank_number := vendor_rec.bank_number; l_vendor_allow_awt_flag := vendor_rec.allow_awt_flag; l_vendor_bank_branch_type := vendor_rec.bank_branch_type; l_vendor_edi_payment_method := vendor_rec.edi_payment_method; l_vendor_edi_payment_format := vendor_rec.edi_payment_format; l_vendor_edi_remittance_method := vendor_rec.edi_remittance_method; l_vendor_edi_remitt_instruc := vendor_rec.edi_remittance_instruction; l_vendor_edi_transaction_hand := vendor_rec.edi_transaction_handling; l_vendor_auto_tax_calc_flag := vendor_rec.auto_tax_calc_flag; l_vendor_auto_tax_calc_overrid := vendor_rec.auto_tax_calc_override; l_vendor_amount_inc_tax_flag := vendor_rec.amount_includes_tax_flag; l_vendor_ap_tax_rounding_rule := vendor_rec.ap_tax_rounding_rule; l_vendor_name_alt := vendor_rec.vendor_name_alt; l_vd_global_attribute_category := vendor_rec.global_attribute_category; l_vendor_global_attribute1 := vendor_rec.global_attribute1; l_vendor_global_attribute2 := vendor_rec.global_attribute2; l_vendor_global_attribute3 := vendor_rec.global_attribute3; l_vendor_global_attribute4 := vendor_rec.global_attribute4; l_vendor_global_attribute5 := vendor_rec.global_attribute5; l_vendor_global_attribute6 := vendor_rec.global_attribute6; l_vendor_global_attribute7 := vendor_rec.global_attribute7; l_vendor_global_attribute8 := vendor_rec.global_attribute8; l_vendor_global_attribute9 := vendor_rec.global_attribute9; l_vendor_global_attribute10 := vendor_rec.global_attribute10; l_vendor_global_attribute11 := vendor_rec.global_attribute11;
l_vendor_global_attribute12 := vendor_rec.global_attribute12; l_vendor_global_attribute13 := vendor_rec.global_attribute13; l_vendor_global_attribute14 := vendor_rec.global_attribute14; l_vendor_global_attribute15 := vendor_rec.global_attribute15; l_vendor_global_attribute16 := vendor_rec.global_attribute16; l_vendor_global_attribute17 := vendor_rec.global_attribute17; l_vendor_global_attribute18 := vendor_rec.global_attribute18; l_vendor_global_attribute19 := vendor_rec.global_attribute19; l_vendor_global_attribute20 := vendor_rec.global_attribute20; l_vendor_bank_charge_bearer := vendor_rec.bank_charge_bearer; — Below it’s the infomraction we’re going to get replaced………. l_vendor_name := ‘XXXXXX’||vendor_rec.vendor_id; l_segment1 := ‘XXXXXX’||vendor_rec.vendor_id; l_num_1099 := ‘XXXXXX’; l_vendor_vat_registration_num := ‘XXXXXX’; l_vendor_attribute1 := ‘N’; — Requested by Richard viernes 02/11/2007 13:36 l_vendor_attribute15 := ‘XXXXXX’; l_vendor_attribute2 := ‘XXXXXX’; l_vendor_attribute3 := ‘XXXXXX’; l_vendor_attribute5 := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendor_attribute6 := ‘XXXXXX’; — Requested by Richard viernes 02/11/2007 13:36 l_vendor_attribute7 := ‘XXXXXX’; — Requested by Richard viernes 02/11/2007 13:36 l_vendor_name_alt := ‘XXXXXX’; l_vendor_pay_meth_lookup_code := ‘CHECK’; — Requested by Richard viernes 02/11/2007 13:36 l_end_date_active := SYSDATE; l_employee_id := NULL; BEGIN AP_VENDORS_PKG.Update_Row( x_rowid => l_vendor_rowid, x_vendor_id => l_vendor_vendor_id, x_last_update_date => SYSDATE, x_last_updated_by => fnd_global.user_id, x_vendor_name => l_vendor_name, x_segment1 => l_segment1, x_summary_flag => l_summary_flag, x_enabled_flag => l_enabled_flag, x_last_update_login => fnd_global.login_id, x_employee_id => l_employee_id, x_validation_number => l_vendor_validation_number, x_vendor_type_lookup_code => l_vendor_type_lookup_code, x_customer_num => l_vendor_customer_num, x_one_time_flag => l_one_time_flag, x_parent_vendor_id => l_parent_vendor_id, x_min_order_amount => l_min_order_amount, x_ship_to_location_id => l_vendor_ship_to_location_id, x_bill_to_location_id => l_vendor_bill_to_location_id, x_ship_via_lookup_code => l_vendor_ship_via_lookup_code, x_freight_terms_lookup_code => l_vend_frei_terms_lookup_code, x_fob_lookup_code => l_vendor_fob_lookup_code, x_terms_id => l_vendor_terms_id, x_set_of_books_id => l_set_of_books_id, x_always_take_disc_flag => l_vendor_always_take_disc_flag, x_pay_date_basis_lookup_code => l_ven_pay_date_bas_look_code, x_pay_group_lookup_code => l_vendor_pay_group_lookup_code, x_payment_priority => l_vendor_payment_priority, x_invoice_currency_code => l_vendor_invoice_currency_code, x_payment_currency_code =>
l_vendor_payment_currency_code, x_invoice_amount_limit => l_vendor_invoice_amount_limit, x_hold_all_payments_flag => l_vendor_hold_all_pay_flag, x_hold_future_payments_flag => l_vendor_hold_fut_pay_flag, x_hold_reason => l_vendor_hold_reason, x_distribution_set_id => l_vendor_distribution_set_id, x_accts_pay_ccid => l_vendor_accts_pay_ccid, x_future_dated_payment_ccid => l_vendor_fut_dated_pay_ccid, x_prepay_ccid => l_prepay_ccid, x_num_1099 => l_num_1099, x_type_1099 => l_type_1099, x_withholding_stat_lookup_code => l_withholding_stat_lookup_code, x_withholding_start_date => l_withholding_start_date, x_org_type_lookup_code => l_org_type_lookup_code, x_vat_code => l_vendor_vat_code, x_start_date_active => l_start_date_active, x_end_date_active => l_end_date_active, x_qty_rcv_tolerance => l_qty_rcv_tolerance, x_minority_group_lookup_code => l_minority_group_lookup_code, x_payment_method_lookup_code => l_vendor_pay_meth_lookup_code, x_bank_account_name => l_vendor_bank_account_name, x_bank_account_num => l_vendor_bank_account_num, x_bank_num => l_vendor_bank_num, x_bank_account_type => l_vendor_bank_account_type, x_women_owned_flag => l_women_owned_flag, x_small_business_flag => l_small_business_flag, x_standard_industry_class => l_standard_industry_class, x_attribute_category => l_vendor_attribute_category, x_attribute1 => l_vendor_attribute1, x_attribute2 => l_vendor_attribute2, x_attribute3 => l_vendor_attribute3, x_attribute4 => l_vendor_attribute4, x_attribute5 => l_vendor_attribute5, x_hold_flag => l_hold_flag, x_purchasing_hold_reason => l_purchasing_hold_reason, x_hold_by => l_hold_by, x_hold_date => l_hold_date, x_terms_date_basis => l_vendor_terms_date_basis, x_price_tolerance => l_price_tolerance, x_attribute10 => l_vendor_attribute10, x_attribute11 => l_vendor_attribute11, x_attribute12 => l_vendor_attribute12, x_attribute13 => l_vendor_attribute13, x_attribute14 => l_vendor_attribute14, x_attribute15 => l_vendor_attribute15, x_attribute6 => l_vendor_attribute6, x_attribute7 => l_vendor_attribute7, x_attribute8 => l_vendor_attribute8, x_attribute9 => l_vendor_attribute9, x_days_early_receipt_allowed => l_days_early_receipt_allowed, x_days_late_receipt_allowed => l_days_late_receipt_allowed, x_enforce_ship_to_loc_code => l_enforce_ship_to_loc_code, x_exclusive_payment_flag => l_vendor_exclusive_pay_flag, x_federal_reportable_flag => l_federal_reportable_flag, x_hold_unmatched_invoices_flag => l_vendor_hold_unm_inv_flag, x_match_option => l_vendor_match_option, x_create_debit_memo_flag => l_vendor_create_dbt_memo_flag, x_inspection_required_flag => l_inspection_required_flag, x_receipt_required_flag => l_receipt_required_flag, x_receiving_routing_id => l_receiving_routing_id, x_state_reportable_flag => l_state_reportable_flag, x_tax_verification_date => l_tax_verification_date, x_auto_calculate_interest_flag => l_auto_calculate_interest_flag,
x_name_control => l_name_control, x_allow_subst_receipts_flag => l_allow_subst_receipts_flag, x_allow_unord_receipts_flag => l_allow_unord_receipts_flag, x_receipt_days_exception_code => l_receipt_days_exception_code, x_qty_rcv_exception_code => l_qty_rcv_exception_code, x_offset_tax_flag => l_vendor_offset_tax_flag, x_exclude_freight_from_disc => l_vendor_ex_freight_from_disc, x_vat_registration_num => l_vendor_vat_registration_num, x_tax_reporting_name => l_tax_reporting_name, x_awt_group_id => l_vendor_awt_group_id, x_check_digits => l_vendor_check_digits, x_bank_number => l_vendor_bank_number, x_allow_awt_flag => l_vendor_allow_awt_flag, x_bank_branch_type => l_vendor_bank_branch_type, x_edi_payment_method => l_vendor_edi_payment_method, x_edi_payment_format => l_vendor_edi_payment_format, x_edi_remittance_method => l_vendor_edi_remittance_method, x_edi_remittance_instruction => l_vendor_edi_remitt_instruc, x_edi_transaction_handling => l_vendor_edi_transaction_hand, x_auto_tax_calc_flag => l_vendor_auto_tax_calc_flag, x_auto_tax_calc_override => l_vendor_auto_tax_calc_overrid, x_amount_includes_tax_flag => l_vendor_amount_inc_tax_flag, x_ap_tax_rounding_rule => l_vendor_ap_tax_rounding_rule, x_vendor_name_alt => l_vendor_name_alt, x_global_attribute_category => l_vd_global_attribute_category, x_global_attribute1 => l_vendor_global_attribute1, x_global_attribute2 => l_vendor_global_attribute2, x_global_attribute3 => l_vendor_global_attribute3, x_global_attribute4 => l_vendor_global_attribute4, x_global_attribute5 => l_vendor_global_attribute5, x_global_attribute6 => l_vendor_global_attribute6, x_global_attribute7 => l_vendor_global_attribute7, x_global_attribute8 => l_vendor_global_attribute8, x_global_attribute9 => l_vendor_global_attribute9, x_global_attribute10 => l_vendor_global_attribute10, x_global_attribute11 => l_vendor_global_attribute11, x_global_attribute12 => l_vendor_global_attribute12, x_global_attribute13 => l_vendor_global_attribute13, x_global_attribute14 => l_vendor_global_attribute14, x_global_attribute15 => l_vendor_global_attribute15, x_global_attribute16 => l_vendor_global_attribute16, x_global_attribute17 => l_vendor_global_attribute17, x_global_attribute18 => l_vendor_global_attribute18, x_global_attribute19 => l_vendor_global_attribute19, x_global_attribute20 => l_vendor_global_attribute20, x_bank_charge_bearer => l_vendor_bank_charge_bearer, x_calling_sequence => null);
FOR bank_account_uses_header_rec IN bank_account_uses_header_cur (l_vendor_vendor_id) LOOP BEGIN l_count_site_bank_h := l_count_site_bank_h + 1; AP_BANK_ACCOUNT_USES_PKG.Delete_Row(X_Rowid => bank_account_uses_header_rec.rowid ); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(’Error deleting acct uses (header). ‘ || l_vendor_vendor_id || ‘ – ‘ || sqlerrm); END;
END LOOP;
EXCEPTION WHEN OTHERS THEN dbms_output.put_line(’Others for vendor: ‘ ||l_vendor_vendor_id || ‘ – ‘ || sqlerrm); END; END IF; — finsi for l_tot_sites = l_tot_sites_to_mask
FOR vendor_sites_rec IN vendor_sites_cur (vendor_rec.vendor_id) LOOP FND_CLIENT_INFO.set_org_context( vendor_sites_rec.org_id ); l_count_cus_sites := l_count_cus_sites + 1; l_vendors_rowid := vendor_sites_rec.rowid; l_vendor_site_id := vendor_sites_rec.vendor_site_id; l_vendors_last_update_date := vendor_sites_rec.last_update_date; l_vendors_last_updated_by := vendor_sites_rec.last_updated_by; l_vendors_vendor_id := vendor_sites_rec.vendor_id; l_vendors_site_code := vendor_sites_rec.vendor_site_code; l_last_update_login := vendor_sites_rec.last_update_login; l_vendors_creation_date := vendor_sites_rec.creation_date; l_vendors_created_by := vendor_sites_rec.created_by; l_purchasing_site_flag := vendor_sites_rec.purchasing_site_flag; l_rfq_only_site_flag := vendor_sites_rec.rfq_only_site_flag; l_pay_site_flag := vendor_sites_rec.pay_site_flag; l_attention_ar_flag := vendor_sites_rec.attention_ar_flag; l_address_line1 := vendor_sites_rec.address_line1; l_address_line2 := vendor_sites_rec.address_line2; l_address_line3 := vendor_sites_rec.address_line3; l_city := vendor_sites_rec.city; l_state := vendor_sites_rec.state; l_zip := vendor_sites_rec.zip; l_province := vendor_sites_rec.province; l_country := vendor_sites_rec.country; l_area_code := vendor_sites_rec.area_code; l_phone := vendor_sites_rec.phone; l_vendors_customer_num := vendor_sites_rec.customer_num; l_vendors_ship_to_location_id := vendor_sites_rec.ship_to_location_id; l_vendors_bill_to_location_id := vendor_sites_rec.bill_to_location_id; l_vendors_ship_via_lookup_code := vendor_sites_rec.ship_via_lookup_code; l_vendors_frei_ter_lookup_code := vendor_sites_rec.freight_terms_lookup_code; l_vendors_fob_lookup_code := vendor_sites_rec.fob_lookup_code; l_inactive_date := vendor_sites_rec.inactive_date; l_fax := vendor_sites_rec.fax; l_fax_area_code := vendor_sites_rec.fax_area_code; l_telex := vendor_sites_rec.telex; l_vendors_pay_meth_look_code := vendor_sites_rec.payment_method_lookup_code; l_vendors_bank_account_name := vendor_sites_rec.bank_account_name; l_vendors_bank_account_num := vendor_sites_rec.bank_account_num; l_vendors_bank_num := vendor_sites_rec.bank_num; l_vendors_bank_account_type := vendor_sites_rec.bank_account_type; l_vendors_terms_date_basis := vendor_sites_rec.terms_date_basis; l_current_catalog_num := vendor_sites_rec.current_catalog_num; l_vendors_vat_code := vendor_sites_rec.vat_code; l_vendors_distribution_set_id := vendor_sites_rec.distribution_set_id; l_vendors_accts_pay_ccid := vendor_sites_rec.accts_pay_code_combination_id; l_vendors_fut_dated_pay_ccid := vendor_sites_rec.future_dated_payment_ccid; l_prepay_code_combination_id := vendor_sites_rec.prepay_code_combination_id; l_vendors_pay_group_look_code := vendor_sites_rec.pay_group_lookup_code; l_vendors_payment_priority := vendor_sites_rec.payment_priority; l_vendors_terms_id := vendor_sites_rec.terms_id;
l_vendors_invoice_amount_limit := vendor_sites_rec.invoice_amount_limit; l_vend_pay_date_bas_look_code := vendor_sites_rec.pay_date_basis_lookup_code; l_vendors_alw_take_disc_flag := vendor_sites_rec.always_take_disc_flag; l_vendors_inv_currency_code := vendor_sites_rec.invoice_currency_code; l_vendors_payment_curr_code := vendor_sites_rec.payment_currency_code; l_vendors_hold_all_pay_flag := vendor_sites_rec.hold_all_payments_flag; l_vendors_hold_future_pay_flag := vendor_sites_rec.hold_future_payments_flag; l_vendors_hold_reason := vendor_sites_rec.hold_reason; l_vendors_hold_unma_inv_flag := vendor_sites_rec.hold_unmatched_invoices_flag; l_vendors_match_option := vendor_sites_rec.match_option; l_vendors_create_dbt_memo_flag := vendor_sites_rec.create_debit_memo_flag; l_vendors_exclusive_pay_flag := vendor_sites_rec.exclusive_payment_flag; l_tax_reporting_site_flag := vendor_sites_rec.tax_reporting_site_flag; l_vendors_attribute_category := vendor_sites_rec.attribute_category; l_vendors_attribute1 := vendor_sites_rec.attribute1; l_vendors_attribute2 := vendor_sites_rec.attribute2; l_vendors_attribute3 := vendor_sites_rec.attribute3; l_vendors_attribute4 := vendor_sites_rec.attribute4; l_vendors_attribute5 := vendor_sites_rec.attribute5; l_vendors_attribute6 := vendor_sites_rec.attribute6; l_vendors_attribute7 := vendor_sites_rec.attribute7; l_vendors_attribute8 := vendor_sites_rec.attribute8; l_vendors_attribute9 := vendor_sites_rec.attribute9; l_vendors_attribute10 := vendor_sites_rec.attribute10; l_vendors_attribute11 := vendor_sites_rec.attribute11; l_vendors_attribute12 := vendor_sites_rec.attribute12; l_vendors_attribute13 := vendor_sites_rec.attribute13; l_vendors_attribute14 := vendor_sites_rec.attribute14; l_vendors_attribute15 := vendor_sites_rec.attribute15; l_vendors_validation_number := vendor_sites_rec.validation_number; l_vendors_ex_freight_from_disc := vendor_sites_rec.exclude_freight_from_discount; l_vendors_vat_registration_num := vendor_sites_rec.vat_registration_num; l_vendors_offset_tax_flag := vendor_sites_rec.offset_tax_flag; l_vendors_check_digits := vendor_sites_rec.check_digits; l_vendors_bank_number := vendor_sites_rec.bank_number; l_address_line4 := vendor_sites_rec.address_line4; l_county := vendor_sites_rec.county; l_address_style := vendor_sites_rec.address_style; l_language := vendor_sites_rec.language; l_vendors_allow_awt_flag := vendor_sites_rec.allow_awt_flag; l_vendors_awt_group_id := vendor_sites_rec.awt_group_id; l_pay_on_code := vendor_sites_rec.pay_on_code; l_default_pay_site_id := vendor_sites_rec.default_pay_site_id; l_pay_on_receipt_summary_code := vendor_sites_rec.pay_on_receipt_summary_code; l_vendors_bank_branch_type := vendor_sites_rec.bank_branch_type; l_edi_id_number := vendor_sites_rec.edi_id_number; l_vendors_edi_payment_method := vendor_sites_rec.edi_payment_method; l_vendors_edi_payment_format := vendor_sites_rec.edi_payment_format; l_vendors_edi_remittance_meth := vendor_sites_rec.edi_remittance_method; l_vendors_edi_remittance_inst := vendor_sites_rec.edi_remittance_instruction; l_vendors_edi_transaction_hand := vendor_sites_rec.edi_transaction_handling; l_vendors_auto_tax_calc_flag := vendor_sites_rec.auto_tax_calc_flag; l_vendors_auto_tax_calc_ove := vendor_sites_rec.auto_tax_calc_override; l_vendors_amt_includes_tax_flg := vendor_sites_rec.amount_includes_tax_flag; l_vendors_ap_tax_rounding_rule := vendor_sites_rec.ap_tax_rounding_rule; l_vendors_site_code_alt := vendor_sites_rec.vendor_site_code_alt; l_address_lines_alt := vendor_sites_rec.address_lines_alt; l_vs_global_attribute_category := vendor_sites_rec.global_attribute_category; l_vendors_global_attribute1 := vendor_sites_rec.global_attribute1; l_vendors_global_attribute2 := vendor_sites_rec.global_attribute2; l_vendors_global_attribute3 := vendor_sites_rec.global_attribute3; l_vendors_global_attribute4 := vendor_sites_rec.global_attribute4; l_vendors_global_attribute5 := vendor_sites_rec.global_attribute5; l_vendors_global_attribute6 := vendor_sites_rec.global_attribute6; l_vendors_global_attribute7 := vendor_sites_rec.global_attribute7;
l_vendors_global_attribute8 := vendor_sites_rec.global_attribute8; l_vendors_global_attribute9 := vendor_sites_rec.global_attribute9; l_vendors_global_attribute10 := vendor_sites_rec.global_attribute10; l_vendors_global_attribute11 := vendor_sites_rec.global_attribute11; l_vendors_global_attribute12 := vendor_sites_rec.global_attribute12; l_vendors_global_attribute13 := vendor_sites_rec.global_attribute13; l_vendors_global_attribute14 := vendor_sites_rec.global_attribute14; l_vendors_global_attribute15 := vendor_sites_rec.global_attribute15; l_vendors_global_attribute16 := vendor_sites_rec.global_attribute16; l_vendors_global_attribute17 := vendor_sites_rec.global_attribute17; l_vendors_global_attribute18 := vendor_sites_rec.global_attribute18; l_vendors_global_attribute19 := vendor_sites_rec.global_attribute19; l_vendors_global_attribute20 := vendor_sites_rec.global_attribute20; l_vendors_bank_charge_bearer := vendor_sites_rec.bank_charge_bearer; l_ece_tp_location_code := vendor_sites_rec.ece_tp_location_code; l_pcard_site_flag := vendor_sites_rec.pcard_site_flag; l_country_of_origin_code := vendor_sites_rec.country_of_origin_code; l_vendors_calling_sequence := null; — vendor_sites_rec.calling_sequence; — l_shipping_location_id := vendor_sites_rec.shipping_location_id; l_supplier_notif_method := vendor_sites_rec.supplier_notif_method; l_email_address := vendor_sites_rec.email_address; l_remittance_email := vendor_sites_rec.remittance_email; l_primary_pay_site_flag := vendor_sites_rec.primary_pay_site_flag; l_shipping_control := vendor_sites_rec.shipping_control; l_duns_number := vendor_sites_rec.duns_number; — Below it’s the infomraction we’re going to get replaced………. l_vendors_site_code := vendor_sites_rec.vendor_site_id; l_address_line1 := ‘XXXXXX’; l_address_line2 := ‘XXXXXX’; l_address_line3 := ‘XXXXXX’; l_city := ‘XXXXXX’; l_state := ‘XXXXXX’; l_zip := ‘XXXXXX’; l_province := ‘XXXXXX’; l_country := ‘XXXXXX’; l_area_code := ‘XXXXXX’; l_phone := ‘XXXXXX’; l_fax := ‘XXXXXX’; l_fax_area_code := ‘XXXXXX’; l_vendors_accts_pay_ccid := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_fut_dated_pay_ccid := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_prepay_code_combination_id := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_pay_meth_look_code := ‘CHECK’; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_ship_to_location_id := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_bill_to_location_id := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_ship_via_lookup_code := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_frei_ter_lookup_code := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_fob_lookup_code := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_vat_registration_num := ‘XXXXXX’; l_vendors_attribute1 := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_attribute2 := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_attribute3 := NULL; — Requested by Richard viernes 02/11/2007 13:36 l_vendors_attribute4 := NULL; l_vendors_attribute5 := NULL; l_vendors_attribute6 := NULL; l_vendors_attribute7 := NULL; l_vendors_attribute8 := NULL;
l_vendors_attribute9 := NULL; l_vendors_attribute10 := NULL; l_vendors_attribute11 := NULL; l_vendors_attribute12 := NULL; l_vendors_attribute13 := NULL; l_vendors_attribute14 := NULL; l_vendors_attribute15 := NULL; l_inactive_date := SYSDATE; BEGIN ap_vendor_sites_pkg.update_row( x_rowid => l_vendors_rowid, x_vendor_site_id => l_Vendor_Site_Id, x_last_update_date => SYSDATE, x_last_updated_by => fnd_global.user_id, x_vendor_id => l_vendors_vendor_id, x_vendor_site_code => l_vendors_site_code, x_last_update_login => fnd_global.login_id, x_creation_date => l_vendors_creation_date, x_created_by => l_vendors_created_by, x_purchasing_site_flag => l_purchasing_site_flag, x_rfq_only_site_flag => l_rfq_only_site_flag, x_pay_site_flag => l_pay_site_flag, x_attention_ar_flag => l_attention_ar_flag, x_address_line1 => l_address_line1, x_address_line2 => l_address_line2, x_address_line3 => l_address_line3, x_city => l_city, x_state => l_state, x_zip => l_zip, x_province => l_province, x_country => l_country, x_area_code => l_area_code, x_phone => l_phone, x_customer_num => l_vendor_customer_num, x_ship_to_location_id => l_vendors_ship_to_location_id, x_bill_to_location_id => l_vendors_bill_to_location_id, x_ship_via_lookup_code => l_vendors_ship_via_lookup_code, x_freight_terms_lookup_code => l_vendors_frei_ter_lookup_code, x_fob_lookup_code => l_vendors_fob_lookup_code, x_inactive_date => l_inactive_date, x_fax => l_fax, x_fax_area_code => l_fax_area_code, x_telex => l_telex, x_payment_method_lookup_code => l_vendors_pay_meth_look_code, x_bank_account_name => l_vendors_bank_account_name, x_bank_account_num => l_vendors_bank_account_num, x_bank_num => l_vendors_bank_num, x_bank_account_type => l_vendors_bank_account_type, x_terms_date_basis => l_vendors_terms_date_basis, x_current_catalog_num => l_current_catalog_num, x_vat_code => l_vendors_vat_code, x_distribution_set_id => l_vendors_distribution_set_id, x_accts_pay_ccid => l_vendors_accts_pay_ccid, x_future_dated_payment_ccid => l_vendors_fut_dated_pay_ccid, x_prepay_code_combination_id => l_prepay_code_combination_id, x_pay_group_lookup_code => l_vendors_pay_group_look_code, x_payment_priority => l_vendors_payment_priority, x_terms_id => l_vendors_terms_id, x_invoice_amount_limit => l_vendors_invoice_amount_limit, x_pay_date_basis_lookup_code => l_vend_pay_date_bas_look_code, x_always_take_disc_flag => l_vendors_alw_take_disc_flag,
x_invoice_currency_code => l_vendors_inv_currency_code, x_payment_currency_code => l_vendors_payment_curr_code, x_hold_all_payments_flag => l_vendors_hold_all_pay_flag, x_hold_future_payments_flag => l_vendors_hold_future_pay_flag, x_hold_reason => l_vendors_hold_reason, x_hold_unmatched_invoices_flag => l_vendors_hold_unma_inv_flag, x_match_option => l_vendors_match_option, x_create_debit_memo_flag => l_vendors_create_dbt_memo_flag, x_exclusive_payment_flag => l_vendors_exclusive_pay_flag, x_tax_reporting_site_flag => l_tax_reporting_site_flag, x_attribute_category => l_vendors_attribute_category, x_attribute1 => l_vendors_attribute1, x_attribute2 => l_vendors_attribute2, x_attribute3 => l_vendors_attribute3, x_attribute4 => l_vendors_attribute4, x_attribute5 => l_vendors_attribute5, x_attribute6 => l_vendors_attribute6, x_attribute7 => l_vendors_attribute7, x_attribute8 => l_vendors_attribute8, x_attribute9 => l_vendors_attribute9, x_attribute10 => l_vendors_attribute10, x_attribute11 => l_vendors_attribute11, x_attribute12 => l_vendors_attribute12, x_attribute13 => l_vendors_attribute13, x_attribute14 => l_vendors_attribute14, x_attribute15 => l_vendors_attribute15, x_validation_number => l_vendors_validation_number, x_exclude_freight_from_disc => l_vendors_ex_freight_from_disc, x_vat_registration_num => l_vendors_vat_registration_num, x_offset_tax_flag => l_vendors_offset_tax_flag, x_check_digits => l_vendors_check_digits, x_bank_number => l_vendors_bank_number, x_address_line4 => l_address_line4, x_county => l_county, x_address_style => l_address_style, x_language => l_language, x_allow_awt_flag => l_vendors_allow_awt_flag, x_awt_group_id => l_vendors_awt_group_id, x_pay_on_code => l_pay_on_code, x_default_pay_site_id => l_default_pay_site_id, x_pay_on_receipt_summary_code => l_pay_on_receipt_summary_code, x_bank_branch_type => l_vendors_bank_branch_type, x_edi_id_number => l_edi_id_number, x_edi_payment_method => l_vendors_edi_payment_method, x_edi_payment_format => l_vendors_edi_payment_format, x_edi_remittance_method => l_vendors_edi_remittance_meth, x_edi_remittance_instruction => l_vendors_edi_remittance_inst, x_edi_transaction_handling => l_vendors_edi_transaction_hand, x_auto_tax_calc_flag => l_vendors_auto_tax_calc_flag, x_auto_tax_calc_override => l_vendors_auto_tax_calc_ove, x_amount_includes_tax_flag => l_vendors_amt_includes_tax_flg, x_ap_tax_rounding_rule => l_vendors_ap_tax_rounding_rule, x_vendor_site_code_alt => l_vendors_site_code_alt, x_address_lines_alt => l_address_lines_alt, x_global_attribute_category => l_vs_global_attribute_category, x_global_attribute1 => l_vendors_global_attribute1, x_global_attribute2 => l_vendors_global_attribute2, x_global_attribute3 => l_vendors_global_attribute3, x_global_attribute4 => l_vendors_global_attribute4, x_global_attribute5 => l_vendors_global_attribute5, x_global_attribute6 => l_vendors_global_attribute6, x_global_attribute7 => l_vendors_global_attribute7, x_global_attribute8 => l_vendors_global_attribute8, x_global_attribute9 => l_vendors_global_attribute9,
x_global_attribute10 => l_vendors_global_attribute10, x_global_attribute11 => l_vendors_global_attribute11, x_global_attribute12 => l_vendors_global_attribute12, x_global_attribute13 => l_vendors_global_attribute13, x_global_attribute14 => l_vendors_global_attribute14, x_global_attribute15 => l_vendors_global_attribute15, x_global_attribute16 => l_vendors_global_attribute16, x_global_attribute17 => l_vendors_global_attribute17, x_global_attribute18 => l_vendors_global_attribute18, x_global_attribute19 => l_vendors_global_attribute19, x_global_attribute20 => l_vendors_global_attribute20, x_bank_charge_bearer => l_vendors_bank_charge_bearer, x_ece_tp_location_code => l_ece_tp_location_code, x_pcard_site_flag => l_pcard_site_flag, x_country_of_origin_code => l_country_of_origin_code, x_calling_sequence => null, — calling_sequence, x_shipping_location_id => null, x_supplier_notif_method => l_supplier_notif_method, x_email_address => l_email_address, x_remittance_email => l_remittance_email, x_primary_pay_site_flag => l_primary_pay_site_flag, x_shipping_control => l_shipping_control, x_duns_number => l_duns_number ); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(’Others for vendor_sites: ‘ ||l_Vendor_Site_Id || ‘ – ‘ || sqlerrm); END; FOR vendor_site_contact_rec IN vendor_site_contact_cur (vendor_sites_rec.vendor_site_id) LOOP l_count_site_cont := l_count_site_cont + 1; l_con_vendor_contact_id := vendor_site_contact_rec.vendor_contact_id; l_con_first_name := vendor_site_contact_rec.first_name; l_con_last_name := vendor_site_contact_rec.last_name; l_con_middle_name := vendor_site_contact_rec.middle_name; l_con_prefix := vendor_site_contact_rec.prefix; l_con_title := vendor_site_contact_rec.title; l_con_mail_stop := vendor_site_contact_rec.mail_stop; l_con_area_code := vendor_site_contact_rec.area_code; l_con_phone := vendor_site_contact_rec.phone; l_con_alt_area_code := vendor_site_contact_rec.alt_area_code; l_con_alt_phone := vendor_site_contact_rec.alt_phone; l_con_fax_area_code := vendor_site_contact_rec.fax_area_code; — l_fcon_ax := vendor_site_contact_rec.fax; l_con_email_address := vendor_site_contact_rec.email_address; l_con_url := vendor_site_contact_rec.url; — Below it’s the infomraction we’re going to get replaced………. l_con_first_name := ‘XXXXXX’; l_con_last_name := ‘XXXXXX’; l_con_middle_name := ‘XXXXXX’; l_con_prefix := ‘X’; l_con_title := ‘XXXXXX’; l_con_mail_stop := ‘XXXXXX’; l_con_area_code := ‘XXXXXX’; l_con_phone := ‘XXXXXX’; l_con_alt_area_code := ‘XXXXXX’; l_con_alt_phone := ‘XXXXXX’; l_con_fax_area_code := ‘XXXXXX’; l_con_fax := ‘XXXXXX’; l_con_email_address := ‘XXXXXX’;
l_con_url := ‘XXXXXX’;
BEGIN ap_po_vendors_apis_pkg.update_vendor_contact( p_vendor_contact_id => l_con_vendor_contact_id, p_first_name => l_con_first_name, p_last_name => l_con_last_name, p_middle_name => l_con_middle_name, p_prefix => l_con_prefix, p_title => l_con_title, p_mail_stop => l_con_mail_stop, p_area_code => l_con_area_code, p_phone => l_con_phone, p_alt_area_code => l_con_alt_area_code, p_alt_phone => l_con_alt_phone, p_fax_area_code => l_con_fax_area_code, p_fax => l_con_fax, p_email_address => l_con_email_address, p_url => l_con_url, x_status => l_status, x_exception_msg => l_exception_msg);
EXCEPTION WHEN OTHERS THEN dbms_output.put_line(’Others for contact: ‘ ||l_con_vendor_contact_id || ‘ – ‘ || sqlerrm); END; — Above API it’s not able to manage the below attributes….. UPDATE po_vendor_contacts SET attribute1 = NULL , attribute2 = NULL , attribute3 = NULL , attribute4 = NULL WHERE rowid = vendor_site_contact_rec.rowid; END LOOP; — End loop for vendor site contacts loop. FOR bank_account_uses_rec IN bank_account_uses_cur (vendor_sites_rec.vendor_site_id) LOOP BEGIN l_count_site_bank := l_count_site_bank + 1; AP_BANK_ACCOUNT_USES_PKG.Delete_Row(X_Rowid => bank_account_uses_rec.rowid ); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(’Error deleting acct uses (site). ‘ || vendor_sites_rec.vendor_site_id || ‘ – ‘ || sqlerrm); END; END LOOP;
END LOOP; — End loop for vendor sites loop. END LOOP; — End loop for vendor loop.
DBMS_OUTPUT.PUT_LINE(l_count_customers ||’ Suppliers Updated.’); DBMS_OUTPUT.PUT_LINE(l_count_cus_sites ||’ Supplier Sites Updated.’);
DBMS_OUTPUT.PUT_LINE(l_count_site_cont ||’ Supplier Site Contacts Updated.’); DBMS_OUTPUT.PUT_LINE(l_count_site_bank ||’ Banks Unassigned (site).’); DBMS_OUTPUT.PUT_LINE(l_count_site_bank_h ||’ Banks Unassigned (header).’); END;/
COMMIT;
select to_char (sysdate, ‘dd/mon/rrrr hh24:mi:ss’) from dual;
SPOOL OFF;
EXIT;
INSERT INTO QP_INTERFACE_LIST_HEADERS (ORIG_SYS_HEADER_REF ,LIST_TYPE_CODE ,CURRENCY_CODE ,ACTIVE_FLAG ,START_DATE_ACTIVE ,ROUNDING_FACTOR ,NAME ,INTERFACE_ACTION_CODE ,PROCESS_FLAG ,PROCESS_STATUS_FLAG) VALUES (18007 ,'PRL' , 'USD' ,'Y' ,'16-Jun-2008' ,'-2' ,'TEST_PL' ,'UPDATE' ,'Y' ,'P')
INSERT INTO qp_interface_list_lines ( LIST_LINE_ID ,LIST_HEADER_ID ,LIST_LINE_TYPE_CODE ,LIST_PRICE ,PRIMARY_UOM_FLAG ,INTERFACE_ACTION_CODE , PROCESS_STATUS_FLAG ,START_DATE_ACTIVE ,END_DATE_ACTIVE ,ARITHMETIC_OPERATOR , OPERAND , PRODUCT_PRECEDENCE , PROCESS_FLAG , ORIG_SYS_HEADER_REF ) VALUES (seq_pll.nextval
,18007 ,'PLL' ,100 ,'Y' ,'INSERT' ,'P' ,'17-Jun-2008' ,NULL , 'UNIT_PRICE' , 999 , 220 , 'Y' , 18007);
INSERT INTO QP_INTERFACE_PRICING_ATTRIBS ( PRICING_ATTRIBUTE_ID ,EXCLUDER_FLAG ,ACCUMULATE_FLAG ,PRODUCT_ATTRIBUTE_CONTEXT ,PRODUCT_ATTR_VALUE ,PRODUCT_UOM_CODE ,PRODUCT_ATTRIBUTE_DATATYPE ,COMPARISON_OPERATOR_CODE ,LIST_HEADER_ID ,PRICING_PHASE_ID ,QUALIFICATION_IND , INTERFACE_ACTION_CODE , PROCESS_FLAG , PROCESS_STATUS_FLAG) VALUES ( price_attrib_s.nextval ,'N' ,'N' ,'ITEM' ,3 ,'EA' ,'C' ,'BETWEEN' , 18007 ,1 ,4 , 'INSERT' , 'Y' , 'P')