JOURNELS -----------------SELECT JEL.JE_HEADER_ID, JEL.JE_LINE_NUM, JEL.LAST_UPDATE_DATE, JEL.LAST_UPDATED_BY, JEL.LEDGER_ID, JEL.CODE_COMBINATION_ID, JEL.PERIOD_NAME, JEL.STATUS, JEL.CREATION_DATE, JEL.CREATED_BY, JEL.ENTERED_DR, JEL.ENTERED_CR, JEL.ACCOUNTED_DR, JEL.ACCOUNTED_CR, JEL.REFERENCE_1, JEL.REFERENCE_2, JEL.REFERENCE_3, JEL.REFERENCE_4, JEL.REFERENCE_5, JEL.REFERENCE_6, JEL.REFERENCE_7, JEL.REFERENCE_8, JEL.REFERENCE_9, JEL.REFERENCE_10, JEL.GL_SL_LINK_ID, JEH.JE_CATEGORY, JEH.JE_SOURCE, JEH.NAME, JEH.CURRENCY_CODE, JEH.POSTED_DATE, JEB.NAME, PRDS.START_DATE, PRDS.END_DATE, GL.LEDGER_CATEGORY_CODE, PRDS.ADJUSTMENT_PERIOD_FLAG FROM GL_JE_LINES JEL, GL_JE_HEADERS JEH, GL_JE_BATCHES JEB, GL_PERIOD_STATUSES PRDS, GL_LEDGERS GL WHERE JEL.JE_HEADER_ID = JEH.JE_HEADER_ID AND JEH.ACTUAL_FLAG = 'A' AND JEH.JE_BATCH_ID = JEB.JE_BATCH_ID (+) AND JEL.PERIOD_NAME = PRDS.PERIOD_NAME AND JEL.LEDGER_ID = PRDS.SET_OF_BOOKS_ID AND JEL.LEDGER_ID = GL.LEDGER_ID AND PRDS.APPLICATION_ID = 101 AND JEH.CURRENCY_CODE <> 'STAT' AND JEB.STATUS = 'P' Products ------------
SELECT MTL_SYSTEM_ITEMS_B.LAST_UPDATE_DATE, MTL_SYSTEM_ITEMS_B.LAST_UPDATED_BY, MTL_SYSTEM_ITEMS_B.CREATION_DATE, MTL_SYSTEM_ITEMS_B.CREATED_BY, MTL_SYSTEM_ITEM S_B.DESCRIPTION, MTL_SYSTEM_ITEMS_B.SEGMENT1, MTL_SYSTEM_ITEMS_B.SHELF_LIFE_CODE, MTL_SYSTEM_ITEM S_B.UNIT_WEIGHT, MTL_SYSTEM_ITEMS_B.WEIGHT_UOM_CODE, MTL_SYSTEM_ITEMS_B.VOLUME_UOM_CODE, MTL_SYST EM_ITEMS_B.UNIT_VOLUME, MTL_SYSTEM_ITEMS_B.PRIMARY_UOM_CODE, MTL_SYSTEM_ITEMS_B.INVENTORY_ITEM_ID, MTL_S YSTEM_ITEMS_B.ITEM_TYPE, MTL_PARAMETERS.MASTER_ORGANIZATION_ID, MTL_SYSTEM_ITEMS_B.HAZARD_CLASS_ID, MTL_S YSTEM_ITEMS_B.SERIAL_NUMBER_CONTROL_CODE, MTL_SYSTEM_ITEMS_B.PLANNING_MAKE_BUY_CODE, MTL_SYSTEM_ITEMS_B.BASE_ITEM_ID, MTL_SYSTEM_ITEMS_B.START_DATE_ACTIVE, MTL_SYSTEM_ITEMS_B.RETURNABLE_FLAG, MTL_SYSTEM_ITEMS_B.PURCHASING_ENABLED_FLAG, MTL_SYSTEM_ITEMS_B.SERVICEABLE_PRODUCT_FLAG, MTL_SYSTEM_ITEMS_B.END_DATE_ACTIVE, MTL_SYSTEM_ITEMS_B.FIXED_ORDER_QUANTITY, MTL_SYSTEM_ITEMS_B.ORDER_COST, MTL_SYSTEM_ITEMS_B.INVENTORY_ITEM_FLAG, MTL_SYSTEM_ITEMS_B.CUSTOMER_ORDER_ENABLED_FLAG FROM MTL_SYSTEM_ITEMS_B, MTL_PARAMETERS WHERE MTL_SYSTEM_ITEMS_B.ORGANIZATION_ID = MTL_PARAMETERS.ORGANIZATION_ID AND MTL_PARAMETERS.MASTER_ORGANIZATION_ID = MTL_PARAMETERS.ORGANIZATION_ID SELECT * FROM MTL_ITEM_CATEGORIES SELECT * FROM MTL_SYSTEM_ITEMS -----------------AP Invocies --------------SELECT AP_INVOICE_DISTRIBUTIONS_ALL.DISTRIBUTION_LINE_NUMBER, AP_INVOICE_DISTRIB UTIONS_ALL.LAST_UPDATED_BY, AP_INVOICE_DISTRIBUTIONS_ALL.LAST_UPDATE_DATE, AP_IN VOICE_DISTRIBUTIONS_ALL.DIST_CODE_COMBINATION_ID, AP_INVOICE_DISTRIBUTIONS_ALL.CREATED_BY, AP_INVOICE_DISTRIBUTIONS_ALL.CREATION_D ATE, AP_INVOICES_ALL.INVOICE_ID, AP_INVOICES_ALL.INVOICE_NUM, AP_INVOICES_ALL.INVOICE _CURRENCY_CODE, AP_INVOICES_ALL.VENDOR_ID, AP_INVOICES_ALL.VENDOR_SITE_ID, AP_INVOICES_ALL.INVOICE_DATE, AP_INVOICE_DISTRIB UTIONS_ALL.LINE_TYPE_LOOKUP_CODE, AP_INVOICES_ALL.INVOICE_RECEIVED_DATE, AP_INVO ICES_ALL.CREATION_DATE, AP_INVOICE_DISTRIBUTIONS_ALL.ORG_ID, PO_HEADERS_ALL.SEGM ENT1, PO_LINES_ALL.LINE_NUM, PO_HEADERS_ALL.CREATION_DATE, AP_INVOICES_ALL.LAST_ UPDATE_DATE, PO_HEADERS_ALL.LAST_UPDATE_DATE, PO_LINES_ALL.LAST_UPDATE_DATE, PO_LINES_ALL.ITEM_DESCRIPTION, AP_INVOICE_DISTRIBUTIONS_ALL.DESCRIPTION, AP_INVOICES_ALL.INVOICE_TYPE_LOOKUP_CO DE, AP_INVOICES_ALL.WFAPPROVAL_STATUS, AP_INVOICES_ALL.PAYMENT_STATUS_FLAG, AP_I NVOICES_ALL.CANCELLED_DATE, AP_INVOICE_DISTRIBUTIONS_ALL.ACCOUNTING_DATE, PO_DIS TRIBUTIONS_ALL.PO_DISTRIBUTION_ID, AP_INVOICE_DISTRIBUTIONS_ALL.RCV_TRANSACTION_ ID, AP_INVOICE_DISTRIBUTIONS_ALL.MATCH_STATUS_FLAG,AP_INVOICE_DISTRIBUTIONS_ALL. INVOICE_DISTRIBUTION_ID, AP_INVOICES_ALL.TERMS_ID, AP_INVOICE_DISTRIBUTIONS_ALL.EXCHANGE_DATE, AP_INVOICE S_ALL.EXCHANGE_DATE, AP_INVOICE_DISTRIBUTIONS_ALL.EXCHANGE_RATE_TYPE, AP_INVOICE
S_ALL.EXCHANGE_RATE_TYPE, AP_INVOICE_DISTRIBUTIONS_ALL.EXCHANGE_RATE, AP_INVOICE S_ALL.EXCHANGE_RATE, AP_INVOICE_DISTRIBUTIONS_ALL.ACCTS_PAY_CODE_COMBINATION_ID, AP_INVOICES_ALL.ACCTS_PAY_CODE_COMBINATION_ID, AP_INVOICE_DISTRIBUTIONS_ALL.SET _OF_BOOKS_ID, AP_INVOICES_ALL.SET_OF_BOOKS_ID, AP_INVOICE_DISTRIBUTIONS_ALL.QUAN TITY_INVOICED, AP_INVOICE_DISTRIBUTIONS_ALL.AMOUNT, AP_INVOICE_DISTRIBUTIONS_ALL.BASE_AMOUNT, CASE WHEN AP_INVOICE_LINES_ALL.UNIT_MEAS_LOOKUP_CODE IS NULL THEN PO_LINES_ALL.U NIT_MEAS_LOOKUP_CODE ELSE AP_INVOICE_LINES_ALL.UNIT_MEAS_LOOKUP_CODE END, AP_INV OICE_DISTRIBUTIONS_ALL.INVOICE_PRICE_VARIANCE, AP_INVOICE_DISTRIBUTIONS_ALL.EXCH ANGE_RATE_VARIANCE, PO_VENDORS.RECEIPT_REQUIRED_FLAG, PO_VENDORS.INSPECTION_REQUIRED_FLAG, PO_VENDOR_SITES_ALL.PURCHASING_SITE_FLAG, P O_VENDORS.LAST_UPDATE_DATE, AP_INVOICES_ALL.SOURCE, AP_INVOICES_ALL.PROJECT_ID, AP_INVOICES_ALL.TASK_ID, AP_INVOICES_ALL.EXPENDITURE _TYPE, AP_INVOICES_ALL.EXPENDITURE_ORGANIZATION_ID, AP_INVOICES_ALL.PAYMENT_CURRENCY_CODE, AP_INVOICES_ALL.PAYMENT_CROSS_RATE, AP_INVOICES_ALL.REQUESTER_ID, AP_INVOICE_LINES_ALL.LINE_NUMBER, AP_INVOICE_LINES_ALL.LINE_TYPE_LOOKUP_CODE, AP_INVOICE_LINES_ALL.REQUESTER_ID, AP_INVOICE_LINES_ALL.DESCRIPTION, AP_INVOICES_ALL.LEGAL_ENTITY_ID, '0' as X_CUSTOM FROM AP_INVOICE_DISTRIBUTIONS_ALL, AP_INVOICE_LINES_ALL, AP_INVOICES_ALL, PO_LINES_ALL, PO_HEADERS_ALL, PO_VENDORS, PO_VENDOR_SITES_ALL, PO_DISTRIBUTIONS_ALL, (SELECT AP_INVOICES_ALL.INVOICE_ID FROM AP_INVOICES_ALL WHERE AP_INVOICES_ALL.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE','MM/DD/Y YYY HH24:MI:SS') UNION SELECT AP_INVOICE_LINES_ALL.INVOICE_ID FROM AP_INVOICE_LINES_ALL WHERE AP_INVOICE_LINES_ALL.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE','MM /DD/YYYY HH24:MI:SS') UNION SELECT DISTINCT AP_HOLDS_ALL.INVOICE_ID FROM AP_HOLDS_ALL WHERE AP_HOLDS_ALL.RELEASE_LOOKUP_CODE IS NULL AND AP_HOLDS_ALL.LAST_UPDATE_DATE > TO_ DATE('$$LAST_EXTRACT_DATE','MM/DD/YYYY HH24:MI:SS') UNION SELECT DISTINCT AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID FROM PO_DISTRIBUTIONS_ALL, AP_INVOICE_DISTRIBUTIONS_ALL WHERE AP_INVOICE_DISTRIBUTIONS_ALL.PO_DISTRIBUTION_ID = PO_DISTRIBUTIONS_ALL.PO_ DISTRIBUTION_ID AND PO_DISTRIBUTIONS_ALL.LAST_UPDATE_DATE > TO_DATE ('$$LAST_EXTRACT_DATE','MM/D D/YYYY HH24:MI:SS') UNION SELECT DISTINCT AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID FROM PO_DISTRIBUTIONS_ALL, AP_INVOICE_DISTRIBUTIONS_ALL, PO_HEADERS_ALL WHERE AP_INVOICE_DISTRIBUTIONS_ALL.PO_DISTRIBUTION_ID = PO_DISTRIBUTIONS_ALL.PO_DISTRI BUTION_ID AND PO_DISTRIBUTIONS_ALL.PO_HEADER_ID = PO_HEADERS_ALL.PO_HEADER_ID
UNION SELECT DISTINCT AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID FROM PO_DISTRIBUTIONS_ALL, AP_INVOICE_DISTRIBUTIONS_ALL, PO_LINES_ALL WHERE AP_INVOICE_DISTRIBUTIONS_ALL.PO_DISTRIBUTION_ID = PO_DISTRIBUTIONS_ALL.PO_DISTRI BUTION_ID AND PO_DISTRIBUTIONS_ALL.PO_LINE_ID = PO_LINES_ALL.PO_LINE_ID AND PO_LINES_ALL.LAST_UPDATE_DATE > TO_DATE ('$$LAST_EXTRACT_DATE','MM/DD/YYYY H H24:MI:SS') ) TEMP WHERE AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID = AP_INVOICES_ALL.INVOICE_ID AND AP_INVOICES_ALL.VENDOR_ID = PO_VENDORS.VENDOR_ID(+) AND AP_INVOICES_ALL.VENDOR_SITE_ID = PO_VENDOR_SITES_ALL.VENDOR_SITE_ID(+) AND AP_INVOICE_DISTRIBUTIONS_ALL.PO_DISTRIBUTION_ID = PO_DISTRIBUTIONS_ALL.PO_DI STRIBUTION_ID(+) AND PO_DISTRIBUTIONS_ALL.PO_HEADER_ID = PO_HEADERS_ALL.PO_HEADER_ID(+) AND PO_DISTRIBUTIONS_ALL.PO_HEADER_ID = PO_LINES_ALL.PO_HEADER_ID(+) AND PO_DISTRIBUTIONS_ALL.PO_LINE_ID = PO_LINES_ALL.PO_LINE_ID(+) AND AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID = TEMP.INVOICE_ID AND AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID = AP_INVOICE_LINES_ALL.INVOICE_ID AND AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER = AP_INVOICE_LINES_ALL.LINE _NUMBER __________________ sALES INVOCIES lINES FACT ( Rece) SELECT $$Hint RA_CUST_TRX_TYPES_ALL.TYPE, RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_LINE_ID, RA_CUSTOMER_TRX_LINES_ALL.LAST_UPDATE_DATE, RA_CUSTOMER_TRX_LINES_ALL.LAST_UPDATED_BY, RA_CUSTOMER_TRX_LINES_ALL.CREATION_DATE, RA_CUSTOMER_TRX_LINES_ALL.CREATED_BY, RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_ID, RA_CUSTOMER_TRX_LINES_ALL.LINE_NUMBER, RA_CUSTOMER_TRX_LINES_ALL.SET_OF_BOOKS_ID, RA_CUSTOMER_TRX_LINES_ALL.INVENTORY_ITEM_ID, RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_INVOICED, RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_CREDITED, RA_CUSTOMER_TRX_LINES_ALL.UNIT_STANDARD_PRICE, RA_CUSTOMER_TRX_LINES_ALL.UNIT_SELLING_PRICE, RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER, RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER_LINE, RA_CUSTOMER_TRX_LINES_ALL.LINE_TYPE, RA_CUSTOMER_TRX_LINES_ALL.EXTENDED_AMOUNT, RA_CUSTOMER_TRX_LINES_ALL.TAX_RATE, RA_CUSTOMER_TRX_LINES_ALL.UOM_CODE, RA_CUSTOMER_TRX_LINES_ALL.ORG_ID, RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_CONTEXT, RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE6, RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE7, RA_CUSTOMER_TRX_LINES_ALL.LINK_TO_CUST_TRX_LINE_ID, RA_CUSTOMER_TRX_LINES_ALL.WAREHOUSE_ID, RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID, RA_CUSTOMER_TRX_ALL.TRX_NUMBER, RA_CUSTOMER_TRX_ALL.CUST_TRX_TYPE_ID,
RA_CUSTOMER_TRX_ALL.TRX_DATE, RA_CUSTOMER_TRX_ALL.SOLD_TO_CUSTOMER_ID, OE_ORDER_HEADERS_ALL.SOLD_TO_CONTACT_ID, RA_CUSTOMER_TRX_ALL.SOLD_TO_SITE_USE_ID, RA_CUSTOMER_TRX_ALL.BILL_TO_CUSTOMER_ID, RA_CUSTOMER_TRX_ALL.BILL_TO_SITE_USE_ID, RA_CUSTOMER_TRX_ALL.SHIP_TO_CUSTOMER_ID, RA_CUSTOMER_TRX_ALL.SHIP_TO_SITE_USE_ID, RA_CUSTOMER_TRX_ALL.TERM_ID, RA_CUSTOMER_TRX_ALL.TERM_DUE_DATE, RA_CUSTOMER_TRX_ALL.PRIMARY_SALESREP_ID, RA_CUSTOMER_TRX_ALL.PRINTING_ORIGINAL_DATE, RA_CUSTOMER_TRX_ALL.PURCHASE_ORDER, RA_CUSTOMER_TRX_ALL.EXCHANGE_DATE, RA_CUSTOMER_TRX_ALL.EXCHANGE_RATE, RA_CUSTOMER_TRX_ALL.TERRITORY_ID, RA_CUSTOMER_TRX_ALL.INVOICE_CURRENCY_CODE, RA_CUSTOMER_TRX_ALL.COMPLETE_FLAG, RA_CUSTOMER_TRX_ALL.PAYING_SITE_USE_ID, RA_CUSTOMER_TRX_LINES_ALL1.CUSTOMER_TRX_LINE_ID, RA_CUSTOMER_TRX_LINES_ALL1.INVENTORY_ITEM_ID, RA_CUSTOMER_TRX_LINES_ALL1.SALES_ORDER, RA_CUSTOMER_TRX_LINES_ALL1.SALES_ORDER_LINE, RA_CUSTOMER_TRX_LINES_ALL1.INTERFACE_LINE_CONTEXT, RA_CUSTOMER_TRX_LINES_ALL1.INTERFACE_LINE_ATTRIBUTE6, RA_CUSTOMER_TRX_LINES_ALL1.INTERFACE_LINE_ATTRIBUTE7, RA_CUSTOMER_TRX_LINES_ALL1.WAREHOUSE_ID, RA_CUSTOMER_TRX_ALL.STATUS_TRX, RA_CUSTOMER_TRX_ALL.EXCHANGE_RATE_TYPE, RA_CUSTOMER_TRX_ALL.LAST_UPDATE_DATE, RA_CUST_TRX_TYPES_ALL.LAST_UPDATE_DATE, OE_ORDER_HEADERS_ALL.LAST_UPDATE_DATE, OE_ORDER_HEADERS_ALL.SALES_CHANNEL_CODE, OE_ORDER_HEADERS_ALL.ORDER_TYPE_ID, OE_ORDER_HEADERS_ALL.PAYMENT_TYPE_CODE, OE_ORDER_HEADERS_ALL.FREIGHT_TERMS_CODE, OE_ORDER_LINES_ALL.LINE_CATEGORY_CODE, OE_ORDER_LINES_ALL.ITEM_TYPE_CODE, OE_ORDER_LINES_ALL.SHIPMENT_NUMBER, OE_ORDER_LINES_ALL.SHIP_FROM_ORG_ID, OE_ORDER_LINES_ALL.PROJECT_ID, OE_ORDER_LINES_ALL.TASK_ID, OE_ORDER_LINES_ALL.OPTION_NUMBER, OE_ORDER_LINES_ALL.COMPONENT_NUMBER, OE_ORDER_LINES_ALL.SOURCE_TYPE_CODE, OE_ORDER_HEADERS_ALL.ORDER_SOURCE_ID, RA_CUSTOMER_TRX_ALL.LEGAL_ENTITY_ID, RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE11, '0' AS X_CUSTOM FROM RA_CUSTOMER_TRX_LINES_ALL RA_CUSTOMER_TRX_LINES_ALL1, RA_CUSTOMER_TRX_LINES_ALL, RA_CUSTOMER_TRX_ALL, RA_CUST_TRX_TYPES_ALL, OE_ORDER_HEADERS_ALL, OE_ORDER_LINES_ALL WHERE RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID = RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_ID AND RA_CUSTOMER_TRX_ALL.COMPLETE_FLAG='Y' AND RA_CUSTOMER_TRX_ALL.CUST_TRX_TYPE_ID = RA_CUST_TRX_TYPES_ALL.CUST_TRX_TYPE_I
D AND RA_CUSTOMER_TRX_ALL.ORG_ID = RA_CUST_TRX_TYPES_ALL.ORG_ID AND RA_CUSTOMER_TRX_LINES_ALL.LINK_TO_CUST_TRX_LINE_ID = RA_CUSTOMER_TRX_LINES_A LL1.CUSTOMER_TRX_LINE_ID(+) AND RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_CONTEXT IN ('ORDER ENTRY', 'INTERCOMPAN Y') AND TO_NUMBER(RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE6) = OE_ORDER_LI NES_ALL.LINE_ID (+) AND OE_ORDER_LINES_ALL.HEADER_ID = OE_ORDER_HEADERS_ALL.HEADER_ID (+) AND RA_CUSTOMER_TRX_ALL.LAST_UPDATE_DATE >= TO_DATE('$$LAST_EXTRACT_DATE', 'MM/D D/YYYY HH24:MI:SS') -------------GL REvenues SELECT RA_CUSTOMER_TRX_ALL.LAST_UPDATED_BY, RA_CUSTOMER_TRX_ALL.CREATION_DATE, RA_CUSTOMER_TRX_ALL.CREATED_BY, RA_CUSTOMER_TRX_ALL.TRX_NUMBER, RA_CUSTOMER_TRX_ALL.CUST_TRX_TYPE_ID, RA_CUSTOMER_TRX_ALL.TRX_DATE, RA_CUSTOMER_TRX_ALL.BILL_TO_CONTACT_ID, RA_CUSTOMER_TRX_ALL.SOLD_TO_CUSTOMER_ID, RA_CUSTOMER_TRX_ALL.SOLD_TO_CONTACT_ID, RA_CUSTOMER_TRX_ALL.SOLD_TO_SITE_USE_ID, RA_CUSTOMER_TRX_ALL.BILL_TO_CUSTOMER_ID, RA_CUSTOMER_TRX_ALL.BILL_TO_SITE_USE_ID, RA_CUSTOMER_TRX_ALL.SHIP_TO_CUSTOMER_ID, RA_CUSTOMER_TRX_ALL.SHIP_TO_CONTACT_ID, RA_CUSTOMER_TRX_ALL.SHIP_TO_SITE_USE_ID, RA_CUSTOMER_TRX_ALL.TERM_ID, RA_CUSTOMER_TRX_ALL.PRIMARY_SALESREP_ID, RA_CUSTOMER_TRX_ALL.PURCHASE_ORDER, RA_CUSTOMER_TRX_ALL.PURCHASE_ORDER_DATE, RA_CUSTOMER_TRX_ALL.EXCHANGE_RATE_TYPE, RA_CUSTOMER_TRX_ALL.EXCHANGE_DATE, RA_CUSTOMER_TRX_ALL.EXCHANGE_RATE, RA_CUSTOMER_TRX_ALL.TERRITORY_ID, RA_CUSTOMER_TRX_ALL.INVOICE_CURRENCY_CODE, RA_CUSTOMER_TRX_ALL.SHIP_DATE_ACTUAL, RA_CUSTOMER_TRX_ALL.STATUS_TRX, RA_CUSTOMER_TRX_ALL.PAYING_CUSTOMER_ID, RA_CUSTOMER_TRX_ALL.ORG_ID, RA_CUSTOMER_TRX_ALL.LEGAL_ENTITY_ID, RA_CUSTOMER_TRX_LINES_ALL.LINE_NUMBER, RA_CUSTOMER_TRX_LINES_ALL.INVENTORY_ITEM_ID, RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_ORDERED, RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_CREDITED, RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_INVOICED, RA_CUSTOMER_TRX_LINES_ALL.UNIT_STANDARD_PRICE, RA_CUSTOMER_TRX_LINES_ALL.UNIT_SELLING_PRICE, RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER, RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER_LINE, RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER_DATE, RA_CUSTOMER_TRX_LINES_ALL.REVENUE_AMOUNT, RA_CUSTOMER_TRX_LINES_ALL.UOM_CODE, RA_CUSTOMER_TRX_LINES_ALL.WAREHOUSE_ID,
RA_CUST_TRX_LINE_GL_DIST_ALL.CUST_TRX_LINE_GL_DIST_ID, RA_CUST_TRX_LINE_GL_DIST_ALL.CODE_COMBINATION_ID, RA_CUST_TRX_LINE_GL_DIST_ALL.SET_OF_BOOKS_ID, RA_CUST_TRX_LINE_GL_DIST_ALL.AMOUNT, RA_CUST_TRX_LINE_GL_DIST_ALL.ACCTD_AMOUNT, RA_CUST_TRX_LINE_GL_DIST_ALL.GL_DATE, RA_CUST_TRX_LINE_GL_DIST_ALL.GL_POSTED_DATE, RA_CUST_TRX_LINE_GL_DIST_ALL.LAST_UPDATE_DATE, RA_CUSTOMER_TRX_ALL.LAST_UPDATE_DATE AUX1_CHANGED_ON_DT, RA_CUSTOMER_TRX_LINES_ALL.LAST_UPDATE_DATE AUX2_CHANGED_ON_DT, RA_CUST_TRX_LINE_GL_DIST_ALL.ACCOUNT_CLASS, RA_CUSTOMER_TRX_ALL.INTERFACE_HEADER_CONTEXT, RA_CUSTOMER_TRX_ALL.INTERFACE_HEADER_ATTRIBUTE1 AS PROJECT_ID FROM RA_CUSTOMER_TRX_LINES_ALL, RA_CUST_TRX_LINE_GL_DIST_ALL, RA_CUSTOMER_TRX_ALL WHERE { RA_CUST_TRX_LINE_GL_DIST_ALL INNER JOIN RA_CUSTOMER_TRX_ALL ON RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID = RA_CUST_ TRX_LINE_GL_DIST_ALL.CUSTOMER_TRX_ID INNER JOIN RA_CUSTOMER_TRX_LINES_ALL ON RA_CUST_TRX_LINE_GL_DIST_ALL.CUSTOMER_TR X_LINE_ID = RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_LINE_ID } AND RA_CUSTOMER_TRX_ALL.COMPLETE_FLAG='Y' AND (RA_CUST_TRX_LINE_GL_DIST_ALL.ACCOUNT_CLASS='REV' OR RA_CUST_TRX_LINE_GL_DIST_AL L.ACCOUNT_CLASS='UNEARN') AND ( RA_CUSTOMER_TRX_ALL.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE', 'MM/DD/YYY Y HH24:MI:SS') OR RA_CUSTOMER_TRX_LINES_ALL.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE', 'MM/ DD/YYYY HH24:MI:SS') OR RA_CUST_TRX_LINE_GL_DIST_ALL.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE', ' MM/DD/YYYY HH24:MI:SS') ) ----------------------gl - ap lINKAGE SELECT $$Hint1 DLINK.SOURCE_DISTRIBUTION_ID_NUM_1 DISTRIBUTION_ID, DLINK.SOURCE_DISTRIBUTION_TYPE SOURCE_TABLE, DLINK.ACCOUNTING_LINE_CODE LINE_CODE, AELINE.ACCOUNTING_CLASS_CODE, GLIMPREF.JE_HEADER_ID JE_HEADER_ID, GLIMPREF.JE_LINE_NUM JE_LINE_NUM, AELINE.AE_HEADER_ID AE_HEADER_ID, AELINE.AE_LINE_NUM AE_LINE_NUM, T.LEDGER_ID LEDGER_ID, T.LEDGER_CATEGORY_CODE LEDGER_TYPE, JBATCH.NAME BATCH_NAME, JHEADER.NAME HEADER_NAME, PER.END_DATE, AELINE.CODE_COMBINATION_ID
FROM GL_LEDGERS T, GL_PERIODS PER, GL_JE_HEADERS JHEADER, (SELECT $$Hint2 * FROM GL_IMPORT_REFERENCES) GLIMPREF, XLA_AE_LINES AELINE, XLA_DISTRIBUTION_LINKS DLINK, (SELECT $$Hint3 * FROM GL_JE_BATCHES) JBATCH WHERE DLINK.SOURCE_DISTRIBUTION_TYPE IN ('AP_INV_DIST', 'AP_PMT_DIST', 'AP_PREPAY') AND DLINK.APPLICATION_ID = 200 AND AELINE.APPLICATION_ID = 200 AND AELINE.GL_SL_LINK_TABLE = GLIMPREF.GL_SL_LINK_TABLE AND AELINE.GL_SL_LINK_ID = GLIMPREF.GL_SL_LINK_ID AND AELINE.AE_HEADER_ID = DLINK.AE_HEADER_ID AND AELINE.AE_LINE_NUM = DLINK.AE_LINE_NUM AND GLIMPREF.JE_HEADER_ID = JHEADER.JE_HEADER_ID AND JHEADER.JE_BATCH_ID = JBATCH.JE_BATCH_ID AND JHEADER.LEDGER_ID = T.LEDGER_ID AND JHEADER.STATUS = 'P' AND T.PERIOD_SET_NAME = PER.PERIOD_SET_NAME AND JHEADER.PERIOD_NAME = PER.PERIOD_NAME AND JHEADER.LAST_UPDATE_DATE >= TO_DATE ('$$LAST_EXTRACT_DATE', 'MM/DD/YYYY HH24:MI:SS') AND DECODE ($$FILTER_BY_LEDGER_ID, 'Y', T.LEDGER_ID, 1) IN ($$LEDGER_ID_LIST) AND DECODE ($$FILTER_BY_LEDGER_TYPE, 'Y', T.LEDGER_CATEGORY_CODE, 'NONE') IN ($$LEDGER_TYPE_LIST) Sub-ledger tabes ----------------xla_transaction_entities xla_events xla_ae_headers xla_ae_lines xla_distribution_links xla_control_balances PO --SELECT PO_HEADERS_ALL.TYPE_LOOKUP_CODE, PO_LINES_ALL.LAST_UPDATED_BY, PO_HEADERS_ALL.SEGMENT1, PO_LINES_ALL.CREATED_BY, PO_HEADERS_ALL.VENDOR_ID, PO_HEADERS_ALL.VENDOR_SITE_ID, PO_HEADERS_ALL.CURRENCY_CODE, PO_HEADERS_ALL.RATE_DATE, PO_HEADERS_ALL.RATE, PO_HEADERS_ALL.START_DATE, PO_HEADERS_ALL.AUTHORIZATION_STATUS, PO_HEADERS_ALL.REPLY_DATE, PO_HEADERS_ALL.CLOSED_CODE, PO_HEADERS_ALL.ORG_ID, PO_LINES_ALL.ITEM_ID,
PO_LINES_ALL.UNIT_PRICE, PO_LINES_ALL.UNIT_MEAS_LOOKUP_CODE, PO_LINES_ALL.LINE_NUM, PO_LINES_ALL.ITEM_DESCRIPTION, PO_LINES_ALL.CLOSED_CODE, FINANCIALS_SYSTEM_PARAMS_ALL.INVENTORY_ORGANIZATION_ID, PO_HEADERS_ALL.SHIP_TO_LOCATION_ID, PO_LINES_ALL.CREATION_DATE, PO_LINES_ALL.LAST_UPDATE_DATE, PO_LINES_ALL.PO_HEADER_ID, PO_LINES_ALL.PO_LINE_ID, PO_LINES_ALL.LAST_UPDATE_LOGIN, PO_LINES_ALL.QUANTITY, PO_HEADERS_ALL.AGENT_ID, CONTRACT.SEGMENT1, PO_LINES_ALL.QUANTITY_COMMITTED, PO_LINES_ALL.COMMITTED_AMOUNT, PO_HEADERS_ALL.USER_HOLD_FLAG, PO_LINES_ALL.CANCEL_FLAG, PO_HEADERS_ALL.LAST_UPDATE_DATE, FINANCIALS_SYSTEM_PARAMS_ALL.LAST_UPDATE_DATE, PO_LINES_ALL.LINE_TYPE_ID, PO_LINES_ALL.CATEGORY_ID, PO_LINES_ALL.MATCHING_BASIS, PO_LINES_ALL.AMOUNT, PO_LINES_ALL.RETAINAGE_RATE, PO_LINES_ALL.MAX_RETAINAGE_AMOUNT, PO_LINES_ALL.PROGRESS_PAYMENT_RATE, PO_LINES_ALL.RECOUPMENT_RATE, PO_DOC_STYLE_HEADERS.PROGRESS_PAYMENT_FLAG, PO_DOC_STYLE_HEADERS.CONTRACT_FINANCING_FLAG, CASE WHEN PO_HEADERS_ALL.TYPE_LOOKUP_CODE='BLANKET' THEN PO_HEADERS_ALL.SEGMEN T1 WHEN BLANKET_AGREEMENT.TYPE_LOOKUP_CODE = 'BLANKET' THEN BLANKET_AGREEMENT.SEG MENT1 ELSE NULL END, '0' AS X_CUSTOM, CASE WHEN PO_HEADERS_ALL.TYPE_LOOKUP_CODE='BLANKET' THEN PO_HEADERS_ALL.START_ DATE WHEN BLANKET_AGREEMENT.TYPE_LOOKUP_CODE = 'BLANKET' THEN BLANKET_AGREEMENT.STA RT_DATE ELSE NULL END, CASE WHEN PO_HEADERS_ALL.TYPE_LOOKUP_CODE='BLANKET' THEN PO_HEADERS_ALL.END_DA TE WHEN BLANKET_AGREEMENT.TYPE_LOOKUP_CODE = 'BLANKET' THEN BLANKET_AGREEMENT.END _DATE ELSE NULL END FROM PO_HEADERS_ALL, PO_LINES_ALL, FINANCIALS_SYSTEM_PARAMS_ALL, PO_DOC_STYLE_HEADERS, PO_HEADERS_ALL CONTRACT, PO_HEADERS_ALL BLANKET_AGREEMENT WHERE PO_HEADERS_ALL.TYPE_LOOKUP_CODE IN ('BLANKET', 'STANDARD', 'PLANNED') AND (PO_HEADERS_ALL.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE','MM/DD/YYYY H H24:MI:SS') OR PO_LINES_ALL.LAST_UPDATE_DATE > TO_DATE ('$$LAST_EXTRACT_DATE','MM/DD/Y YYY HH24:MI:SS')) AND PO_LINES_ALL.PO_HEADER_ID = PO_HEADERS_ALL.PO_HEADER_ID AND PO_HEADERS_ALL.ORG_ID = FINANCIALS_SYSTEM_PARAMS_ALL.ORG_ID (+) AND PO_HEADERS_ALL.STYLE_ID = PO_DOC_STYLE_HEADERS.STYLE_ID (+)
AND PO_LINES_ALL.CONTRACT_ID = CONTRACT.PO_HEADER_ID(+) AND PO_LINES_ALL.FROM_HEADER_ID = BLANKET_AGREEMENT.PO_HEADER_ID(+) ------------Receivebles ---------SELECT RCV_TRANSACTIONS.TRANSACTION_ID, PO_HEADERS_ALL.SEGMENT1, RCV_TRANSACTIONS.VENDOR_ID, RCV_TRANSACTIONS.VENDOR_SITE_ID, RCV_TRANSACTIONS.CURRENCY_CONVERSION_RATE, PO_LINE_LOCATIONS_ALL.CREATION_DATE, RCV_SHIPMENT_LINES.ITEM_ID, PO_LINES_ALL.UNIT_PRICE, PO_LINES_ALL.LINE_NUM, RCV_TRANSACTIONS.ORGANIZATION_ID, PO_LINE_LOCATIONS_ALL.SHIPMENT_NUM, PO_LINE_LOCATIONS_ALL.ORG_ID, RCV_TRANSACTIONS.DELIVER_TO_PERSON_ID, RCV_TRANSACTIONS.INV_TRANSACTION_ID, RCV_TRANSACTIONS.TRANSACTION_TYPE, NVL(RCV_TRANSACTIONS.LOCATION_ID,PO_LINE_LOCATIONS_ALL.SHIP_TO_LOCATION_ID) LO CATION_ID, RCV_TRANSACTIONS.ORGANIZATION_ID, RCV_TRANSACTIONS.CREATED_BY, RCV_TRANSACTIONS.LAST_UPDATED_BY, DECODE(RCV_TRANSACTIONS.TRANSACTION_TYPE,'MATCH',PARENT.TRANSACTION_DATE,RCV_T RANSACTIONS.TRANSACTION_DATE) TRANSACTION_DATE, RCV_TRANSACTIONS.CREATION_DATE, RCV_TRANSACTIONS.LAST_UPDATE_DATE, RCV_TRANSACTIONS.QUANTITY, RCV_TRANSACTIONS.UNIT_OF_MEASURE, RCV_TRANSACTIONS.SOURCE_DOC_UNIT_OF_MEASURE, CASE WHEN RCV_TRANSACTIONS.TRANSACTION_TYPE = 'RECEIVE' THEN RCV_SHIPMENT_LINES.QUANTITY_RECEIVED WHEN RCV_TRANSACTIONS.TRANSACTION_TYPE = 'MATCH' THEN RCV_SHIPMENT_LINES.QUANTITY_RECEIVED ELSE RCV_TRANSACTIONS.SOURCE_DOC_QUANTITY END SOURCE_DOC_QUANTITY , RCV_TRANSACTIONS.PO_UNIT_PRICE, RCV_TRANSACTIONS.CURRENCY_CODE, RCV_TRANSACTIONS.INSPECTION_STATUS_CODE, RCV_TRANSACTIONS.COMMENTS, RCV_TRANSACTIONS.REASON_ID, RCV_SHIPMENT_HEADERS.RECEIPT_NUM, RCV_SHIPMENT_LINES.LINE_NUM, RCV_TRANSACTIONS.CURRENCY_CONVERSION_DATE, PO_HEADERS_ALL.AGENT_ID, CONTRACT.SEGMENT1, RCV_TRANSACTIONS.PO_LINE_LOCATION_ID, RCV_TRANSACTIONS.EMPLOYEE_ID, PO_LINES_ALL.LAST_UPDATE_DATE, PO_LINE_LOCATIONS_ALL.LAST_UPDATE_DATE, RCV_SHIPMENT_HEADERS.LAST_UPDATE_DATE, PO_HEADERS_ALL.LAST_UPDATE_DATE,
PO_LINES_ALL.LINE_TYPE_ID, RCV_SHIPMENT_LINES.CATEGORY_ID, RCV_TRANSACTIONS.AMOUNT, PO_LINE_LOCATIONS_ALL.PAYMENT_TYPE, PO_LINE_LOCATIONS_ALL.SHIPMENT_TYPE, CASE WHEN PO_HEADERS_ALL.TYPE_LOOKUP_CODE='BLANKET' THEN PO_HEADERS_ALL.SEGMEN T1 WHEN BLANKET_AGREEMENT.TYPE_LOOKUP_CODE = 'BLANKET' THEN BLANKET_AGREEMENT.SEG MENT1 ELSE NULL END, PO_LINE_LOCATIONS_ALL.CONSIGNED_FLAG, '0' AS X_CUSTOM, NVL(PARENT.TRANSACTION_TYPE,0) PARENT_TRANSACTION_TYPE , PO_LINE_LOCATIONS_ALL.DAYS_EARLY_RECEIPT_ALLOWED DAYS_EARLY_RECEIPT_ALLOWED, PO_LINE_LOCATIONS_ALL.DAYS_LATE_RECEIPT_ALLOWED DAYS_LATE_RECEIPT_ALLOWED, PO_LINE_LOCATIONS_ALL.NEED_BY_DATE, PO_LINE_LOCATIONS_ALL.PROMISED_DATE, PO_REQUISITION_LINES_ALL.NEED_BY_DATE REQUISITION_NEED_BY_DATE, RCV_TRANSACTIONS.SOURCE_DOCUMENT_CODE, PO_RELEASES_ALL.RELEASE_NUM, RCV_SHIPMENT_LINES.UNIT_OF_MEASURE RCV_UOM FROM PO_HEADERS_ALL, PO_LINES_ALL, PO_RELEASES_ALL, PO_LINE_LOCATIONS_ALL, RCV_TRANSACTIONS, RCV_SHIPMENT_LINES, RCV_SHIPMENT_HEADERS, PO_HEADERS_ALL CONTRACT, PO_HEADERS_ALL BLANKET_AGREEMENT, PO_REQUISITION_LINES_ALL, RCV_TRANSACTIONS PARENT WHERE (RCV_SHIPMENT_HEADERS.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE','MM/DD/ YYYY HH24:MI:SS') OR RCV_SHIPMENT_LINES.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE','MM/DD/YYY Y HH24:MI:SS') OR RCV_TRANSACTIONS.LAST_UPDATE_DATE > TO_DATE('$$LAST_EXTRACT_DATE','MM/DD/YYYY HH24:MI:SS') ) AND RCV_TRANSACTIONS.PO_LINE_LOCATION_ID =PO_LINE_LOCATIONS_ALL.LINE_LOCATION_ID(+ ) AND PO_LINE_LOCATIONS_ALL.PO_RELEASE_ID = PO_RELEASES_ALL.PO_RELEASE_ID (+) AND RCV_TRANSACTIONS.PO_HEADER_ID =PO_HEADERS_ALL.PO_HEADER_ID (+) AND RCV_TRANSACTIONS.PO_LINE_ID =PO_LINES_ALL.PO_LINE_ID (+) AND RCV_TRANSACTIONS.SHIPMENT_HEADER_ID = RCV_SHIPMENT_HEADERS.SHIPMENT_HEADER_ID AND RCV_TRANSACTIONS.SHIPMENT_HEADER_ID = RCV_SHIPMENT_LINES.SHIPMENT_HEADER_ID A ND RCV_TRANSACTIONS.SHIPMENT_LINE_ID = RCV_SHIPMENT_LINES.SHIPMENT_LINE_ID AND PO_LINES_ALL.CONTRACT_ID = CONTRACT.PO_HEADER_ID(+) AND PO_LINES_ALL.FROM_HEADER_ID = BLANKET_AGREEMENT.PO_HEADER_ID(+) AND RCV_TRANSACTIONS.REQUISITION_LINE_ID = PO_REQUISITION_LINES_ALL.REQUISITION_LI NE_ID(+) AND RCV_TRANSACTIONS.TRANSACTION_TYPE IN ('RECEIVE', 'RETURN TO VENDOR', 'CORRECT', 'MATCH') AND RCV_TRANSACTIONS.PARENT_TRANSACTION_ID=PARENT.TRANSACTION_ID (+) AND NOT
( RCV_SHIPMENT_LINES.PO_HEADER_ID IS NULL AND RCV_SHIPMENT_LINES.SOURCE_DOCUMENT_CODE = 'PO' )