AP : QUERY: Supplier Sites - Payment Details

Here is query to Fetch QUERY: Supplier Sites - Payment Details.

select
    s.segment1                              "Supplier Number",
    ass.vendor_site_code                    "Site Name",
    haou.name                               "Operating Unit",
    iv.payment_method_code                  "Payment Method Code",
    iv.payment_method_name                  "Payment Method",
    iv.inactive_date                        "End Date",
    iep.delivery_channel_code               "Delivery: Channel",
    ibi1.meaning                            "Delivery: Bank Instr 1",
    ibi2.meaning                            "Delivery: Bank Instr 2",
    iep.bank_instruction_details            "Delivery: Bank Instr Det",
    iep.settlement_priority                 "Delivery: Settlement Priority",
    iep.payment_text_message1               "Delivery: Pay Text 1",
    iep.payment_text_message2               "Delivery: Pay Text 2",
    iep.payment_text_message3               "Delivery: Pay Text 3",
    iep.exclusive_payment_flag              "Spec: Pay Each Document Alone",
    iep.bank_charge_bearer                  "Spec: Bank Charge Bearer",
    ipr.meaning                             "Spec: Payment Reason",
    iep.payment_reason_comments             "Spec: Payment Reason Comments",
    ifo.format_name                         "Spec: Payee-specified Format",  
    iep.remit_advice_delivery_method        "Rem Advice: Delivery Method",
    iep.remit_advice_email                  "Rem Advice: E-Mail",
    iep.remit_advice_fax                    "Rem Advice: Fax",
    s.vendor_id,
    s.party_id,
    iep.ext_payee_id,
    iep.bank_instruction1_code, iep.bank_instruction2_code,
    iep.payment_reason_code,
    iep.payment_format_code
from 
    ap_suppliers s,
    ap_supplier_sites ass,
    hr_all_organization_units haou,
    (select ieppm.ext_pmt_party_id, ieppm.payment_method_code, ieppm.inactive_date, ipm.payment_method_name
     from   iby_ext_party_pmt_mthds ieppm, iby_payment_methods_vl ipm
     where  ieppm.primary_flag = 'Y'
     and    ieppm.payment_flow = 'DISBURSEMENTS'
     and    ipm.payment_method_code = ieppm.payment_method_code) iv,
    iby_external_payees_all iep,
    iby_bank_instructions_vl ibi1,
    iby_bank_instructions_vl ibi2,
    iby_payment_reasons_vl ipr,
    iby_formats_vl ifo
where
    1=1
and ass.vendor_id = s.vendor_id
and haou.organization_id = ass.org_id
and iep.payee_party_id = s.party_id
and iep.supplier_site_id = ass.vendor_site_id
and iv.ext_pmt_party_id (+) = iep.ext_payee_id
and ibi1.bank_instruction_code (+) = iep.bank_instruction1_code
and ibi2.bank_instruction_code (+) = iep.bank_instruction2_code
and ipr.payment_reason_code(+) = iep.payment_reason_code
and ifo.format_code(+) = iep.payment_format_code
and s.segment1 = '11208'
order by 1,2,3,4
Filed under   | 

Query: Supplier Sites - Invoice Management


select

    s.segment1                              "Supplier Number",
    hps.party_site_name                     "Address Name",
    haou.name                               "Operating Unit",
    ass.vendor_site_code                    "Supplier Site",
    ass.invoice_amount_limit                "Invoicing: Amount Limit",
    null                                    "Invoicing: Tolerance",
    decode(ass.match_option,
            'R','Receipt',
            'P','Purchase Order',
            null)                           "Inv: Match Option",
    ass.invoice_currency_code               "Inv: Currency",
    ass.hold_all_payments_flag              "Inv: Hold - All Invoices",
    ass.hold_unmatched_invoices_flag        "Inv: Hold - Unmatched Inv",
    ass.hold_future_payments_flag           "Inv: Hold - Unvalidated Inv",
    ass.hold_reason                         "Inv: Payment Hold Reason",
    ato.tolerance_name                      "Inv: Service Tolerance",
    ass.payment_currency_code               "Payment: Currency",
    ass.payment_priority                    "Payment: Priority",
    ass.pay_group_lookup_code               "Payment: Pay Group",
    flv.meaning                             "Payment: Deduct Bank Charge",
    at.name                                 "Terms: Terms",
    ass.terms_date_basis                    "Terms: Terms Date Basis",
    ass.pay_date_basis_lookup_code          "Terms: Pay Date Basis",
    ass.retainage_rate                      "Terms: Retainage Rate",
    ass.always_take_disc_flag               "Terms: Take Discount",
    ass.exclude_freight_from_discount       "Terms: Ex Freight Discount",
    s.vendor_id,
    ass.vendor_site_id
from 
    ap_suppliers s,
    ap_supplier_sites ass,
    hz_party_sites hps,
    hr_all_organization_units haou,
    ap_tolerances ato,
    ap_terms at,
    fnd_lookup_values_vl flv
where
    1=1
and ass.vendor_id = s.vendor_id
and hps.party_id = s.party_id
and hps.party_site_id = ass.party_site_id
and haou.organization_id = ass.org_id
and ato.tolerance_id (+) = ass.services_tolerance_id
and at.term_id (+) = ass.terms_id
and flv.lookup_type (+) = 'BANK CHARGE BEARER'
and flv.lookup_code (+) = ass.bank_charge_bearer
and s.segment1 = '112345'
order by    1,2,3,4
Filed under   | 

FA : Query to fetch Asset Books - Cost History

Here is query to get the Cost History fotr particular asset
select
    fb.book_type_code               "Book",
    fa.asset_number                 "Asset Number",
    fb.transaction_header_id_in     "Reference Number",
    fth.transaction_type_code       "Transaction Type",
    fth.transaction_date_entered    "Transaction Date",
    fth.date_effective              "Date Effective",
    fb.cost                         "Cost",
   fa.asset_id
from
    fa_additions_b fa,
    fa_books fb,
    fa_transaction_headers fth
where
    1=1
and fb.asset_id = fa.asset_id
and fth.transaction_header_id (+) = fb.transaction_header_id_in
and fth.asset_id (+) = fb.asset_id
and fa.asset_number ='asset number'
order by
    1,2, fb.transaction_header_id_in desc
Filed under   | 

AP : Reconciling A/P Accrual Accounts Balance


At any given time, the balance of the A/P accrual accounts can account for the following transactions:

  •         Uninvoiced Receipts
  •         Over-invoiced Receipts
  •         Invoice Price Variance (for transactions created using Release 9)
  •         Errors (Invoices or inventory transactions charged to this Account by mistake)

You need to analyze the balance of the A/P accrual accounts, distinguish accrued receipts from invoice price variances, and identify errors.


AR : Receipt to fetch Total Uncleared Receipt Amount

SELECT   NVL (SUM (ps.amount_due_remaining), 0) total_uncleared_receipts
  FROM   hz_cust_accounts_all cust_acct,
         ar_payment_schedules_all ps,
         ar_receivable_applications_all arr,
         hz_cust_acct_sites_all acct_site,
         hz_party_sites party_site,
         hz_locations loc,
         hz_cust_site_uses_all site_uses,
         ar_cash_receipt_history_all crh,
         ar_cash_receipts_all acr,
         gl_code_combinations cc
 WHERE       TRUNC (ps.gl_date) <= :p_as_of_date
         AND ps.customer_id = cust_acct.cust_account_id
         AND cust_acct.account_number = :p_account_number
         AND ps.customer_id = cust_acct.cust_account_id
         AND acct_site.party_site_id = party_site.party_site_id
         AND loc.location_id = party_site.location_id
         AND ps.cash_receipt_id = acr.cash_receipt_id
         AND acr.cash_receipt_id = crh.cash_receipt_id
         AND crh.account_code_combination_id = cc.code_combination_id
         AND ps.trx_date <= :p_as_of_date
         AND ps.CLASS = 'PMT'
         AND ps.cash_receipt_id = arr.cash_receipt_id
         AND arr.status = 'UNAPP'
         AND ps.status = 'OP'
         AND site_uses.site_use_code = 'BILL_TO'
         AND site_uses.cust_acct_site_id = acct_site.cust_acct_site_id
         AND NVL (site_uses.status, 'A') = 'A'
         AND cust_acct.cust_account_id = acct_site.cust_account_id
         AND acct_site.cust_acct_site_id = site_uses.cust_acct_site_id
         AND ps.customer_id = acct_site.cust_account_id
         AND ps.customer_site_use_id = site_uses.site_use_id
         AND ps.cash_receipt_id = crh.cash_receipt_id
         AND crh.status NOT IN ('CLEARED')
HAVING   NVL (SUM (arr.amount_applied), 0) > 0;
Filed under   | 

AR : Receipt to fetch Total Un-applied Receipt Amount

SELECT   NVL (SUM (arr.amount_applied), 0) total_unapp_receipts
  FROM   hz_cust_accounts_all cust_acct,
         ar_payment_schedules_all ps,
         ar_receivable_applications_all arr,
         hz_cust_acct_sites_all acct_site,
         hz_party_sites party_site,
         hz_locations loc,
         hz_cust_site_uses_all site_uses,
         ar_cash_receipts_all acr,
         ar_cash_receipt_history_all crh,
         gl_code_combinations cc
 WHERE       TRUNC (ps.gl_date) <= :p_as_of_date
         AND ps.customer_id = cust_acct.cust_account_id
         AND cust_acct.account_number = :p_account_number
         AND ps.customer_id = cust_acct.cust_account_id
         AND acct_site.party_site_id = party_site.party_site_id
         AND loc.location_id = party_site.location_id
         AND ps.cash_receipt_id = acr.cash_receipt_id
         AND acr.cash_receipt_id = crh.cash_receipt_id
         AND crh.account_code_combination_id = cc.code_combination_id
         AND ps.trx_date <= :p_as_of_date
         AND ps.CLASS = 'PMT'
         AND ps.cash_receipt_id = arr.cash_receipt_id
         AND arr.status = 'UNAPP'
         AND ps.status = 'OP'
         AND site_uses.site_use_code = 'BILL_TO'
         AND site_uses.cust_acct_site_id = acct_site.cust_acct_site_id
         AND NVL (site_uses.status, 'A') = 'A'
         AND cust_acct.cust_account_id = acct_site.cust_account_id
         AND acct_site.cust_acct_site_id = site_uses.cust_acct_site_id
         AND ps.customer_id = acct_site.cust_account_id
         AND ps.customer_site_use_id = site_uses.site_use_id
HAVING   NVL (SUM (arr.amount_applied), 0) > 0;
Filed under   | 

AP:Query fetching both Prepayment Data and Invoice Data of a Payable Invoice

This Query will find a query which fetches both invoice and prepayment information of a payable invoice ( Invoice_id = 166014 ). All the queries given in this post and their related posts were tested in R12.1.1 Instance.

SELECT pv.vendor_name "Vendor Name",
       ai.invoice_num "Invoice Num",
       ai.invoice_id "Invoice Id",
       ai.invoice_amount "Invoice amount",
       ail.line_number "Invoice Line Num",
       ai2.invoice_id "Prepay Invoice Id",
       ai2.invoice_num "Prepay Invoice Num",
       ail.prepay_line_number "Prepay Invoice Line Num",
       (-1)*(ail.amount - NVL(ail.included_tax_amount,0))
       "Prepay Amount Applied",
       NULLIF((-1)*(NVL(ail.total_rec_tax_amount, 0) +      
       NVL(ail.total_nrec_tax_amount, 0)), 0)
       "Tax amount Applied"
FROM   AP_INVOICES_ALL ai,
       AP_INVOICES_ALL ai2,
       AP_INVOICE_LINES_ALL ail,
       AP_SUPPLIERS pv
WHERE ai.invoice_id                  = ail.invoice_id
AND   ai2.invoice_id                   = ail.prepay_invoice_id
AND   ail.amount                       < 0
AND   NVL(ail.discarded_flag,'N')     <> 'Y'
AND   ail.line_type_lookup_code        = 'PREPAY'
AND   ai.vendor_id                     = pv.vendor_id
AND   ai.invoice_type_lookup_code NOT IN ('PREPAYMENT', 'CREDIT','DEBIT')
AND   ai.invoice_id                    = '166014';

AR :Query for statement with Bill-To & Ship-To address for AR Open Transactions

SELECT sob.name sob_name,
         hou.name ou_name,
         t.trx_number,
         hp.party_name,
         acct.account_number,
         rctt.name Transaction_type,
         t.bill_to_site_use_id,
            hl.address1
         || ','
         || hl.address2
         || ','
         || hl.city
         || ','
         || hl.county
         || ','
         || NVL (hl.state, hl.province)
            bill_to_address,
            hl1.address1
         || ','
         || hl1.address2
         || ','
         || hl1.city
         || ','
         || hl1.county
         || ','
         || NVL (hl1.state, hl.province)
            ship_to_address,
            hl1.address1
         || ','
         || hl1.address2
         || ','
         || hl1.city
         || ','
         || hl1.county
         || ','
         || NVL (hl1.state, hl.province)
            paying_cust_address,
         l.customer_trx_line_id,
         t.customer_trx_id,
         l.line_number,
         l.line_type,
         l.reason_code,
         l.quantity_invoiced,
         l.inventory_item_id,
         l.description,
         l.uom_code,
         l.unit_selling_price,
         (d.amount) extended_amount,
         p.amount_due_remaining balance_due,
         gcc.segment1,
         gcc.segment2,
         gcc.segment3,
         gcc.segment4,
         gcc.segment5,
         gcc.segment6,
         gcc.segment7,
         gcc.segment8,
         d.account_class,
         d.gl_date,
         d.acctd_amount,
         sp.salesrep_number,
         s.revenue_percent_split,
         l.link_to_cust_trx_line_id
FROM ra_customer_trx_all t,
         ar_payment_schedules_all p,
         gl_sets_of_books sob,
         hr_operating_units hou,
         ra_customer_trx_lines_all l,
         ra_cust_trx_line_gl_dist_all d,
         gl_code_combinations gcc,
         ra_cust_trx_line_salesreps_all s,
         jtf_rs_salesreps sp,
         ra_cust_trx_types_all rctt,
         ra_terms rt,
         hz_parties hp,
         hz_cust_site_uses_all hcsu,
         hz_cust_acct_sites_all hcas,
         hz_cust_accounts acct,
         hz_party_sites hps,
         hz_locations hl,
         hz_cust_site_uses_all hcsu1,
         hz_cust_acct_sites_all hcas1,
         hz_party_sites hps1,
         hz_locations hl1,
         hz_cust_accounts acct_pay,
         hz_cust_site_uses_all hcsu2,
         hz_cust_acct_sites_all hcas2,
         hz_party_sites hps2,
         hz_locations hl2
   WHERE     t.customer_trx_id = p.customer_trx_id
         AND p.status = 'OP'
         AND rctt.org_id = t.org_id
         AND t.set_of_books_id = sob.set_of_books_id
         AND t.org_id = hou.organization_id
         AND t.customer_trx_id = l.customer_trx_id
         AND t.cust_trx_type_id = rctt.cust_trx_type_id
         AND d.customer_trx_id = l.customer_trx_id
         AND d.customer_trx_line_id = l.customer_trx_line_id
         AND d.code_combination_id = gcc.code_combination_id
         AND gcc.chart_of_accounts_id = sob.chart_of_accounts_id
         AND s.customer_trx_id(+) = t.customer_trx_id
         AND s.salesrep_id = sp.salesrep_id(+)
         AND s.org_id = sp.org_id(+)
         AND t.term_id = rt.term_id(+)
         AND acct.party_id = hp.party_id
         AND t.bill_to_customer_id = acct.cust_account_id
         AND t.bill_to_site_use_id = hcsu.site_use_id
         AND hcas.cust_acct_site_id = hcsu.cust_acct_site_id
         AND acct.cust_account_id = hcas.cust_account_id
         AND hcsu.site_use_code = 'BILL_TO'
         AND hcas.party_site_id = hps.party_site_id
         AND hps.location_id = hl.location_id
         AND t.ship_to_site_use_id = hcsu1.site_use_id(+)
         AND hcas1.cust_acct_site_id(+) = hcsu1.cust_acct_site_id
         AND p.class IN ('INV', 'DM')
         AND hcsu1.site_use_code(+) = 'SHIP_TO'
         AND hcas1.party_site_id = hps1.party_site_id(+)
         AND hps1.location_id = hl1.location_id(+)
         AND t.paying_customer_id = acct_pay.cust_account_id(+)
         AND t.paying_site_use_id = hcsu2.site_use_id(+)
         AND hcas2.cust_acct_site_id(+) = hcsu2.cust_acct_site_id
         AND hcas2.party_site_id = hps2.party_site_id(+)
         AND NVL (hcsu2.site_use_code, 'BILL_TO') = 'BILL_TO'
         AND hps2.location_id = hl2.location_id(+)
         AND EXISTS
                (SELECT 1
                   FROM ra_customer_trx_all t,
                        ar_payment_schedules_all p1,
                        gl_sets_of_books sob,
                        hr_operating_units hou,
                        hz_cust_accounts acct_bill_to,
                        hz_cust_accounts acct_pay,
                        jtf_rs_salesreps sp,
                        ra_terms rt,
                        ra_cust_trx_types_all rctt
                  WHERE     t.customer_trx_id = p1.customer_trx_id
                        AND p1.status = 'OP'
                        AND p1.customer_trx_id = p.customer_trx_id
                        AND t.set_of_books_id = sob.set_of_books_id
                        AND t.org_id = hou.organization_id
                        AND t.bill_to_customer_id =
                               acct_bill_to.cust_account_id
                        AND t.paying_customer_id = acct_pay.cust_account_id(+)
                        AND t.primary_salesrep_id = sp.salesrep_id(+)
                        AND t.org_id = sp.org_id(+)
                        AND t.term_id = rt.term_id(+)
                        AND t.cust_trx_type_id = rctt.cust_trx_type_id
                        AND t.org_id = rctt.org_id)
ORDER BY trx_number, customer_trx_line_id;
Filed under   | 

SysAdmin :SQL Query to display Current Statement of Active Session/Program

     SELECT s.sid,
       s.client_info,
       s.machine,
       s.program,
       s.type,
       s.logon_time,
       s.osuser,
       sq.sorts,
       sq.disk_reads,
       sq.buffer_gets,
       sq.rows_processed,
       sq.sqltype,
       sq.sql_text
  FROM gv$session s,
               gv$sql sq
 WHERE s.sql_hash_value = sq.hash_value
   AND s.inst_id = :p_inst_id           -- replace with ID from above
   AND s.sid = :p_sid                   -- replace with instID from above
   AND sq.inst_id = s.inst_id;

AR: Fetching Aging Bucket line details for a delinquent Customer account

Use this query to Fetch Aging bucket line details for a particular Customer to send dunning letter:-

You need to pass two parameter :

  •   Dunning Plan Name
  •   Customer Account Number

SELECT l.aging_bucket_line_id,
                l.type Aging_Bucket_Line_Type,
                l.days_start,
                l.days_to
  FROM ar_aging_bucket_lines l,
              ar_aging_buckets b,
              iex_dunning_plans_vl d
 WHERE 1 = 1
   AND d.name = :p_dunning_plan_name   
   AND d.aging_bucket_id = b.aging_bucket_id
   AND b.aging_bucket_id = l.aging_bucket_id
   AND (SELECT MAX (TRUNC (SYSDATE) - TRUNC (ar.due_date)) days
                 FROM iex_delinquencies del,
                             ar_payment_schedules ar,
                             hz_cust_accounts hca
             WHERE 1 = 1
             AND hca.cust_account_id = del.cust_account_id
             AND hca.account_number = :p_account_number
            AND del.payment_schedule_id = ar.payment_schedule_id
            AND del.status IN ('DELINQUENT', 'PREDELINQUENT'))
            BETWEEN l.days_start AND l.days_to
            AND EXISTS                    (SELECT 1
                     FROM iex_ag_dn_xref x
                     WHERE 1=1
                      AND d.dunning_plan_id = x.dunning_plan_id
                      AND d.aging_bucket_id = x.aging_bucket_id
                      AND x.aging_bucket_line_id = l.aging_bucket_line_id);
Filed under   | 

FND: Query to select user and responsibility details associated to an Application(FND) user

  SELECT u.user_name,
              u.start_date user_start_date,
              u.end_date user_end_date,
              u.email_address user_email_address,
              r.responsibility_name,
              g.start_date resp_assign_start_date,
              g.end_date resp_assign_end_date,
              g.user_id,
              r.responsibility_id
    FROM apps.fnd_user u,
             apps.fnd_user_resp_groups g,
             apps.fnd_responsibility_tl r
   WHERE     1 = 1
        AND r.responsibility_id = g.responsibility_id
        AND g.user_id = u.user_id
        AND u.user_name = NVL(:p_user_name, u.user_name)
        AND r.responsibility_name = NVL(:p_responsibility_name, r.responsibility_name)
ORDER BY u.user_name, r.responsibility_name DESC;

Enterprise: find Legal Entity, Organization, Company Code ...

SELECT
       xep.name                   "Legal Entity",
       hr_outl.name               "Organization Name",
       hr_outl.organization_id    "Organization ID",
       hr_loc.location_id         "Location ID",
       hr_loc.country             "Country Code",
       hr_loc.location_code       "Location Code",
       glev.flex_segment_value    "Company Code"
  FROM
       xle_entity_profiles            xep,
       xle_registrations              reg,
       hr_operating_units             hou,
       hr_all_organization_units_tl   hr_outl,
       hr_locations_all               hr_loc,
       gl_legal_entities_bsvs         glev
 WHERE   1=1
   AND xep.transacting_entity_flag   =  'Y'
   AND xep.legal_entity_id           =  reg.source_id
   AND reg.source_table              =  'XLE_ENTITY_PROFILES'
   AND reg.identifying_flag          =  'Y'
   AND xep.legal_entity_id           =  hou.default_legal_context_id
   AND reg.location_id               =  hr_loc.location_id
   AND xep.legal_entity_id           =  glev.legal_entity_id
   AND hr_outl.organization_id       =  hou.organization_id
  ORDER BY hr_outl.name

Query to find DB_LINK in an Oracle instance


 SELECT obj.object_type         "Object Type",
       obj.owner               "Object Owner",
       obj.object_name         "Object Name",
       obj.status              "Object Status",
       dbl.db_link             "DB Link",
       dbl.username            "DB Link",
       dbl.host                "DB Host"
  FROM dba_objects  obj,
       dba_db_links dbl
 WHERE obj.object_name = dbl.db_link
   AND obj.object_type = 'DATABASE LINK';
Filed under   | 

Finding concurrent request status related information

The following query finds the concurrent process status and its related information (such as, completion phase, responsibility used, which user submitted the program, etc.).

In the following example, "Autoinvoice Import Program" as Concurrent Program Name. This is well tested in R12.1.


 SELECT
       fu.user_name                           "User ID",
       frt.responsibility_name                "Responsibility Used",
       fcr.request_id                         "Request ID",
       fcpt.user_concurrent_program_name      "Concurrent Program Name",
       flv2.meaning                           "Phase",
       flv1.meaning                           "Status",
       fcr.request_date                       "Request Date",
       fcr.requested_start_date               "Request Start Date",
       fcr.parent_request_id                  "Parent Request ID"
  FROM
       fnd_user                    fu,
       fnd_responsibility_tl       frt,
       fnd_concurrent_requests     fcr,
       fnd_concurrent_programs_tl  fcpt,
       fnd_lookup_values           flv1,
       fnd_lookup_values           flv2
 WHERE
       1=1
   AND flv1.lookup_code           =  fcr.status_code
   AND flv1.lookup_type           =  'CP_STATUS_CODE'
   AND flv1.enabled_flag          =  'Y'
   AND flv1.view_application_id   <> 0
   AND flv2.lookup_code           =  fcr.phase_code
   AND flv2.lookup_type           =  'CP_PHASE_CODE'
   AND flv2.enabled_flag          =  'Y'
   AND flv2.view_application_id   <> 0
   AND fu.user_id                 =  fcr.requested_by
   AND fcr.concurrent_program_id  =  fcpt.concurrent_program_id
   AND fcr.responsibility_id      =  frt.responsibility_id
   AND frt.LANGUAGE               =  USERENV ('LANG')
   AND fcpt.LANGUAGE              =  USERENV ('LANG')
   AND fcpt.user_concurrent_program_name = 'Autoinvoice Import Program' 
 ORDER BY fcr.request_date DESC;
Filed under   | 

FND : Query to find runtime of a concurrent program

The following query finds total run-time (in minutes) for a concurrent program. You can make a small modification to this query, you can track which concurrent programs take (very) long time to complete, and may need performance tuning.


 SELECT /*+ rule */
       rq.parent_request_id                   "Parent Req. ID",
       rq.request_id                          "Req. ID",
       tl.user_concurrent_program_name        "Program Name",
       rq.actual_start_date                   "Start Date",
       rq.actual_completion_date              "Completion Date",
       ROUND((rq.actual_completion_date -
           rq.actual_start_date) * 1440, 2)   "Runtime (in Minutes)"     
  FROM applsys.fnd_concurrent_programs_tl  tl,
       applsys.fnd_concurrent_requests     rq
 WHERE tl.application_id        = rq.program_application_id
   AND tl.concurrent_program_id = rq.concurrent_program_id
   AND tl.LANGUAGE              = USERENV('LANG')
   AND rq.actual_start_date IS NOT NULL
   AND rq.actual_completion_date IS NOT NULL
   AND tl.user_concurrent_program_name = 'Autoinvoice Import Program'  -- <change it>
    ORDER BY rq.request_id DESC;
Filed under   |