Friday 26 May 2017

XML Publisher FND LOAD

Step 1: Concurrent Program download and upload


FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct /export/home/appldev/XX_GL_TRI_BAL.ldt PROGRAM APPLICATION_SHORT_NAME=XXNPS CONCURRENT_PROGRAM_NAME=XX_GL_TRI_BAL

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct /export/home/appldev/XX_GL_TRI_BAL.ldt

Step 2: XML Publisher data definition and template download and upload

FNDLOAD apps/apps O Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XX_GL_TRI_BAL_TEMP_DATA.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=XXNPS DATA_SOURCE_CODE=XX_GL_TRI_BAL TMPL_APP_SHORT_NAME=XXNPS TEMPLATE_CODE=XX_GL_TRI_BAL

FNDLOAD apps/apps O Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct /export/home/appldev/XX_GL_TRI_BAL_TEMP_DATA.ldt

Step3: RTF(OR)Template file upload and download

java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION erp-test:1528:UAT \
-LOB_TYPE TEMPLATE \
-APPS_SHORT_NAME XXNPS \
-LOB_CODE XX_GL_TRI_BAL \
-LANGUAGE en \
-TERRITORY US \
-LOG_FILE xdotmpl.log \
-DEBUG true

java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION erp-dev.:1541:TEST \
-LOB_TYPE TEMPLATE \
-APPS_SHORT_NAME XXNPS \
-LOB_CODE XX_GL_TRI_BAL \
-LANGUAGE en \
-XDO_FILE_TYPE RTF \
-FILE_CONTENT_TYPE text/html  \
-FILE_NAME /export/home/appldev/XX_GL_TRI_BAL.rtf \
-CUSTOM_MODE FORCE

XDOLoader Utility to upload XML Templates

The XDOLoader utility is a Java-based command line program to load template (RTF, PDF, and XSL-FO), XML, and XSD files to the XML Publisher database tables. Before uploading any xml template you need to upload your concurrent program (if any) and data definitions through the FNDLOAD utility.

General Syntax to execute the XDOLoader utility as follows:


% java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
-DB_USERNAME <db_username> \
-DB_PASSWORD <db_password> \
-JDBC_CONNECTION <jdbc_con_string> \
-LOB_TYPE <lob_type> \
-APPS_SHORT_NAME <application_short_name> \
-LOB_CODE <lob_code> \
-LANGUAGE  \
-TERRITORY  \
-XDO_FILE_TYPE <xdo_file_type> \
-NLS_LANG <NLS_LANG> \
-FILE_CONTENT_TYPE <file_content_type> \
-FILE_NAME <file_name> \
-OWNER  \
-CUSTOM_MODE [FORCE|NOFORCE]
-LOG_FILE <log file>
 

The parameters are described below:
  • UPLOAD (Mandatory): The first parameter: UPLOAD will be implemented in the feature.
  • DB_USERNAME (Mandatory): Database user name (example: apps).
  • DB_PASSWORD (Mandatory): Database user password (example: manager).
  • JDBC_CONNECTION (Mandatory): JDBC database connection string
    (example: ap000sun:1234:ebs).
  • LOB_TYPE (Mandatory):  XDO LOB type. Valid values are: ‘TEMPLATE’, ‘XML_SCHEMA’ and ‘XML_SAMPLE’
  • APPS_SHORT_NAME (Mandatory):  Application short name (example: AR).
  • LOB_CODE (Mandatory):  XDO LOB code. Enter either the Template Code or the Data Definition Code.
  • LANGUAGE (Optional): ISO two-letter language code (example: en).
  • TERRITORY (Optional): ISO two-letter territory code (example: US), default is ’00’.
  • XDO_FILE_TYPE (Mandatory):  Enter the XDO file type, valid values are: PDF, RTF, XLS, XSL-FO, XSL-HTML, XSL-XML, XSLTEXT, XSD, XML, RTF-ETEXT
  • NLS_LANG (Optional): Enter the NLS_LANG environment variable.
  • FILE_CONTENT_TYPE (Optional): Content type of the file (example: text/html, application/pdf)
  • FILE_NAME (Mandatory): Name of the file you want to upload. You can give full path name of the file.
  • OWNER (Optional): Owner of the template. Default is “ORACLE”.
  • CUSTOM_MODE (Optional): Whether to force update. Valid values are FORCE and NOFORCE (default).
  • LOG_FILE (Optional): Enter a file name for the output log file (default: xdotmpl.log).
Sample script to run the XDOLoader utility to upload a xml template:

echo  "----------------------------------------------------------------------"
echo  "Please enter the following details needed for the XML XDOLoad process"
echo  "This details can be found in the TNS entry"
echo  "----------------------------------------------------------------------"

echo "Enter Apps password  =>"
read apps_pw

echo "Enter Host TNS Database Server name  =>"
read v_host

echo "Enter Host Database TNS Port Number =>"
read v_port

echo "Enter Host Database SID name =>"
read v_sid

echo "Uploading rtf(XXFIN_SAMPLE_TEMPLATE.rtf) for the XML Template Definition"

java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD $apps_pw \
-JDBC_CONNECTION $v_host:$v_port:$v_sid \
-LOB_TYPE TEMPLATE \
-APPS_SHORT_NAME "IBY" \
-LOB_CODE "XXFIN_TEMPLATE_CODE" \
-LANGUAGE en \
-XDO_FILE_TYPE RTF-ETEXT \
-FILE_CONTENT_TYPE 'text/html' \
-FILE_NAME "$XXFIN_TOP/templates/XXFIN_SAMPLE_TEMPLATE.rtf" \
-CUSTOM_MODE FORCE

echo  "Finish uploading rtf(XXFIN_SAMPLE_TEMPLATE.rtf) for the XML Template Definit

APP-FND-00222: Encountered an error while getting the ORACLE user account for your concurrent request Contact your system administrator

Error:






 Checked for relevance 14-Apr-2010 Application Install 11.5.6 to 12.0
  • fact: Oracle Application Object Library
  • fact: FNDRSRUN - Run Reports
  • symptom: APP-FND-00222 Encountered an error while getting the ORACLE user account for your concurrent request to run from
  • symptom: Error submitting concurrent request registered to a custom application
  • cause: The custom application has not been assigned to any data grou

fix:

Add the custom application to a data group.

1.  Under the System Administrator responsibility navigate to Security --> 
Oracle --> DataGroup.
2.  Query up a data group (Standard Data Group is appropriate).
3.  A list of applications associated with the standard data group will appear.
4.  Click on FILE in the toolbar menu then click on NEW.
5.  In the Application column select the custom application from the LOV.
6.  Add an Oracle ID to the ORACLE ID column (APPS is appropriate)
7.  Save the changes.
8.  Resubmit the concurrent request.









Run the Report:



Thursday 18 May 2017

Link Between FA and GL table using XLA tables

/* Formatted on 5/18/2017 4:39:48 PM (QP5 v5.114.809.3010) */
SELECT   *
  FROM   GL_JE_HEADERS GJH,
         GL_JE_LINES GJL,
         GL_IMPORT_REFERENCES GIR,
         XLA_AE_LINES XAL,
         XLA_AE_HEADERS XAH,
         FA_TRANSACTION_HEADERS FTH,
         FA_ADJUSTMENTS FAA
 WHERE       GJH.JE_HEADER_ID = GJL.JE_HEADER_ID
         AND GJH.JE_HEADER_ID = GIR.JE_HEADER_ID
         AND GJL.JE_LINE_ID = GIR.JE_LINE_ID
         AND GIR.GL_SL_LINK_ID = XAL.GL_SL_LINK_ID
         AND XAL.AE_HEADER_ID = XAH.AE_HEADER_ID
         AND XAH.EVENT_ID = FTH.EVENT_ID
         AND FTH.TRANSACTION_HEADER_ID = FAA.TRANSACTION_HEADER_ID

Link between GL and AR through XLA

The main link to bind information together is the GL_SL_LINK_ID. This field exists in GL_JE_LINES, GL_IMPORT_REFERENCES and XLA_AE_LINES tables.

Also, the XLA_DISTRIBUTION_LINKS table contains the application_id, event_id, ae_header_id, ae_line_num from the XLA Tables and source_distribution_id_num_1 will be the cust_trx_line_gl_dist_id in the case of a transaction.

Query 1: For complete Transaction

/* Formatted on 5/18/2017 4:37:29 PM (QP5 v5.114.809.3010) */
SELECT   *
  FROM   RA_CUSTOMER_TRX_ALL RCTA,
         RA_CUST_TRX_LINE_GL_DIST_ALL RCTG,
         XLA_TRANSACTION_ENTITIES XTE,
         XLA_EVENTS XE
 WHERE       RCTA.CUSTOMER_TRX_ID = RCTG.CUSTOMER_TRX_ID
         AND RCTA.CUSTOMER_TRX_ID = XTE.SOURCE_ID_INT_1
         AND XTE.ENTITY_ID = XE.ENTITY_ID

Query 2: After Create accounting Run

/* Formatted on 5/18/2017 4:38:04 PM (QP5 v5.114.809.3010) */
SELECT   *
  FROM   RA_CUST_TRX_LINE_GL_DIST_ALL RCTG,
         XLA_DISTRIBUTION_LINKS XDL,
         XLA_AE_LINES XAL,
         XLA_AE_HEADERS XAH
 WHERE       RCTG.CUST_TRX_LINE_GL_DIST_ID = XDL.SOURCE_DISTRIBUTION_ID_NUM_1
         AND XAL.AE_HEADER_ID = XDL.AE_HEADER_ID
         AND XAH.AE_HEADER_ID = XDL.AE_HEADER_ID

Query 3 : After Run Transfer to GL

/* Formatted on 5/18/2017 4:38:33 PM (QP5 v5.114.809.3010) */
SELECT   *
  FROM   XLA_AE_LINES XAL,
         GL_JE_LINES GJL,
         GL_IMPORT_REFERENCES GIR,
         GL_JE_HEADERS GJH
 WHERE       XAL.GL_SL_LINK_ID = GJL.GL_SL_LINK_ID
         AND XAL.GL_SL_LINK_ID = GIR.GL_SL_LINK_ID
         AND GIR.JE_HEADER_ID = GJL.JE_HEADER_ID
         AND GIR.JE_HEADER_ID = GJH.JE_HEADER_ID

XML Publisher FND LOAD DOWNLOAD mode syntax

It surprises me how few people are aware of the generic loader (XDOLoader) for XML / BI Publisher (BIP) files.

Like FNDLOAD for AOL / XML Publisher metadata and WFLOAD for Workflow Item Types, XDOLoader is is a command line utility that allows you to migrate the BIP files between environments. The following BIP file types can be upload and downloaded:

- TEMPLATE
- XML_SCHEMA
- XML_SAMPLE
- DATA TEMPLATE


Call XDOLoader in DOWNLOAD mode to create a local copy of the relevant object.
Call XDOLoader in UPLOAD mode to load your local definitions into the database.

Here's the DOWNLOAD syntax and some examples for Oracle E-Business suite users:

DOWNLOAD MODE SYNTAX:
% java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD \
-DB_USERNAME \
-DB_PASSWORD \
-JDBC_CONNECTION \
-LOB_TYPE \
-APPS_SHORT_NAME \
-LOB_CODE \
-LANGUAGE \
-TERRITORY \
-LOG_FILE \
-DEBUG

KEY (for E-Business suite Users):

-DB_USERNAME: apps username for the target instance
-DB_PASSWORD: apps password for the target instance
-JDBC_CONNECTION: JDBC connection string (e.g. server:port:sid)
of the target instance
-LOB_TYPE: The XML Publisher object type.
One of 'TEMPLATE', 'XML_SCHEMA', 'XML_SAMPLE' or 'DATA TEMPLATE'
-APPS_SHORT_NAME: Application short name used to register the XML Publisher object
-LOB_CODE: Template code i.e. concurrent program short name
-LANGUAGE: ISO language code(i.e. en) used when registering the object
-TERRITORY: ISO language code(i.e. GB) used when registering the object
-LOG_FILE: Name of the log file. The default filename is xdotmpl.log
-DEBUG: Run in Debug mode. Valid values are 'true' or 'false'


DOWNLOAD MODE EXAMPLES:


This is the simple shell script that I use to download 'GB English' presentation and data templates.
(Note - Change your language and territory as appropriate):

-----------------------------------------
# Get parameters
apps_psw=$1
jdbc_con=$2
app_short_name=$3
lob_code=$4

# Download XML Publisher Template RTF and XSL
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD \
-DB_USERNAME apps \
-DB_PASSWORD $apps_psw \
-JDBC_CONNECTION $jdbc_con \
-LOB_TYPE TEMPLATE \
-APPS_SHORT_NAME $app_short_name \
-LOB_CODE $lob_code \
-LANGUAGE en \
-TERRITORY GB \
-LOG_FILE xdotmpl.log \
-DEBUG true

# Download XML Publisher dataTemplate
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD \
-DB_USERNAME apps \
-DB_PASSWORD $apps_psw \
-JDBC_CONNECTION $jdbc_con \
-LOB_TYPE DATA_TEMPLATE \
-APPS_SHORT_NAME $app_short_name \
-LOB_CODE $lob_code \
-LANGUAGE en \
-TERRITORY GB \
-LOG_FILE xdotmpl.log \
-DEBUG true
-----------------------------------------

ADDITIONAL NOTES:

1) Don't forget to download your XML Publisher metadata using the FNDLOAD utility. The control file name is xdotmpl.lct.

API - Create New Code Combination In GL

DECLARE
   CURSOR c1
   IS
      SELECT *
        FROM temp_gl_code;

   v_chart_of_accounts_id    VARCHAR2 (200);
   v_n_code_combination_id   VARCHAR2 (200);
BEGIN
   FOR i in c1
   LOOP
      SELECT gsob.chart_of_accounts_id      -- To Get the Chart of Accounts id
        INTO v_chart_of_accounts_id
        FROM gl_sets_of_books gsob
       WHERE gsob.set_of_books_id = fnd_profile.VALUE ('GL_SET_OF_BKS_ID');

      v_n_code_combination_id :=
         fnd_flex_ext.get_ccid ('SQLGL',
                                'GL#',
                                v_chart_of_accounts_id,
                                TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),
                                i.CODE_COBIN
                               );

      IF v_n_code_combination_id <> 0
      THEN
         DBMS_OUTPUT.put_line ('success');
      ELSE
         DBMS_OUTPUT.put_line ('failure');
      END IF;
   END LOOP;
END;

How to change Language To Arabic in Toad Oracle

Step 1: Check what NLS_LANGUAGE is being used in your database.

SELECT    (SELECT VALUE
             FROM nls_database_parameters
            WHERE parameter = 'NLS_LANGUAGE')
       || '_'
       || (SELECT VALUE
             FROM nls_database_parameters
            WHERE parameter = 'NLS_TERRITORY')
       || '.'
       || (SELECT VALUE
             FROM nls_database_parameters
            WHERE parameter = 'NLS_CHARACTERSET') LANGUAGE
  FROM DUAL



Step 2: Change the NLS _ LANGUAGE in Toad to the same.
Step 3: Open Toad
Step 4: Click on the button as shown below



Step 5 : Click on the current  NLS_LANGUAGE
Sept 6 : Change it according to the database.
Sept 7 : Save the changes and close toad application then start again.
 Now Connect to the database...

Monday 15 May 2017

How to Purge Debug Log, Closed Notifications and Concurrent Program Log/out files in Oracle Applications


Concurrent program “Purge Debug Log and System Alerts” in Release 11i and “Purge Logs and Closed System Alerts” in Release 12 is recommended way to purge messages.

 This program purges all messages up to the specified date,except messages for active transactions (new or open alerts, active ICX sessions, concurrent requests, and so on). This program is by default scheduled to run daily and purge messages older than 7 days. Internally this concurrent program invokes FND_LOG_ADMIN APIs.

Data from the following tables will be deleted when you run “Purge Logs and Closed System Alerts'” or “Purge Debug Log and System Alerts” program :

select * from FND_EXCEPTION_NOTES;

select * from FND_OAM_BIZEX_SENT_NOTIF;

select * from FND_LOG_METRICS;

select * from FND_LOG_UNIQUE_EXCEPTIONS;

select * from FND_LOG_EXCEPTIONS;

select * from FND_LOG_MESSAGES;

select * from FND_LOG_TRANSACTION_CONTEXT;

select * from FND_LOG_ATTACHMENTS

These tables contain debug & error messages.

Purge Concurrent Request and/or Manager Data Program

This concurrent program is used to purge concurrent requests log/out file, and/or CM log files.

Query to find Cloned Date, Version Details, URL of Oracle Applications

Query to get Instance Version details

SELECT product,
       version,
       status
FROM   product_component_version;  


Query to  get cloned date of an oracle instance

SELECT resetlogs_time
FROM   v$database; 


Query to get the front end URL from back-end

SELECT home_url
FROM   icx_parameters; 
 

Friday 12 May 2017

AR to GL link Query [ O2C full flow technical reference ]

/* Formatted on 5/12/2017 4:23:28 PM (QP5 v5.114.809.3010) */
SELECT   ooha.order_number,
         ooha.org_id,
         hca.account_name,
         hp.party_name "Customer Name",
         hcasab.orig_system_reference BILL_TO_ORIG_REF,
         hpsb.status BILL_TO_STATUS,
            'ADDRESS1 - '
         || bill_loc.address1
         || ','
         || CHR (10)
         || 'ADDRESS2 - '
         || bill_loc.address2
         || ','
         || CHR (10)
         || 'ADDRESS3 - '
         || bill_loc.address3
         || ','
         || CHR (10)
         || 'CITY     - '
         || bill_loc.city
         || ','
         || CHR (10)
         || 'POSTAL CD- '
         || bill_loc.postal_code
         || ','
         || CHR (10)
         || 'COUNTRY  - '
         || bill_loc.country
            BILL_TO_ADDRESS,
         hcasas.orig_system_reference SHIP_TO_ORIG_REF,
         hpss.status SHIP_TO_STATUS,
            'ADDRESS1 - '
         || ship_loc.address1
         || ','
         || CHR (10)
         || 'ADDRESS2 - '
         || ship_loc.address2
         || ','
         || CHR (10)
         || 'ADDRESS3 - '
         || ship_loc.address3
         || ','
         || CHR (10)
         || 'CITY     - '
         || ship_loc.city
         || ','
         || CHR (10)
         || 'POSTAL CD- '
         || ship_loc.postal_code
         || ','
         || CHR (10)
         || 'COUNTRY  - '
         || ship_loc.country
            SHIP_TO_ADDRESS,
         oola.inventory_item_id,
         oola.ordered_item,
         msib.description item_description,
         wnd.name delivery_number,
         rct.trx_number "AR Invoice Number",
         acr.receipt_number "AR Receipt Number",
         gjh.ledger_id,
         gjh.name
  FROM  -- Enter the Sales Order:
         oe_order_headers_all ooha,
         oe_order_lines_all oola,
         -- Enter the Sales Order: --
         -- AR Customer Detail
         hz_parties hp,
         hz_cust_accounts hca,
         hz_party_sites hpss,
         hz_party_sites hpsb,
         hz_locations bill_loc,
         hz_locations ship_loc,
         hz_cust_acct_sites_all hcasab,
         hz_cust_acct_sites_all hcasas,
         hz_cust_site_uses_all hzsuab,
         hz_cust_site_uses_all hzsuas,
         -- AR Customer Detail : --
         mtl_system_items_b msib,
         -- Book the Sales Order:
         wsh_delivery_details wdd,
         wsh_new_deliveries wnd,
         wsh_delivery_assignments wda,
         -- Book the Sales Order: --
         -- Create ARInvoice:
         ra_customer_trx_all rct,
         ra_customer_trx_lines_all rctl,
         ra_cust_trx_line_gl_dist_all rctld,
         -- Create AR Invoice: --
         -- Create AR Receipt
         ar_cash_receipts_all acr,
         -- Create AR Receipt --
         -- subledger accounting
         xla.xla_transaction_entities xte,
         xla_events xe,
         xla_ae_headers xah,
         xla_ae_lines xal,
         xla_distribution_links xdl,
         -- subledger accounting : --
         -- GL Journal Import:
         gl_import_references gir,
         gl_je_batches gjb,
         gl_je_headers gjh,
         gl_je_lines gjl
 -- GL Journal Import: --
 WHERE      1 = 1
         AND ooha.order_number = :SalesOrderNumber--Right click :RequitionNumber from Toad Enable Prompt For Substitution Variables
         AND ooha.org_id = 81
         AND ooha.header_id = oola.header_id
         AND hca.cust_account_id = ooha.sold_to_org_id
         AND hp.party_id = hca.party_id
         AND hpss.party_id = hca.party_id
         AND hpsb.party_id = hca.party_id
         AND bill_loc.location_id = hpss.location_id
         AND ship_loc.location_id = hpsb.location_id
         AND hcasas.cust_account_id = hca.cust_account_id
         AND hcasab.cust_account_id = hca.cust_account_id
         AND hcasas.party_site_id = hpss.party_site_id
         AND hcasab.party_site_id = hpsb.party_site_id
         AND hzsuas.cust_acct_site_id = hcasas.cust_acct_site_id
         AND hzsuab.cust_acct_site_id = hcasab.cust_acct_site_id
         AND hzsuas.site_use_id = ooha.ship_to_org_id
         AND hzsuab.site_use_id = ooha.invoice_to_org_id
         AND wda.delivery_id = wnd.delivery_id(+)
         AND wdd.delivery_detail_id = wda.delivery_detail_id
         AND wdd.source_header_id = ooha.header_id
         AND wdd.source_line_id = oola.line_id
         AND wdd.organization_id = msib.organization_id(+)
         AND wdd.inventory_item_id = msib.inventory_item_id(+)
         AND rct.interface_header_attribute1 = TO_CHAR (ooha.order_number)
         AND rct.org_id = ooha.org_id
         AND rctl.customer_trx_id = rct.customer_trx_id
         AND rctl.sales_order = TO_CHAR (ooha.order_number)
         AND rctld.customer_trx_id = rct.customer_trx_id
         AND rctld.customer_trx_line_id = rctl.customer_trx_line_id
         AND acr.receipt_number = '05037'
         AND acr.pay_from_customer = rct.sold_to_customer_id
         AND acr.org_id = ooha.org_id
         AND acr.customer_site_use_id = rct.bill_to_site_use_id
         AND xte.transaction_number = acr.receipt_number
         AND xte.entity_code = 'RECEIPTS'
         AND xe.entity_id = xte.entity_id
         AND xah.event_id = xe.event_id
         AND xal.ae_header_id = xah.ae_header_id
         AND xal.accounting_class_code = 'CASH'
         AND xdl.ae_header_id = xah.ae_header_id
         AND xdl.ae_line_num = xal.ae_line_num
         --and xdl.source_distribution_id_num_1
         AND gir.reference_5 = xte.entity_id                      -- Entity Id
         AND gir.reference_6 = TO_CHAR (xe.event_id)                --Event Id
         AND gir.reference_7 = TO_CHAR (xah.ae_header_id)      -- AE Header Id
         AND gir.gl_sl_link_id = xal.gl_sl_link_id
         -- AND gir.created_by = XXXXXX
         AND gjb.je_batch_id = gir.je_batch_id
         AND gjh.je_batch_id = gjb.je_batch_id
         AND gjh.je_header_id = gir.je_header_id
         AND gjl.je_header_id = gjh.je_header_id
         AND gjl.je_line_num = gir.je_line_num

General Ledger to Receivables Drilldown

  •        Transaction / Invoices
  •          Receipts

Let’s start with Transaction / Invoices.
Tables involved for Journal Entry to Invoice drilldown are
  •         GL_JE_HEADERS
  •         GL_IMPORT_REFERENCES
  •          XLA_AE_LINES
  •         XLA_AE_HEADERS
  •         XLA_TRANSACTION_ENTITIES
  •         RA_CUSTOMER_TRX_ALL
Now, when we are given a Journal entry with JE_SOURCE as ‘Receivables’ and JE_CATEGORY as ‘Sales Invoices’, we got to track its JE_HEADER_ID. Here is the step by step process. 
Step 1: For instance, we are going to track the invoice against the maximum JE_HEADER_ID with Receivables source and Purchase Invoices Category. Here is the query for it;
SELECT MAX(JE_HEADER_ID )
INTO V_JE_HEADER_ID
FROM GL_JE_HEADERS
WHERE JE_SOURCE = ‘Receivables’
AND JE_CATEGORY= ‘Sales Invoices’;
Step 2: Now we are going to check the corresponding GL_SL_LINK_ID against this JE_HEADER_ID. We can get these link ids through the query,
SELECT GL_SL_LINK_ID
FROM GL_IMPORT_REFERENCES
WHERE JE_HEADER_ID = V_JE_HEADER_ID;
Step 3: And to get to the relevant lines in sub-ledger modules we need to find lines against the identified GL_SL_LINK_IDs from XLA_AE_LINES table. Here is the query to get to the sub-ledger lines
SELECT DISTINCT AE_HEADER_ID
INTO V_AE_HEADER_ID
FROM XLA_AE_LINES
WHERE GL_SL_LINK_ID IN (SELECT GL_SL_LINK_ID
FROM GL_IMPORT_REFERENCES
WHERE JE_HEADER_ID = V_JE_HEADER_ID
);

Step 4: Now we will find ENTITY_ID against the identified header_id. Here is the query,
SELECT ENTITY_ID
INTO V_ENTITY_ID
FROM XLA_AE_HEADERS
WHERE AE_HEADER_ID = V_AE_HEADER_ID;
Step 5: Now, we will get the SOURCE_ID_INT_1 against identified XLA_TRANSACTION to get to the Receivables transaction.
SELECT SOURCE_ID_INT_1
INTO V_SOURCE_ID
FROM XLA_TRANSACTION_ENTITIES
WHERE ENTITY_ID = V_ENTITY_ID;
Step 6: Now is the last step, we will use this source id as invoice id to get to the invoice in Receivables.
SELECT *
FROM RA_CUSTOMER_TRX_ALL
WHERE CUSTOMER_TRX_ID = V_SOURCE_ID;
So, here is the drilldown from General Ledger to Receivables Invoices. We got to change in step 1 for JE_CATEGORY as ‘Receipts’ and the query becomes
SELECT MAX(JE_HEADER_ID )
INTO V_JE_HEADER_ID
FROM GL_JE_HEADERS
WHERE JE_SOURCE = ‘Receivables’
AND JE_CATEGORY= ‘Receipts’;
 And in step 6, we got to find check details against the identified SOURCE_ID, which makes the SQL as
SELECT *
FROM AR_CASH_RECEIPTS_ALL
WHERE CASH_RECEIPT_ID = V_SOURCE_ID;



/* Formatted on 5/12/2017 3:56:59 PM (QP5 v5.114.809.3010) */
  SELECT   DISTINCT GJH.JE_HEADER_ID,
                    GJH.PERIOD_NAME,
                    XE.EVENT_ID,
                    GJH.NAME HEADER_NAME,
                    GJH.DESCRIPTION JE_HEADER_DESCRIPTION,
                    GJH.ACTUAL_FLAG,
                    GJL.DESCRIPTION JE_LINE_DESCRIPTION,
                    RCT.TRX_DATE,
                    xal.ENTERED_CR ENT_CR,
                    XAL.ENTERED_DR ENT_DR,
                    XAL.ACCOUNTED_CR ACC_CR,
                    XAL.ACCOUNTED_DR ACC_DR,
                    GJL.JE_LINE_NUM,
                    GJH.JE_CATEGORY,
                    GJH.JE_SOURCE,
                    PARTY.PARTY_NAME PARTY,
                    RCT.TRX_NUMBER TRX_NUM,
                    MTL.SEGMENT1 ITEM,
                    CTL.DESCRIPTION INV_LINE_DESC
    FROM   GL.GL_JE_HEADERS GJH,
           GL.GL_JE_LINES GJL,
           GL.GL_CODE_COMBINATIONS GCC,
           GL.GL_PERIODS GLP,
           GL.GL_IMPORT_REFERENCES IMP,
           XLA.XLA_AE_LINES XAL,
           XLA.XLA_AE_HEADERS XAH,
           XLA.XLA_EVENTS XE,
           XLA.XLA_TRANSACTION_ENTITIES XTE,
           RA_CUSTOMER_TRX_ALL RCT,
           HZ_PARTIES PARTY,
           AR.HZ_CUST_ACCOUNTS CA,
           GL_CODE_COMBINATIONS_KFV CC,
           AR.RA_CUSTOMER_TRX_LINES_ALL CTL,
           AR.RA_CUST_TRX_LINE_GL_DIST_ALL CTLD,
           xla.xla_distribution_links xdl,
           apps.mtl_system_items_b mtl
   WHERE       1 = 1
           AND GJH.JE_HEADER_ID = GJL.JE_HEADER_ID
           --AND GJL.STATUS || '' = 'P'
           AND GCC.CODE_COMBINATION_ID = CTLD.CODE_COMBINATION_ID
           AND GJH.PERIOD_NAME = GLP.PERIOD_NAME
           AND GJH.PERIOD_NAME = 'JUL-15'
           AND RCT.CUSTOMER_TRX_ID = CTLD.CUSTOMER_TRX_ID
           AND CTLD.CUSTOMER_TRX_LINE_ID = CTL.CUSTOMER_TRX_LINE_ID
           AND GJH.JE_SOURCE = 'Receivables'
           AND GJL.JE_HEADER_ID = IMP.JE_HEADER_ID
           AND GJL.JE_LINE_NUM = IMP.JE_LINE_NUM
           AND IMP.GL_SL_LINK_ID = XAL.GL_SL_LINK_ID
           AND IMP.GL_SL_LINK_TABLE = XAL.GL_SL_LINK_TABLE
           AND XAL.APPLICATION_ID = XAH.APPLICATION_ID
           AND XAL.AE_HEADER_ID = XAH.AE_HEADER_ID
           AND XAH.APPLICATION_ID = XE.APPLICATION_ID
           AND XAH.EVENT_ID = XE.EVENT_ID
           AND XE.APPLICATION_ID = XTE.APPLICATION_ID
           AND XTE.APPLICATION_ID = 222
           AND XE.ENTITY_ID = XTE.ENTITY_ID
           AND XTE.ENTITY_CODE = 'TRANSACTIONS'
           AND XTE.SOURCE_ID_INT_1 = RCT.CUSTOMER_TRX_ID
           AND RCT.BILL_TO_CUSTOMER_ID = CA.CUST_ACCOUNT_ID
           AND CA.PARTY_ID = PARTY.PARTY_ID
           AND rcT.CUSTOMER_TRX_ID = ctl.CUSTOMER_TRX_Id
           AND xal.ae_header_id = xdl.ae_header_id
           AND xal.ae_line_num = xdl.ae_line_num
           AND xdl.source_distribution_id_num_1 = ctld.cust_trx_line_gl_dist_id
           AND CTL.LINE_TYPE = 'LINE'
           AND XAL.CODE_COMBINATION_ID = CC.CODE_COMBINATION_ID
           AND ctl.INVENTORY_ITEM_ID = MTL.INVENTORY_ITEM_ID
           AND CC.CODE_COMBINATION_ID = '7546'                          ---- c
ORDER BY   RCT.TRX_DATE;


With the Release 12 of Oracle Applications, Subledger Accounting (SLA) has been introduced. This is a Rule-based accounting engine, toolset & repository supporting Oracle E-Business Suite modules (also called as subledgers). The main idea behind this introduction is to have an option of allowing multiple accounting representations for a single business event, resolving conflicts between corporate and local fiscal accounting requirements. Also this introduces a common data model and user interface (UI) across subledgers, replaces various disparate 11i setups, providing single source of truth for financial and management analysis. Due to SLA, there are some changes in the functionalities of General Ledger. There are also certain setups that need to be done in General Ledger for SLA.
For understanding the Impact of SLA on General Ledger, we have divided this document into three parts:
  1. Drill Down – This will deal with the change in the Drilldown data, which appears now. Also the setups, which decide what data, can be viewed and how data can be secured.
  2. Journal Import – This will deal with the transfer of data from Subledgers to General Ledger. This will also explain the various setups that are done for the Ledger which govern the import for various applications.
  3. Technical Reference – This will give the technical references, for journal import and drill down functionalities, which will help in understanding the architecture and will also help in troubleshooting.

Part I : Impact of SLA on Drilldown in General Ledger

Drilldown functionality enables users to navigate from a Journal in General Ledger to the Subledger Journal Entry in SLA and from there to the transaction which has resulted into that journal. 

To enable Journal drilldown from General Ledger, the "Import Journal References" option should be enabled for the Source. 
This can be checked under General Ledger Responsibility at Setup -> Journal -> Sources -> Define. 
Only when this is enabled, the reference data is populated by SLA engine. 

The Drilldown in Release 12 is different from the prior releases of the Application. R12 drilldown is Web based and not in the Forms. The following screenshots show the Drilldown functionality in Release 12: 

Navigation to perform Drilldown is the same as in Release 11i:
  • Journals -> Enter -> Review Journal
  • Select the journal line and click on “Lines Drilldown”.

Drilldown can also be performed from:
  • Tools -> Drilldown

  

As mentioned above, Drilldown opens the Web Page instead of Form. 



The SLA Page for Drilldown shows the following:
  • GL Journal Line information
  • Subledger Journal Line information

There are two Options available on this SLA page:
  • View Transaction
  • View Journal Entry

View Transaction’ will take us to the Subledger Transaction form. E.g for the current journal line, since the Source was Payables, it opens Invoice Workbench.

‘View Journal Entry’ will take to the Subledger Journal Entry details

View Journal Entry has three parts to it.
  1. Transaction Information
  2. Additional Information (this is hidden by default)
  3. Line Details
Apart from this there are some extra details shown at the top of the page, which is the header level information for the Subledger Transaction.

Some of the important fields in header part of the Subledger Transaction Journal are:
  • Ledger Name
  • Journal Entry Status
  • Balance Type
  • GL Date

This is the 'Transaction Information' section of Subledger Journal Entry page.
The fields here will change based on the transaction and the subledger in which the transaction was entered.
Since the example transaction is entered in Payables, it is showing the details of the invoice and the supplier.
  

This is the 'Additional Information' section of Subledger Transaction Entry page.
This section shows the details of
  • Event
  • General Ledger
  • Sequences
  • Application Accounting Definition
Note that Event and Application Accounting Definition are important from SLA side. However, from GL perspective the relevant details are Period, Transfer to GL Date and Transfer to GL status.

This is the last section, 'Lines' of the Subledger Journal Entry page. 
The important details in this section are:
  • Code Combination
  • Currency
  • Entered Debits and Credits
  • Accounted Debits and Credits
Select the link 'Show' for any of the lines to view additional details for the transaction line




This page gives various details for transaction line from the subledgers side.

Thus the Drilldown from General Ledger, takes us to the Subledger Journal Entry which shows the details of the Subledger journal. From here we can further drilldown to the Subledger Transaction.

Profile Options related to Drilldown:
  • SLA: Enable Subledger Transaction Security in GL
    This profile option controls whether the drilldown to SLA will enforce the transaction security of the application owning the Transaction. For example, if one drills down to Payables, he will only be able to see Journals for transactions belonging to operating units to which he has access (based on your MO: Security Profile.) Thus drilldown can be restricted to the Operating Units to which the responsibility has access. In case the GL responsibility does not have access to a particular Operating Unit, the Drilldown will not show any data.