Thursday, March 12, 2026

Query to find AP Pay Group

Below is the SQL query to find the Pay Groups in Oracle Accounts Payables (AP). 

Navigation:

Payables Manager -> Setup -> Lookups -> Purchasing -> Search for 'PAY GROUP' in Type field


SELECT lc.lookup_type               "Lookup Type",
       lc.lookup_code               "Lookup Code",
       lc.displayed_field           "Displayed Field",
       lc.description               "Description",
       TRUNC (lc.creation_date)     "Creation Date",
       usr_cr.user_name             "Created By",
       TRUNC (lc.last_update_date)  "Last Update Date",
       usr_up.user_name             "Last Updated By"
  FROM PO_LOOKUP_CODES  lc,
       FND_USER         usr_cr,
       FND_USER         usr_up
 WHERE lc.created_by = usr_cr.user_id
   AND lc.last_updated_by = usr_up.user_id
   AND lc.lookup_type = 'PAY GROUP'
   AND lc.enabled_flag = 'Y'
   AND SYSDATE <= NVL (lc.inactive_date, SYSDATE)
 ORDER BY lc.lookup_type, lc.lookup_code;


Thursday, June 19, 2025

Oracle FNDLOAD and Examples

Reference

Most of its contents were taken from 'Dibyajyoti Koch: A Blog on Oracle Application' website but were modified for my own personal use. Please visit https://imdjkoch.wordpress.com/tag/fndload for its original contents along with many other useful ones.

What is FNDLOAD?

  • FNDLOAD is a developer tool provided by Oracle that migrates setup/configuration data from one instance to another
  • This program is located in $FND_TOP/bin directory
  • It is a human-readable file that is executed as a UNIX command line
  • The program downloads a .ldt file from the Source instance. The program, then, uploads the .ldt file in the Target instance

What objects can be migrated by FNDLOAD?

  1. Concurrent Programs
  2. Request Groups
  3. Request Sets
  4. Responsibilities
  5. Forms
  6. Forms Personalizations
  7. Key Flexfields (KFF)
  8. Descriptive Flexfields (DFF)
  9. Functions
  10. Menus
  11. Lookups
  12. Value Sets
  13. Profile Options
  14. FND Users
  15. Printer Styles

Examples

1. Concurrent Programs

  • Download
FNDLOAD apps/$pswd 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CONC_PROG.ldt PROGRAM APPLICATION_SHORT_NAME="SQLAP" CONCURRENT_PROGRAM_NAME="XX_CONC_PROG_SHORT_NAME"
  • Upload
FNDLOAD apps/$pswd 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CONC_PROG.ldt
  • Upload Partial
FNDLOAD apps/$pswd 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afcpprog.lct XX_CONC_PROG.ldt PROGRAM CONCURRENT_PROGRAM_NAME="XX_CONC_PROG_SHORT_NAME" APPLICATION_SHORT_NAME="SQLAP"

2. Request Groups

  • Download
FNDLOAD apps/$pswd 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct XX_CONC_PROG_REQ_GRP.ldt REQUEST_GROUP REQUEST_GROUP_NAME='Payables Admin Reports' APPLICATION_SHORT_NAME='SQLAP' REQUEST_GROUP_UNIT UNIT_APP='SQLAP' UNIT_TYPE='P' UNIT_NAME='XX_CONC_PROG_SHORT_NAME'
  • Upload
FNDLOAD apps/$pswd 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afcpreqg.lct XX_CONC_PROG_REQ_GRP.ldt REQUEST_GROUP REQUEST_GROUP_NAME='Payables Admin Reports' APPLICATION_SHORT_NAME='SQLAP'

3. Request Sets

  • Download
FNDLOAD apps/$pswd

4. Alert
  • Download
FNDLOAD apps/$pswd 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct XX_ALERT_ALR.ldt ALR_ALERTS APPLICATION_SHORT_NAME=SQLAP ALERT_NAME="XX_ALERT_ALR"

  • Upload
FNDLOAD apps/$pswd 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct XX_ALERT_ALR.ldt CUSTOM_MODE=FORCE


Monday, July 08, 2024

Query to find State and State Code in Oracle Applications

 Query to find State and State Code

SELECT hg.geography_code     state_code,
       hgi.identifier_value  state_name
  FROM (SELECT gi.geography_id,
               gi.identifier_value,
               ROW_NUMBER() OVER (
                  PARTITION BY gi.geography_id 
                  ORDER BY gi.last_update_date DESC) rn
          FROM HZ_GEOGRAPHY_IDENTIFIERS  gi
         WHERE gi.identifier_type = 'NAME'
           AND gi.identifier_subtype = 'STANDARD_NAME'
           AND gi.geography_type = 'STATE'
           AND gi.language_code = 'US'
           AND gi.primary_flag = 'N') hgi
  JOIN HZ_GEOGRAPHIES  hg
    ON hg.geography_id = hgi.geography_id
 WHERE hg.geography_type = 'STATE'
   AND hgi.rn = 1
 ORDER BY hgi.identifier_value;




Wednesday, May 17, 2023

How to enable Help Diagnostics Examine Menu in Oracle Application

Reference:

Oracle Doc ID: 1300872.1
Help Diagnostics Examine is Missing from the Help Menu


If your Oracle Applications does not show the Help > Diagnostics > Examine menu in Oracle Applications (as pictured below), please contact your System Administrator or if you have 'System Administrator' responsibility, then follow the instructions below.


Navigation:

System Administrator > Profile > System


Profile 1: 

Query for Profile, Utilities:DiagnosticsClick Find.


Set user level profile to 'Yes'. Save.



Profile 2:

Query for Profile, Hide Diagnostics menu entryClick Find.


Set user level profile to 'No'. Save.



Log out of the Applications.

Log back in and verify that Help > Diagnostics is now available.


Thursday, November 17, 2022

Query to find Check Number Setups

SELECT pd.payment_document_name               "Payment Document Name",
       pd.first_available_document_num        "Check Number Begin",
       pd.last_available_document_number      "Check Number End",
       (pd.last_available_document_number -
        pd.first_available_document_num) + 1  "Num of Total Checks",
       pd.last_issued_document_number         "Last Issued Check Number",
       (pd.last_issued_document_number -
        pd.first_available_document_num) + 1  "Num Of Checks Used",
       (pd.last_available_document_number -
        pd.last_issued_document_number)       "Num Of Checks Remaining",
       pd.format_code                         "Format Code",
       ba.bank_account_name                   "Bank Account Name"
  FROM CE_PAYMENT_DOCUMENTS  pd,
       CE_BANK_ACCOUNTS      ba
 WHERE TRUNC (NVL (pd.inactive_date, SYSDATE)) >= TRUNC (SYSDATE-- active ones
   AND pd.internal_bank_account_id = ba.bank_account_id
 ORDER BY pd.payment_document_name;




Add System Admin responsibility to a user

BEGIN
   FND_USER_PKG.ADDRESP(
      USERNAME        =>  UPPER('AMOHSIN'),  -- username
      RESP_APP        =>  'SYSADMIN',
      RESP_KEY        =>  'SYSTEM_ADMINISTRATOR',
      SECURITY_GROUP  =>  'STANDARD',
      DESCRIPTION     =>  'DESCRIPTION',
      START_DATE      =>  SYSDATE,
      END_DATE        =>  NULL);

   
COMMIT
;

   DBMS_OUTPUT.PUT_LINE
('Responsibility Added Successfully');

EXCEPTION
   WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Responsibility is not added due to' ||
      SQLCODE || SUBSTR(SQLERRM, 1, 100));
      
      ROLLBACK;
END;

Query to find Supplier, Site, Bank, Payment Method in Oracle AP R12

SELECT -----------------------------------------------------------------

       -- Supplier

       -----------------------------------------------------------------

       s.PARTY_ID,

       s.segment1                       supp_number,

       s.vendor_name                    supp_name,

       TRUNC (s.creation_date)          supp_creation_date,

       s_cr.user_name                   supp_created_by,

       TRUNC (s.last_update_date)       supp_update_date,

       s_upd.user_name                  supp_updated_by,

       (SELECT plc.displayed_field

          FROM PO_LOOKUP_CODES plc

         WHERE plc.lookup_type = 'VENDOR TYPE'

           AND plc.lookup_code = s.vendor_type_lookup_code)  supp_type,

       s.pay_group_lookup_code          supp_pay_group,

       s.organization_type_lookup_code  supp_org_type,

       s.standard_industry_class        supp_sic,

       s.tca_sync_num_1099              supp_tax_id,

       -----------------------------------------------------------------

       -- Business Classification

       -----------------------------------------------------------------

       (SELECT LISTAGG (lv.meaning, ', ') WITHIN GROUP (ORDER BY lv.meaning)

          FROM POS_BUS_CLASS_ATTR  bc,

               FND_LOOKUP_VALUES   lv

         WHERE bc.lookup_code = lv.lookup_code (+)

           AND bc.class_status = 'APPROVED'

           AND lv.lookup_type = 'POS_BUSINESS_CLASSIFICATIONS'

           AND lv.enabled_flag = 'Y'

           AND TRUNC (SYSDATE) BETWEEN TRUNC (lv.start_date_active) AND TRUNC (NVL (lv.end_date_active, SYSDATE+1))

           AND TRUNC (SYSDATE) BETWEEN TRUNC (bc.start_date_active) AND TRUNC (NVL (bc.end_date_active, SYSDATE+1))

           AND bc.party_id (+) = s.party_id

       )  bus_class,

       -----------------------------------------------------------------

       -- Supplier Site

       -----------------------------------------------------------------

       st.vendor_site_code              site_code,

       TRUNC (st.creation_date)         site_creation_date,

       st_cr.user_name                  site_created_by,

       TRUNC (st.last_update_date)      site_update_date,

       st_upd.user_name                 site_updated_by,

       st.pay_group_lookup_code         site_pay_group,

       st.pay_site_flag                 pay_site_flag,

       st.purchasing_site_flag          purchasing_site_flag,

       (SELECT territory_short_name

          FROM FND_TERRITORIES_VL v

         WHERE territory_code = st.country)  site_country,

       st.state                         site_state,

       -----------------------------------------------------------------

       -- Supplier Site Payment Method

       -----------------------------------------------------------------

       pm.payment_method_code           payment_method,

       pm.remit_advice_delivery_method  delivery_method,

       pm.remit_advice_email            remittance_email,

       -----------------------------------------------------------------

       -- Supplier Site Bank Account, Bank and Bank Branches

       -----------------------------------------------------------------

       ba.bank_account_num              bank_account_num,

       ba.start_date                    bank_account_start_date,

       ba.branch_name                   branch_name,

       ba.branch_number                 branch_number,

       ba.bank_name                     bank_name,

       ba.bank_number                   bank_number,

       -----------------------------------------------------------------

       -- Bank Account Owner Name

       -----------------------------------------------------------------

       (SELECT hp.party_name

          FROM HZ_PARTIES          hp,

               IBY_ACCOUNT_OWNERS  iao

         WHERE iao.account_owner_party_id = hp.party_id

           AND iao.ext_bank_account_id = ba.ext_bank_account_id

           AND iao.primary_flag = 'Y')  account_owner_name

  FROM AP_SUPPLIERS            s,

       AP_SUPPLIER_SITES_ALL   st,

       --------------------------------------------

       -- bank acocunt query

       --------------------------------------------

       (SELECT iep.supplier_site_id,

               ipi.start_date,

               ipi.end_date,

               iao.ext_bank_account_id,

               -- iep.ext_payee_id,

               ieb.bank_account_num,

               cbbv.bank_branch_name    branch_name,

               cbbv.branch_number,

               cbbv.bank_name,

               cbbv.bank_number

          FROM IBY_EXTERNAL_PAYEES_ALL  iep,

               IBY_PMT_INSTR_USES_ALL   ipi,

               IBY_ACCOUNT_OWNERS       iao,

               IBY_EXT_BANK_ACCOUNTS    ieb,

               CE_BANK_BRANCHES_V       cbbv

         WHERE iao.ext_bank_account_id = ieb.ext_bank_account_id(+)

           AND iao.ext_bank_account_id(+) = ipi.instrument_id

           AND iep.ext_payee_id = ipi.ext_pmt_party_id(+)

           AND iep.payee_party_id = iao.account_owner_party_id

           AND cbbv.branch_party_id(+) = ieb.branch_id

           AND ipi.instrument_type = 'BANKACCOUNT'

           AND TRUNC (SYSDATE) < TRUNC (NVL (ipi.end_date, SYSDATE + 1))

           AND iep.payment_function = 'PAYABLES_DISB')  ba,

       --------------------------------------------

       -- payment method, remittance email query

       --------------------------------------------

       (SELECT ppm.payment_method_code,

               iep.remit_advice_delivery_method,

               iep.remit_advice_email,

               iep.supplier_site_id,

               iep.inactive_Date,

               ppm.inactive_date inactive_date2,

               MAX (ppm.object_version_number)

          FROM IBY_EXTERNAL_PAYEES_ALL  iep,

               IBY_EXT_PARTY_PMT_MTHDS  ppm

         WHERE iep.ext_payee_id = ppm.ext_pmt_party_id

           AND ppm.primary_flag = 'Y'

           AND NVL (ppm.inactive_date, SYSDATE+1) >= SYSDATE

           AND NVL (iep.inactive_date, SYSDATE+1) >= SYSDATE

         GROUP BY ppm.payment_method_code,

               iep.remit_advice_delivery_method,

               iep.remit_advice_email,

               iep.supplier_site_id,

               iep.inactive_Date,

               ppm.inactive_date

       ) pm,

       --

       FND_USER  s_cr,   -- supplier create

       FND_USER  s_upd,  -- supplier update

       FND_USER  st_cr,  -- site create

       FND_USER  st_upd  -- site update

 WHERE s.enabled_flag = 'Y'

   AND UPPER (NVL (s.vendor_type_lookup_code, 'X')) NOT IN ('EMPLOYEE') -- No Employee supplier type

   AND TRUNC (SYSDATE) < TRUNC (NVL (st.inactive_date, SYSDATE + 1))  -- Active Supplier Site

   AND TRUNC (SYSDATE) < TRUNC (NVL (s.end_date_active, SYSDATE + 1)) -- Active Supplier

   --

   AND st.last_updated_by = st_upd.user_id(+)

   AND st.created_by = st_cr.user_id(+)

   AND s.last_updated_by = s_upd.user_id

   AND s.created_by = s_cr.user_id

   AND st.vendor_site_id = pm.supplier_site_id(+)

   AND st.vendor_site_id = ba.supplier_site_id(+)

   AND s.vendor_id = st.vendor_id(+)