Process to Upload BPA Data Using FBDI Template
1.	INTRODUCTION
Blanket Purchase Agreements Import purchase agreements from external systems into Oracle Fusion Purchasing.
2. Pre-Requisites to load the data
•	Roles:-User must have below roles to create Blanket Purchase Agreement. 
      1. Procurement Manager
            2. Buyer
•	Data Access:-The user must be a procurement agent. In order to add user as procurement agent, user must be an employee associated.

3. Import Process:-
  step 1: Download FBDI   "POBlanketPurchaseAgreementImportTemplate.xlsm"from documents.oracle.com
   Step 2: Make sure the Oracle given sample data should be deleted from all the tabs. Then we need to prepare the data in to sheets.
   Step 3: Only the following tabs in the spreadsheet should have data present.
o	PO_HEADERS_INTERFACE
o	PO_LINES_INTERFACE
o	PO_GA_ORG_ASSIGN_INTERFACE
o	PO_ATTR_VALUES_INTERFACE

Populating the Template:
PO_HEADERS_INTERFACE:
Column A: Interface_Header_Key Must Be Unique
Column B: Action Must be “Original”
Column C: Batch_Id 
o	Unique Identifier for each batch processed. Free format, User Defined Number
o	Should be Numeric
Column D: Import Source Must be “COUPA”
Column E: Approval Action Must be “BYPASS”
Column G: Document Type Code Must be “BLANKET”
Column I: Procurement BU “ABCUS BU”
Column J: Buyer Need to give valid buyer names
Column K: Currency Code “USD”
Column N: Supplier Number “Supplier must be existed in the system and give that supplier number”
Column O: Supplier Site Must Be “RTA”
Column S: Carrier Must be “Test Carrier”
Column V: Payment Terms Mandatory
Column W: Initiating Party Must be “Buyer”
Column Y: required Acknowledgement Must be “N”
Column AE: Agreement Amount Mandatory
Column AF: Amount limit Mandatory
Column AI: End Date Mandatory

PO_LINES_INTERFACE:
Column A: Interface Line Key Mandatory
Column B: Interface Header Key Need to take this from header level
Column C: Action Must Be “ADD”
Column D: Line Mandatory
Column E: Line Type Mandatory
Column G: Item Description Mandatory
Column I: Category Name Mandatory
Column J: Agreement Amount Must Be match with Header level Amount
Column K: UOM Based on the Line Type need to provide
Column L: Price Based on the Line Type need to provide

PO_GA_ORG_ASSIGN_INTERFACE:
Column A: Interface BU Assignment Key Mandatory Mandatory
Column B: Interface Header Key Need to take this from header level
Column C: Requisitioning BU Must be “ABCUS BU”
Column F: Ship To Location Mandatory
Column G: Bill To BU Mandatory
Column H: Bill To Location Mandatory

PO_ATTR_VALUES_INTERFACE:
Column A: Interface Attribute Key Mandatory
Column B: Interface Line Key Mandatory
     
 Step 4: After you finish preparing the data in the parent and child sheets, click the   Generate CSV File button to generate a ZIP file containing one or more CSV files.
   Upload file into UCM Account: prc/blanket purchase Agreement/import
   By connecting to navigation 
  Navigation: Tools-->file import and export 
Step 4: Load the data into interface tables 
Run the interface program "Load interface file for import" from schedule process to load the data into interface table from UCM account. Select the "Import Blanket Agreements" as one of program. 
Navigation: Tools-->schedule Process-->click on Schedule new process-->Run the interface program "Load interface file for import" 
• Once the load interface program is completed successfully then the data will be loaded into interface tables.
Interface tables:-
•	PO_DISTRIBUTIONS_INTERFACE
•	PO_HEADERS_INTERFACE
•	PO_LINES_INTERFACE
•	PO_GA_ORG_ASSIGN_INTERFACE
•	PO_ATTR_VALUES_INTERFACE
Step 5: Importing the Loaded Data
After you successfully load your data, you must submit the"Import Blanket Agreements" process to import the data into the application tables to create PO's and its child entities. 
To submit the Import process:
1. Navigate to the Scheduled Processes from Navigator.
2. Click on Schedule New Process and select Import Blanket Agreements Process.
3.  Enter the value for Batch ID and submit the process. 
4.  Monitor the process in the Search Results section.
5. If the BPA Process ends in error or warning, review the log file for details.
Step 6: correct import errors
1. Click on ManageAgreements in the Purchase order work area.
2. Search the Batch for which Import Blanket Agreement Process has been run. 
3. Click on the Batch Name to navigate to Batch Details.  
4. Review the errors in imported tab for each Agreement.
5. Select the rows that are errored out and click on Manage in Spreadsheet to export Blanket Agreements data to spreadsheet. 
6. Once all the errored rows are corrected, resubmit the process by clicking Upload and then submit the Import Blanket Agreement Process. 
7. Repeat the submit and error correction steps in this section until all rows are imported successfully.
Step 7: Base Tables
•	PO_DISTRIBUTIONS_ALL
•	PO_HEADERS_ALL
•	PO_LINES_ALL
•	PO_LINE_LOCATIONS_ALL
4.Navigation to Verify in Front End
     Home-->Procurement-->Purchase Orders-->Task list: Manage Agreements 
5.Extraction Query to Reconcile Data
 After successful migration of data through FBDI we need to Reconcile the data via BIP query.
select 
PHA.PO_HEADER_ID,
PHA.SEGMENT1 "PO_NUMBER",
PHA.CURRENCY_CODE ,
PHA.CREATION_DATE ,
PHA.CREATED_BY, 
PHA.BLANKET_TOTAL_AMOUNT ,
PHA.TYPE_LOOKUP_CODE,
fabu.BU_NAME,
psv.VENDOR_NAME "supplier Name",
psv.SEGMENT1 "Supplier Number",
pssv.VENDOR_SITE_CODE "Supplier Site",
apt.NAME "Payment Term",PLA.LIST_PRICE, 
PLA.LINE_STATUS ,
PLA.LINE_TYPE_ID ,
PLA.LINE_NUM ,
PLA.ITEM_ID ,
PLA.ITEM_DESCRIPTION, 
PLA.UOM_CODE ,
PLA.UNIT_PRICE ,
PLA.QUANTITY ,
PLA.ORDER_TYPE_LOOKUP_CODE 
from
PO_HEADERS_ALL PHA,
fun_all_business_units_v fabu, 
poz_suppliers_v psv,
poz_supplier_sites_v pssv,
ap_terms apt,
PO_LINES_ALL PLA
where PHA.TYPE_LOOKUP_CODE='BLANKET'
and PHA.PRC_BU_ID=fabu.BU_ID
and psv.VENDOR_ID=PHA.VENDOR_ID
and psv.VENDOR_ID=pssv.VENDOR_ID
and PHA.TERMS_ID=apt.TERM_ID
and PHA.VENDOR_SITE_ID=pssv.VENDOR_SITE_ID
and PHA.PO_HEADER_ID=PLA.PO_HEADER_ID
and trunc(PHA.Creation_date)=trunc(sysdate)
6. Error Extract Query
select DISTINCT
error.INTERFACE_TYPE,
error.COLUMN_NAME,
error.COLUMN_VALUE,
error.ERROR_MESSAGE,
error.CREATION_DATE,
error.CREATED_BY,
error.TABLE_NAME,
error.BATCH_ID,
error.INTERFACE_HEADER_ID,
iface.DOCUMENT_NUM,
IFACE.INTERFACE_HEADER_KEY,
ORG_ASSG.INTERFACE_BU_ASSIGNMENT_KEY,
iface.VENDOR_NUM
from PO_INTERFACE_ERRORS error,
PO_HEADERS_INTERFACE IFACE  ,
PO_GA_ORG_ASSIGN_INTERFACE ORG_ASSG
where 1=1 
AND IFACE.PROCESS_CODE='REJECTED'
AND error.BATCH_ID=IFACE.BATCH_ID
AND error.INTERFACE_HEADER_ID=iface.INTERFACE_HEADER_ID
AND IFACE.INTERFACE_HEADER_ID=ORG_ASSG.INTERFACE_HEADER_ID
AND error.BATCH_ID=nvl(:p_BATCH_ID,error.BATCH_ID)
AND trunc(error.creation_date) between nvl(:p_creation_from_date,trunc(error.creation_date)) and  nvl(:p_creation_to_date,trunc(error.creation_date))
AND error.created_by=nvl(:p_created_by,error.created_by)
ORDER BY error.INTERFACE_HEADER_ID,IFACE.INTERFACE_HEADER_KEY,ORG_ASSG.INTERFACE_BU_ASSIGNMENT_KEY