Sie sind auf Seite 1von 8
sinana Docurnant 2348861 Using SQL to Populate the Payables Open Interface Tables (Doc ID 234886.1) Modified: 22-Jun-2010 Type: HOWTO Oracle Payables - Version: 11.5.1 to 11.5.10.2 - Release: 1.5.10 to 1.5.10 Information in this document applies to any platform. How To Use SQL to Populate the Payables Open Interface Tables The following information provides a basic example of a SQL program along with the information necessary to accurately populate the Open Interface tables to load various types of invoices. Note that you will need to decide which type of invoice you are trying to load and follow the appropriate example. For instance, you will choose either a PO matched invoice OR a Project Related Invoice...not both. The reason being that the account information is provided either by the Project information OR the PO information - not both. Please pay close attention to the information associated with the required fields for the particular type of invoice you are trying to load into the Open Interface table. In addition, there will be indications to choose either one OR the other field - not both, as this will cause a problem during import of the data. We will discuss the following 3 types of. invoices: 1, Simple Invoice 2. PO Matched Invoice 3, Project Related Invoice ‘A, Example of a SQL program used to populate an invoice in AP Invoices Interface tables: DECLARE p-invoice_id NUMBER; i NUMBEI BEGIN + Get invoice_id select AP_INVOICES_INTERFACE_S.nextval into p_invoice_id from dual; -- Insert an invoice header —- insert into ap_invoices_ interface (invoice id, invoice_num, invoice_type_lookup_code, vendor_id, vendor site_id, invoice_amount, invoice_currency_code, hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1 8 sinana Docurnant 2348861 source, ‘group_id) VALUES. (p_invoice_td, "testcaset’, "STANDARD, 2, 2, 10, ‘USD, "INVOICE GATEWAY, ‘testcasel'); = Insert invoice line —- for | in 1..10 loop. INSERT into ap_invoice_lines_ interface (invoice_id, invoice _line_id, line_number, line_type_lookup_code, amount, dist_code_combination_id) VALUES (p_invoice_id, ‘AP_INVOICE_LINES_INTERFACE_S.nextval, i, ‘TEM’, 1, 12831); end loop; commit; le Invoice: ‘ou should not populate any PO or PA related columns for a simple invoice. Here are the tables and reference columns identified for use when Populating data for a simple invoice: ‘AP_INVOICES_INTERFACE TABLE Required Columns INVOICE_ID (Populated from AP_INVOICES_INTERFACE_S.NEXTVAL) INVOICE_NUM (Must be unique to the supplier) \VENDOR_ID or VENDOR_NUM or VENDOR_NAME (An active vendor. Validated against PO_VENDORS, you should only Populate one of these columns for vendor info for the data consistence) \VENDOR_SITE_ID or VENDOR_SITE_CODE hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1 28 sinana Doosan 2348861 (An active pay site. Validated against PO_VENDOR_SITES, you should ‘only populate one of these columns for vendor site info for data consistency) INVOICE_AMOUNT (Positive amount for STANDARD’ type, Negative amount for ‘CREDIT’ type) oRG_ID (Required in Multi-Org Environment. Validated against ‘AP_SYSTEM_PARAMETERS ORG_ID) SOURCE (Must be in SELECT LOOKUP_CODE FROM ‘AP_LOOKUP_CODES WHERE LOOKUP_TYPE ;OURCE’) Optional Columns — If you do not populate them, then the value wil be defaulted a: INVOICE_DATE (Defaulted to SYSDATE) INVOICE_TYPE_LOOKUP_CODE (Defaulted to ‘STANDARD’) INVOICE_CURRENCY_CODE (Defaulted from PO_VENDOR_SITES.INVOICE_CURRENCY_CODE) ‘TERMS_ID or TERMS_NAME (Defaulted from PO_VENDOR_SITES.TERMS_ID, if you populate it, should populate one of them) DOC_CATEGORY_CODE (Only populated if using automatic voucher number) PAYMENT_METHOD_LOOKUP_CODE (Defaulted from PO_VENDOR_SITES,PAYMENT_METHOD_LOOKUP_CODE) PAY_GROUP_LOOKUP_CODE (Defaulted from PO_VENDOR_SITES.PAY_GROUP_LOOKUP_CODE) ‘ACCTS_PAY_CODE_COMBINATION_ID (Defaulted from PO_VENDOR_SITES.ACCTS_PAY_CODE_COMBINATION_ID) GROUP_ID (Group identifier. Suggested to use) STATUS (DO NOT POPULATE!) EXCHANGE_RATE_TYPE (Defaulted from AP_SYSTEM_PARAMETERS.DEFAULT_EXCHANGE_RATE_TYPE if the invoice is using foreign currency) ‘AP_INVOICE_LINES_INTERFACE TABLE INVOICE_ID (Populated from AP_INVOICES_INTERFACE.INVOICE_ID) INVOICE_LINE_ID (Populated from AP_INVOICE_LINES_INTERFACE_S.NEXTVAL) LINE_NUMBER (A unique number to the invoice) LINE_TYPE_LOOKUP_CODE (TTEM') AMOUNT ‘ACCOUNTING_DATE (Optional. Defaulted from INVOICE_DATE or SYSDATE) DIST_CODE_CONCATENATED or DIST_CODE_COMBINATION_ID hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1 38 stants Document 2348861 (You should only populate one of them) DIST_CODE_CONCATENATED needs to meet security rules, no parent segment, DIST_CODE_COMBINATION_ID must be in ‘SELECT CODE_COMBINATION_ID FROM GL_CODE_COMBINATIONS WHERE ACCOUNT_TYPE = 'E' AND ENABLED_FLAG = 'Y' AND 'SUMMARY_FLAG = 'N' AND SYSDATE BETWEEN NVL (START_DATE_ACTIVE, SYSDATE-1) AND NVL(END_DATE_ACTIVE, SYSDATE#I)) Required / Optional Columns for LINE_TYPE_LOOKUP_CODE = ‘TAX’ INVOICE_ID (Populated from AP_INVOICES_INTERFACE.INVOICE_ID) INVOICE_LINE_ID (Populated from AP_INVOICE_LINES_INTERFACE_S.NEXTVAL) LINE_NUMBER (A.unique number to the invoice) LINE_TYPE_LOOKUP_CODE (TAX) ‘TAX_CODE or TAX_CODE_ID (Validated against AP_TAX_CODES, you should only populate one of them) ‘AMOUNT ‘ACCOUNTING_DATE (Optional. Defaulted from INVOICE_DATE or SYSDATE) DIST_CODE_CONCATENATED or DIST_CODE_COMBINATION_ID (Optional. Defaulted from AP_TAX_CODES.TAX_CODE_COMBINATION_ID) You should only populate one of them if you need to populate it yourself DIST_CODE_CONCATENATED needs to meet security rules, no parent segment. DIST_CODE_COMBINATION_ID must be in ‘SELECT CODE_COMBINATION_ID FROM GL_CODE_COMBINATIONS WHERE ACCOUNT_TYPE = "E’ AND ENABLED FLAG = 'Y’ ‘AND SUMMARY_FLAG = 'N’ ‘AND SYSDATE BETWEEN NVL(START_DATE_ACTIVE, SYSDATE-1) ‘AND NVL(END_DATE_ACTIVE, SYSDATE+i)) Required/ Optional Columns for LINE_TYPE_LOOKUP_CODE = INVOICE_ID (Populated from AP_INVOICES_INTERFACE.INVOICE_ID) INVOICE_LINE_ID (Populated from AP_INVOICE_LINES_INTERFACE_S.NEXTVAL) LINE_NUMBER (A unique number to the invoice) LINE_TYPE_LOOKUP_CODE (FREIGHT) ‘AMOUNT ACCOUNTING_DATE (Optional, Defaulted from INVOICE_DATE or SYSDATE) DIST_CODE_CONCATENATED or DIST_CODE_COMBINATION_ID (Optional. Defaulted from AP_SYSTEM_PARAMETERS.FREIGHT_CODE_COMBINATION_ID) You should only populate one of them if you need to populate it yourself DIST_CODE_CONCA TENA TED needs to meet security rules, no parent segment. DIST_CODE_COMBINATION_ID must be in ‘SELECT CODE_COMBINATION_ID FROM Gl_CODE_COMBINATIONS WHERE ACCOUNT_TYPE =" AND ENABLED_FLAG = 'Y' AND hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1 4 sinana Docurnant 2348861 'SUMMARY_FLAG = 'N' AND SYSDATE BETWEEN NVL(START_DATE_ACTIVE, SYSDATE-1) AND NVL(END_DATE_ACTIVE, SYSDATE+1)) 2. PO Matched Invoice: ‘You should not populate DIST_CODE_COMBINATION_ID, DIST_CODE_CONCATENATED or any PA related column for PO matched invoices, ‘There are two ways to match an invoice to a Purchasing Order: 1, Matching to a PO shipment (MATCH_OPTION =P’) 2. Matching to @ PO receipt (MATCH_OPTION ='R’). Here are the tables and reference columns identified for use when populating data for a PO matched invoice: ‘AP_INVOICES_INTERFACE TABLE Required Columns INVOICE_ID (Populated from AP_INVOICES_INTERFACE_S.NEXTVAL) INVOICE_NUM (Must be unique to the supplier) PO_NUMBER (An approved, not cancelled, not closed or final closed PO. Validated against PO_HEADERS) INVOICE_AMOUNT SOURCE (Must be in SELECT LOOKUP_CODE FROM AP_LOOKUP_CODES WHERE LOOKUP_TYPE ORG_ID (Required in Multi-Org Environment. Validated against AP_SYSTEM_PARAMETERS.ORG_ID) 'SOURCE") Optional Columns INVOICE_DATE (Defaulted to SYSDATE) INVOICE_TYPE_LOOKUP_CODE (Defaulted to 'STANDARD’) INVOICE_CURRENCY_CODE (Defaulted from PO_VENDOR_SITES.INVOICE_CURRENCY_CODE) EXCHANGE_RATE_TYPE (Defaulted from AP_SYSTEM_PARAMETERS.DEFAULT_EXCHANGE_RATE_TYPE) ‘TERMS_ID or TERMS_NAME (Defaulted from PO_VENDOR_SITES.TERMS_ID, should only populate one of them) DOC_CATEGORY_CODE (Only populated if using automatic voucher number) PAYMENT_METHOD_LOOKUP_CODE (Defaulted from PO_VENDOR_SITES,PAYMENT_METHOD_LOOKUP_CODE) PAY_GROUP_LOOKUP_CODE (Defaulted from PO_VENDOR_SITES.PAY_GROUP_LOOKUP_CODE) ‘ACCTS_PAY_CODE_COMBINATION_ID_ (Defaulted from PO_VENDOR_SITES.ACCTS_PAY_CODE_COMBINAITON_ID) GROUP_ID (Group identifier. Suggested to use) STATUS (DO NOT POPULATE ‘AP_INVOICE_LINES_INTERFACE TABLE hipsssupport oracle. comepmesiaces/DecimeniDispla?_adct-stato= reypglel_1088id=234886.1 58 sinana Docurnant 2348861 INVOICE_ID ( Populated from AP_INVOICES_INTERFACE.INVOICE_ID) INVOICE_LINE_ID (Populated from AP_INVOICE_LINES_INTERFACE_S.NEXTVAL) LINE_NUMBER (A unique number to the invoice) LINE_TYPE_LOOKUP_CODE (ITEM) ‘AMOUNT (Should be QUANTITY_INVOICED * UNIT_PRICE) If MATCH_OPTIONis 'P’, then populat. RELEASE_NUM or PO_RELEASE_ID (For Blanket Release only, validated against PO_RELEASES) PO_NUMBER or PO_HEADER_ID (Validated against PO_HEADERS, should only populate one of them.) PO_LINE_NUMBER or PO_LINE_ID (Validated against PO_LINES, should only populate one of them.) PO_SHIPMENT_NUM or PO_LINE LOCATION_ID (Validated against PO_LINE LOCATIONS, should only populate one of them.) If MATCH_OPTIONis 'R’, then populate RECEIPT_NUMBER (Validated against RCV_SHIPMENT_HEADERS.RECEIPT_NUM) RCV_TRANSACTION_ID or PO_LINE_LOCATION_ID (Validated against RCV_TRANSACTIONS, should only populate one of them) Optional Columns for PO Matched Lines QUANTITY_INVOICED (Populated if different from PO shipment) UNIT_PRICE (Populated if different from PO shipment) MATCH_OPTION (P’ or 'R’ of Defaulted from PO_VENDOR_SITES.MATCH_OPTION) ‘ACCOUNTING_DATE (Defaulted from INVOICE_DATE or SYSDATE) FINAL_MATCH_FLAG (Populated 'Y'if its final matching) INVENTORY_ITEM_ID (Validated against PO_LINES. INVENTORY_ITEM_ID) INVENTORY_DESCRIPTION (Validated against PO_LINES. INVENTORY_ITEM_DESCRIPTION) SHIP_TO_LOCATION_CODE (Populated if different from PO shipment) PRICE_CORRECTION_FLAG (Populated 'Y'if itis price correction) 3. Project Related Invoices hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1 8 sinana Docurnant 2348861 You should not populate DIST_CODE_COMBINATION_ID, DIST_CODE_CONCATENATED or any PO related column for project related invoices. You need to populate PROJECT_ID TASK_ID EXPENDITURE_TYPE EXPENDITURE_ITEM_DATE EXPENDITURE_ORGANIZATION_ID PA_QUANTITY Payables Open Invoice Import will pass this project information data into the Project Account Generator to generate an account for you. Here are the reference columns which are required for populating a project related invoice: ‘AP_INVOICES_INTERFACE TABLE Required Columns INVOICE_ID (Populated from AP_INVOICES_INTERFACE_S.NEXTVAL) INVOICE_NUM (Must be unique to the supplier) \VENDOR_ID or VENDOR_NUM or VENDOR_NAME (An active vendor. Validated against PO_VENDORS, should only populate one of them) \VENDOR_SITE_ID or VENDOR_SITE_CODE (An active pay site, Validated against PO_VENDOR_SITES, should only populate one of them) INVOICE_AMOUNT (Positive amount) ORG_ID (Required in Multi-Org Environment. Validated against AP_SYSTEM_PARAMETERS.ORG_ID) SOURCE (Must be in SELECT LOOKUP_CODE FROM AP_LOOKUP_CODES WHERE LOOKUP_TYPE = 'SOURCE’) Optional Columns INVOICE_DATE (Defaulted to SYSDATE) INVOICE_TYPE_LOOKUP_CODE (Defaulted to 'STANDARD’) INVOICE_CURRENCY_CODE (Defaulted from PO_VENDOR_SITES.INVOICE_CURRENCY_CODE) EXCHANGE_RATE_TYPE (Defaulted from AP_SYSTEM_PARAMETERS.DEFAULT_EXCHANGE_RATE_TYPE) ‘TERMS_ID or TERMS_NAME (Defaulted from PO_VENDOR_SITES,TERMS_ID) DOC_CATEGORY_CODE (Only populated if using automatic voucher number) PAYMENT_METHOD_LOOKUP_CODE (Defaulted from PO_VENDOR_SITES,PAYMENT_METHOD_LOOKUP_CODE) PAY_GROUP_LOOKUP_CODE (Defaulted from PO_VENDOR_SITES.PAY_GROUP_LOOKUP_CODE) ACCTS_PAY_CODE_COMBINATION_ID (Defaulted from PO_VENDOR_STTES.ACCTS_PAY_CODE_COMBINAITON_ID) GROUP_ID (Group identifier. Suggest to use it) STATUS (DO NOT POPULATE !!!) hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1 8 sinana Docurnant 2348861 ‘AP_INVOICE_LINES_INTERFACE TABLE INVOICE_ID (Populated from AP_INVOICES_INTERFACE. INVOICE. ID) INVOICE_LINE_ID (Populated from AP_INVOICE_LINES_INTERFACE_S.NEXTVAL) LINE_NUMBER (A unique number to the invoice) LINE_TYPE_LOOKUP_CODE (ITEM) ‘AMOUNT PROJECT_ID (Validated against PA_PROJECTS.PROJECT_ID) TASK_ID (Validated against PA_TASKS.TASK_ID) EXPENDITURE_TYPE (Validated against PA_EXPENDITURE_TYPES.EXPENDITURE_TYPE) EXPENDITURE_ITEM_DATE (Needs to be between the task start date and end date) EXPENDITURE_ORGANIZATION_ID (Validated against PA_EXP_ORGS_IT.ORGANIZATION_ID) PA_QUANTITY Optional Columns for project related lines ACCOUNTING_DATE (Defaulted from Invoice Date or SYSDATE) PA_ADDITION_FLAG (’Y' if the distribution has been transferred into Oracle Projects) hips:support oracle comepmesitaces/DecimeniDispla?_adctl-state=reypglel_1088id=234886.1

Das könnte Ihnen auch gefallen