You are on page 1of 29

Always Be Learning

Always Be Learning
This file was generated by an automated blog to book conversion
system. Its use is governed by the licensing terms of the original
content hosted at
https://alwaysbelearning.wordpress.com/.

Powered by
Pothi.com
http://pothi.com
Contents
SQL – AP_BATCHES to Attachments 1

SQL – Form Personalization – All Info 2

R12-SQL:AP_Inv_Prepay-XLA-GL 3

PA Expenditure_Item_ID –> PA Draft Invoice to –> AR 4


Invoice Line

PA Draft Invoice link to AR Invoice 5

R12 – GL_Import_References – what do the 6


reference_# link to?

Objects applied by patch 7

Patch Number – Bug applied 8

Concurrent program – Request Group – Responsibility 9

New Links between PA and AP and/or PO after R12 10


upgrade

R12 – SQL: Profile Information 11

R12 – SQL: Application Version Info 12

R12 – SQL: Database Version info 13

R12 – SQL: Patch Level Info 14


R12 – SQL: Object updated by Patch 15

R12 – SQL: Merge Patch and one-off Patch 16


information

R12 – SQL: FV_TreasConf – XLA – GL 17

R12 – SQL: AP_Pay – XLA – GL 18

R12 – SQL: AP_Inv – XLA – GL 19

R12 – SQL: AR_Dist-XLA-GL 20

R12 – SQL: PO_RCV-XLA-GL 21

R12 – SQL: PO-XLA-GL 22

XLA Distribution Links – Link back to Transaction 23


Tables
SQL – AP_BATCHES to Attachments

January 04, 2018

If you want to see the attachment on an AP Batches record, run the


following and double clock on the LOB column (FILE_DATA).
SELECT APB.ORG_ID, APB.BATCH_ID, APB.BATCH_NAME,
APB.BATCH_DATE, APB.CONTROL_INVOICE_COUNT,
APB.CONTROL_INVOICE_TOTAL, AD.SEQ_NUM, D.FILE_NAME,
L.FILE_DATA, L.FILE_CONTENT_TYPE, L.FILE_FORMAT,
L.UPLOAD_DATE FROM APPLSYS.FND_attached_documents AD
JOIN APPLSYS.FND_DOCUMENTS D ON AD.DOCUMENT_ID =
D.DOCUMENT_ID JOIN APPLSYS.FND_LOBS L ON D.MEDIA_ID
= L.FILE_ID JOIN […]

To read more visit the original post

1
SQL – Form Personalization – All Info

August 02, 2017

SELECT distinct ffv.form_id , ffv.form_name ,


ffv.user_form_name , ffv.description “Form Descrip
ffcr.function_name ,
ffcr.description “Personalization Rule Name”, Decode
(ffcr.RULE_TYPE, ‘F’, ‘Form’, ‘A’, ‘Function’,FFCR.RULE_TYPE)
FP_Level, FFCR.Enabled, ffcr.trigger_event
ConditionT_TriggerEvent, ffcr.trigger_object
ConditionT_TriggerObject, ffcr.Condition ConditionT_Condition,
decode(ffcr.fire_in_enter_query, ‘N’,’Not in Enter-Query
Mode’,’O’,’Only in Enter_Query
Mode’,’Y’,’Both’,ffcr.fire_in_enter_query)
ConditionT_ProcessingMode, decode (ffcs.level_id,
’20’,’Site’,’10’,’Industry’,’30’,’Reponsibility’,’40’,’User’,ffcs.level_id)
ConditionT_Context_Level, ffcs.level_value
ConditionT_Context_Value, FCA.SEQUENCE
ActionT_SEQUENCE, DECODE(FCA.ACTION_TYPE,
‘P’,’Property’,’M’,’Message’, ‘B’,’Builtin’, FCA.ACTION_TYPE)
ActionT_ACTION_TYPE, […]

To read more visit the original post

2
R12-SQL:AP_Inv_Prepay-XLA-GL

February 07, 2017

** Thanks to Michael Humphrise for the following SQL** — This


SQL will get the following information: —- For each AP Invoice
Prepayment transaction Payables Information XLA table information
General Ledger information ———————————————–
select API.INVOICE_NUM, APID.AMOUNT, glcc.segment1 FUND,
glcc.segment2 BFY, glcc.segment10 OC, glcc.segment11 SGL,
xal.accounted_dr, xal.accounted_cr, XAH.EVENT_TYPE_CODE,
XDL.EVENT_CLASS_CODE,API.INVOICE_TYPE_LOOKUP_CODE
INV_TYPE, APIL.LINE_NUMBER
INV_LINE_NUM,APID.DISTRIBUTION_LINE_NUMBER
INV_DIST_LINE_NUM, APIL.DISCARDED_FLAG
INV_LINE_DISCARDED, APIL.CANCELLED_FLAG […]

To read more visit the original post

3
PA Expenditure_Item_ID –> PA Draft Invoice to –> AR
Invoice Line

May 07, 2015

select PEI.expenditure_item_id, PDI.draft_INVOICE_num,


PDII.LINE_NUM , CTL.CUSTOMER_TRX_ID,
CTL.CUSTOMER_TRX_LINE_ID from
APPS.PA_EXPENDITURE_ITEMS_ALL PEI JOIN
apps.PA_CUST_REV_DIST_LINES_ALL rev ON
(PEI.EXPENDITURE_ITEM_ID = REV.EXPENDITURE_ITEM_ID)
JOIN APPS.pa_draft_invoice_items pdii on (REV.project_id =
pdii.project_id and REV.draft_invoice_num = pdii.draft_invoice_num
AND REV.DRAFT_REVENUE_ITEM_LINE_NUM =
PDII.LINE_NUM) JOIN APPS.pa_draft_invoices_all pdi ON
(PDII.project_id=pdi.project_id AND PDII.DRAFT_INVOICE_NUM =
PDI.DRAFT_INVOICE_NUM) LEFT OUTER JOIN
apps.ra_customer_trx_lines_all ctl on (PDI.SYSTEM_REFERENCE
= CTL.CUSTOMER_TRX_ID AND PDII.LINE_NUM =
CTL.INTERFACE_LINE_ATTRIBUTE6 and […]

To read more visit the original post

4
PA Draft Invoice link to AR Invoice

April 21, 2015

From Flexfield setup in the application: For


RA_CUSTOMER_TRX_ALL AND
RA_CUSTOMER_TRX_LINES_ALL Interface Line context =
‘PROJECTS INVOICES’ Interface_Line_attribute1 ->
Project_number Interface_Line_attribute2 -> Draft Invoice Number
Interface_Line_attribute3 -> Agreement Number
Interface_Line_attribute4 -> Project Organization
Interface_Line_attribute5 -> Project Manager
Interface_Line_attribute6 -> Line Number Interface_Line_attribute7
-> Type Interface_Line_attribute8 -> Line Type And might be able to
depend on: PA_DRAFT_INVOICES_ALL.SYSTEM_REFERENCE
[…]

To read more visit the original post

5
R12 – GL_Import_References – what do the reference_#
link to?

November 18, 2014

Linking between the Subledger and GL can take some investigation


for those newly on R12. In past post I have posted SQL that shows
how to link Subledger to XLA to GL…and
GL_IMPORT_REFERENCE.Reference_# fields are not used. So
what does the reference_# information in gl_import_reference table
link to? Here is what I found: Gl_import_references.reference_5 =
[…]

To read more visit the original post

6
Objects applied by patch

September 03, 2014

Give the patch number and get all the objects updated/applied by
the patch. Use this to know what objects were updated and need to
be tested. SELECT A.BUG_NUMBER “Patch Number”, B.
PATCh_RUN_BUG_ID “Run Id”, D.APP_SHORT_NAME appl_top,
D.SUBDIR, D.FILENAME, max(F.VERSION) latest,
E.ACTION_CODE action from APPS.AD_BUGS A,
APPS.AD_PATCH_RUN_BUGS B,
APPS.AD_PATCH_RUN_BUG_ACTIONS C, APPS.AD_FILES D,
APPS.AD_PATCH_COMMON_ACTIONS E,
APPS.AD_FILE_VERSIONS F […]

To read more visit the original post

7
Patch Number – Bug applied

September 03, 2014

Give the patch number and get the bugs that were applied by the
patch: ** If the DBA did a “merge patch” put in the merge patch
name instead of the patch number *** select Distinct
ap.patch_name, ap.patch_type, b.bug_number “Patch/Bug Fix
Applied”, b.creation_date “Patch/Bug Fix Dt”, prb.applied_flag,
prb.reason_not_applied, prb.success_flag, prb.failure_comments,
prb.application_short_name, apr.start_date, apr.end_date,
pd.orig_patch_name, pd.driver_file_name, […]

To read more visit the original post

8
Concurrent program – Request Group – Responsibility

September 03, 2014

Use this SQL to identify a concurrent program and which Request


group the concurrent program is assigned and what request group
the Responsibility is assigned. Works for 11i and R12: —————–
— Will return even if Enabled flag = N — and Resp is end_dated
—————— SELECT
CPT.USER_CONCURRENT_PROGRAM_NAME,
FRV.RESPONSIBILITY_NAME, FRG.REQUEST_GROUP_NAME,
FRG.DESCRIPTION, CPT.CONCURRENT_PROGRAM_ID,
CPT.CONCURRENT_PROGRAM_NAME ,cpt.application_id
,A.APPLICATION_SHORT_NAME […]

To read more visit the original post

9
New Links between PA and AP and/or PO after R12
upgrade

February 26, 2014

Information below applies to transactions with cost


transferred/interfaced from AP and PO into projects —
pei.TRANSACTION_SOURCE IN (‘AP INVOICE’,’PO RECEIPT’,
‘AP DISCOUNT’) In Summary: *** After your R12 upgrade: Run
Concurrent Program: UPG: Upgrade Transaction Attributes ****** If
you do not run: UPG: Upgrade Transaction Attributes’ – then the
document_header_id, document_line_number,
document_distribution_id, etc. will be […]

To read more visit the original post

10
R12 – SQL: Profile Information

December 18, 2012

/************* This SQL will return profile information at all levels. If a


profile returns “undef” then the profile option is not set at any level.
***************/ SELECT p.profile_option_name SHORT_NAME,
n.user_profile_option_name NAME, DECODE ( v.level_id, 10001,
‘Site’, 10002, ‘Application’, 10003, ‘Responsibility’, 10004, ‘User’,
10005, ‘Server’, 10006, ‘Org’, 10007, DECODE ( TO_CHAR
(v.level_value2), ‘-1’, ‘Responsibility’, DECODE (TO_CHAR […]

To read more visit the original post

11
R12 – SQL: Application Version Info

December 18, 2012

/************ This will return Oracle application version information.


***********/ select max(substr(release_name,1,8)) from
APPS.fnd_product_groups

To read more visit the original post

12
R12 – SQL: Database Version info

December 18, 2012

/*********** This will return the database version information


***********/ select ‘DB_VERSION: ‘, TO_CHAR(MAX(version)) from
v$instance UNION SELECT ‘CREATED DATE: ‘,
TO_CHAR(MAX(CREATED)) FROM V$DATABASE UNION
SELECT ‘INSTANCE NAME: ‘, TO_CHAR(MAX(NAME)) FROM
V$DATABASE

To read more visit the original post

13
R12 – SQL: Patch Level Info

December 18, 2012

/******** This SQL will list the module application patch level.
*********/ SELECT fa.application_name “APPLICATION” ,
SUBSTR(APPLICATION_SHORT_NAME,1,10) “SHORT_NAME” ,
RPAD (DECODE(fpi.STATUS , ‘I’, ‘Installed’ , ‘S’, ‘Shared Install’ ,
‘N’, ‘Not Installed’),14,’ ‘) “INSTALL STATUS” ,
SUBSTR(PATCH_LEVEL,1,12) “PATCH LEVEL” , fa.description
“APPLICATION DESCRIPTION” FROM
APPS.FND_PRODUCT_INSTALLATIONS fpi ,
APPS.FND_APPLICATION_vl fa WHERE fa.APPLICATION_ID =
fpi.APPLICATION_ID –AND UPPER(fa.application_name) LIKE […]

To read more visit the original post

14
R12 – SQL: Object updated by Patch

December 18, 2012

/******************* This SQL will list objects that were updated by a


patch application. **********************/ SELECT A.BUG_NUMBER
“Patch Number”, B. PATCh_RUN_BUG_ID “Run Id”,
D.APP_SHORT_NAME appl_top, D.SUBDIR, D.FILENAME,
max(F.VERSION) latest, E.ACTION_CODE action from AD_BUGS
A, AD_PATCH_RUN_BUGS B, AD_PATCH_RUN_BUG_ACTIONS
C, AD_FILES D, AD_PATCH_COMMON_ACTIONS E,
AD_FILE_VERSIONS F where A.BUG_ID = B.BUG_ID and
B.PATCH_RUN_BUG_ID = C.PATCH_RUN_BUG_ID and
C.FILE_ID = D.FILE_ID […]

To read more visit the original post

15
R12 – SQL: Merge Patch and one-off Patch information

December 18, 2012

/*************** This SQL will return date and success information


about patch application. It will also detail the individual patches in a
merge patch or roll-up patch. *************/ select distinct
ap.patch_name, ap.patch_type, b.bug_number “Patch/Bug Fix
Applied”, b.creation_date “Patch/Bug Fix Dt”, prb.applied_flag,
prb.reason_not_applied, prb.success_flag, prb.failure_comments,
prb.application_short_name, apr.start_date, apr.end_date,
pd.orig_patch_name, pd.driver_file_name, pd.merged_driver_flag,
pd.merge_date, pd.patch_abstract from apps.ad_bugs b,
apps.ad_patch_run_bugs […]

To read more visit the original post

16
R12 – SQL: FV_TreasConf – XLA – GL

December 17, 2012

/***** This SQL should return: FV Treasury Confirmation Information


SLA Information GL Information ********/ select
APC.CHECKRUN_NAME,APC.AMOUNT,
FTC.CHECKRUN_NAME, FTC.TREASURY_AMOUNT,
FTC.CONFIRMATION_STATUS_FLAG,
xdl.ACCOUNTING_LINE_CODE, XDL.LINE_DEFINITION_CODE,
XDL.EVENT_CLASS_CODE, xal.accounted_dr, xal.accounted_cr,
jeh.ledger_id, jeb.name, jeb.creation_date, jeh.je_source,
jeh.je_category, jel.je_line_num, nvl(jel.accounted_dr,0)
accounted_dr, nvl(jel.accounted_cr,0) accounted_cr,
glcc.segment1, glcc.segment2, glcc.segment3, glcc.segment4,
glcc.segment5, glcc.segment6 from
APPS.AP_PAYMENT_HIST_DISTS APHD,
APPS.AP_INVOICE_PAYMENTS_ALL APIP,
APPS.AP_CHECKS_ALL APC, apps.fv_treasury_confirmations_all
ftc, apps.xla_distribution_links xdl, apps.xla_ae_lines xal,
APPS.GL_IMPORT_REFERENCES gif, […]

To read more visit the original post

17
R12 – SQL: AP_Pay – XLA – GL

December 17, 2012

/****** This SQL Should Return: AP Payment Information SLA


Information GL Information *********/ select
APC.CHECKRUN_NAME, APC.CHECK_NUMBER,
APC.AMOUNT, APH.TRANSACTION_TYPE,
APH.TRX_PMT_AMOUNT, APHD.AMOUNT PAY_DIST_AMOUNT,
xdl.ACCOUNTING_LINE_CODE, XDL.LINE_DEFINITION_CODE,
XDL.EVENT_CLASS_CODE, xal.accounted_dr, xal.accounted_cr,
jeh.ledger_id, jeb.name, jeb.creation_date, jeh.je_source,
jeh.je_category, jel.je_line_num, nvl(jel.accounted_dr,0)
accounted_dr, nvl(jel.accounted_cr,0) accounted_cr,
glcc.segment1, glcc.segment2, glcc.segment3, glcc.segment4,
glcc.segment5, glcc.segment6 from
APPS.AP_PAYMENT_HIST_DISTS APHD,
apps.AP_PAYMENT_HISTORY_ALL APH,
APPS.AP_CHECKS_ALL APC, apps.xla_distribution_links xdl,
apps.xla_ae_lines xal, APPS.GL_IMPORT_REFERENCES gif, […]

To read more visit the original post

18
R12 – SQL: AP_Inv – XLA – GL

December 17, 2012

/****** This SQL should return: AP Invoice Information SLA


Information GL Information —> This SQL is specific for posting in
detail NOT summary. If the application is posting in summary –
there will be a many to one relationship and the SQL will return
informatoin that appears to be a cartession join. See comments for
[…]

To read more visit the original post

19
R12 – SQL: AR_Dist-XLA-GL

December 17, 2012

/************* This SQL should return: AR Dist Trans information SLA


Information GL Information ****************/ SELECT
XDL.SOURCE_DISTRIBUTION_TYPE,
xdl.source_distribution_type, xdl.source_distribution_id_num_1,
xal.accounting_class_code, xal.description, xal.accounted_dr,
xal.accounted_cr, jeh.ledger_id, jeb.name, jeb.creation_date,
jeh.je_source, jeh.je_category, jel.je_line_num,
nvl(jel.accounted_dr,0) accounted_dr, nvl(jel.accounted_cr,0)
accounted_cr, glcc.segment1, glcc.segment2, glcc.segment3,
glcc.segment4, glcc.segment5, glcc.segment6 FROM
APPS.AR_DISTRIBUTIONS_ALL ARD,
APPS.XLA_DISTRIBUTION_LINKS XDL, APPS.XLA_AE_LINES
XAL, APPS.GL_IMPORT_REFERENCES gif, apps.gl_je_lines jel,
apps.gl_je_headers jeh, apps.gl_je_batches jeb,
apps.gl_code_combinations glcc […]

To read more visit the original post

20
R12 – SQL: PO_RCV-XLA-GL

December 17, 2012

/************** This sql should return information about: PO Receipt


transaction SLA Information GL Information ************************/
select rsh.receipt_num, rsl.line_num, rsl.item_description,
rsl.shipment_line_status_code, rsl.destination_type_code,
rt.quantity, rt.unit_of_measure, rt.user_entered_flag,
rt.po_unit_price, rt.destination_context, rt.invoice_status_code,
xdl.ACCOUNTING_LINE_CODE, XDL.LINE_DEFINITION_CODE,
XDL.EVENT_CLASS_CODE, xal.accounted_dr, xal.accounted_cr,
jeh.ledger_id, jeb.name, jeb.creation_date, jeh.je_source,
jeh.je_category, jel.je_line_num, nvl(jel.accounted_dr,0)
accounted_dr, nvl(jel.accounted_cr,0) accounted_cr,
glcc.segment1, glcc.segment2, glcc.segment3, glcc.segment4,
glcc.segment5, glcc.segment6 from apps.rcv_shipment_headers
rsh, apps.rcv_shipment_lines rsl , apps.rcv_transactions […]

To read more visit the original post

21
R12 – SQL: PO-XLA-GL

December 17, 2012

/************************** The following SQL should return information


about: PO Transaction XLA Information GL Information
*************************/ select poh.org_id, poh.segment1 po_num,
pol.line_num, poll.shipment_num, por.release_num,
pod.distribution_num, nvl(poll.price_override,pol.unit_price)
Unit_price, pod.quantity_ordered, pod.quantity_delivered,
pod.quantity_billed, pod.quantity_cancelled,
xdl.ACCOUNTING_LINE_CODE, XDL.LINE_DEFINITION_CODE,
XDL.EVENT_CLASS_CODE, xal.accounted_dr, xal.accounted_cr,
jeh.ledger_id, jeb.name, jeb.creation_date, jeh.je_source,
jeh.je_category, jel.je_line_num, nvl(jel.accounted_dr,0)
accounted_dr, nvl(jel.accounted_cr,0) accounted_cr,
glcc.segment1, glcc.segment2, glcc.segment3, glcc.segment4,
glcc.segment5, glcc.segment6 from apps.po_headers_all poh,
apps.po_lines_all pol, […]

To read more visit the original post

22
XLA Distribution Links – Link back to Transaction Tables

December 17, 2012

MODULE APPLICATION_ID SOURCE_DISTRIBUTION_TYPE


SOURCE_DISTRIBUTION_ID_NUM_1 TABLE LINK
APPLIED_TO_SOURCE_ID_NUM_1 TABLE LINK AR 222
MFAR_DISTRIBUTIONS_ALL AR_DISTRIBUTIONS_ALL.LINE_ID
AR 222 AR_DISTRIBUTIONS_
AR_DISTRIBUTIONS_ALL.LINE_ID AP 200 AP_PMT_DIST
AP_PAYMENT_HIST_DIST.PAYMENT_HIST_DIST_ID AP 200
AP_INV_DIST
AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_DISTRIBUTION_ID
FV-AP 8901 FV_TREASURY_CONFIRMATIONS_ALL
AP_PAYMENT_HIST_DIST.PAYMENT_HIST_DIST_ID
FV_TREASURY_CONFIRMATION_ALL.TREASURY_CONFIRMATION_I
PO 201 PO_DISTRIBUTION_ALL
PO_DISTRIBUTION_ALL.PO_DISTRIBUTION_ID PO 707
RCV_RECEIVING_SUB_LEDGER
RCV_RECEIVING_SUB_LEDGER.RCV_SUB_LEDGER_ID

To read more visit the original post

23

You might also like