Category Archives: oracle apps
Remove/delete hr_api_transaction table data and its related table data using api
DECLARE
P_TRANSACTION_ID NUMBER;
P_VALIDATE BOOLEAN;
BEGIN
P_TRANSACTION_ID := 434115;
P_VALIDATE := FALSE;
APPS.HR_TRANSACTION_API.ROLLBACK_TRANSACTION ( P_TRANSACTION_ID, P_VALIDATE );
COMMIT;
END;
Oracle Reports Builder RDF Date Format
While developing RDF report we need to provide the Date Format in Parameter. We will get valueset from FND_STANDARD_DATE. To refer the parameter across the RDF we can put Input Mask and keep the Parameter in Date format.
RRRR/MM/DD HH24:MI:SS
Oracle apps EBS AP Invoice Approval History Query
select * from AP_INV_APRVL_HIST_ALL where invoice_id = 559817;
Reconciled Payments and Invoices
Below is the Query for Invoices and Payments
SELECT
aia.invoice_num,
aia.invoice_amount,
aia.amount_paid total_amount_paid,
aia.invoice_currency_code,
asup.vendor_name supplier,
apsa.vendor_site_code supplier_site,
apsa.address_line1|| ' '|| apsa.address_line2|| ' '|| apsa.address_line3|| ' '|| apsa.city|| ' '|| apsa.state|| ' '|| apsa.zip supplier_address,
ac.bank_account_num eaa_bank_account,
iebav.bank_name,
iebav.bank_branch_name,
iebav.branch_number,
iebav.bank_account_number,
iebav.iban_number,
ac.CHECK_NUMBER payment_num,
ac.status_lookup_code payment_status,
ac.amount payment_amount,
ac.currency_code payment_currency,
ac.check_date payment_date,
ac.cleared_date payment_clearning_date,
(SELECT DISTINCT ffvv.flex_value|| '-'|| ffvv.description
FROM ap_invoice_distributions_all aida,
gl_code_combinations_kfv gcc,
fnd_flex_values_vl ffvv
WHERE gcc.code_combination_id = aida.dist_code_combination_id AND distribution_line_number = 1
AND aida.invoice_line_number = 1 AND aia.invoice_id = aida.invoice_id AND ffvv.flex_value = gcc.segment1
AND ffvv.flex_value_set_id = 1015406
) directorate,
(
SELECT DISTINCT gcc.concatenated_segments
FROM
ap_invoice_distributions_all aida,
gl_code_combinations_kfv gcc
WHERE gcc.code_combination_id = aida.dist_code_combination_id AND distribution_line_number = 1
AND aida.invoice_line_number = 1 AND aia.invoice_id = aida.invoice_id
) account
FROM
apps.ap_invoices_all aia,
apps.ap_suppliers asup,
apps.ap_supplier_sites_all apsa,
apps.ap_payment_schedules_all d,
apps.ap_invoice_payments_all ap,
ap_checks_all ac,
iby_external_bank_accounts_v iebav
WHERE
aia.vendor_id = asup.vendor_id
AND aia.vendor_site_id = apsa.vendor_site_id
AND asup.vendor_id = apsa.vendor_id
AND aia.invoice_id = d.invoice_id
AND ap.invoice_id = aia.invoice_id
AND ac.check_id = ap.check_id
and aia.org_id = 101
and aia.org_id = ap.org_id
and aia.org_id = ac.org_id
and aia.org_id = apsa.org_id
AND ac.external_bank_account_id = iebav.ext_bank_account_id
AND ac.check_date >= '01-JAN-2022'
and ac.status_lookup_code in ('RECONCILED', 'RECONCILED UNACCOUNTED')
Annual Leave or Other Leave Accrual Query in Oracle Apps
SELECT DISTINCT
pf.employee_number,
pf.full_name,
pf.business_group_id,
TO_CHAR(per_utility_functions.get_net_accrual(paf.assignment_id,paf.payroll_id,pf.business_group_id,NULL,TO_DATE('01-JAN-2022','DD-MON-YYYY'
),61, -- Accrual Plan ID
NULL,NULL) ) annual_leave_plan,
TO_CHAR(per_utility_functions.get_net_accrual(paf.assignment_id,paf.payroll_id,pf.business_group_id,NULL,TO_DATE('01-JAN-2022','DD-MON-YYYY'
),1061, -- Accrual Plan ID
NULL,NULL) ) residual_leave_plan
FROM
pay_view_accrual_plans_v pv,
per_all_people_f pf,
per_all_assignments_f paf
WHERE
pv.person_id = pf.person_id
AND pf.person_id = paf.person_id
AND pv.accrual_plan_id IN (61,1061)
AND trunc(SYSDATE) BETWEEN pf.effective_start_date AND pf.effective_end_date
AND trunc(SYSDATE) BETWEEN paf.effective_start_date AND paf.effective_end_date
GL Dump, GL Query, GL Detail Query in Oracle apps
Query to get GL Dump or GL related detail information.
SELECT glh.doc_sequence_value Header_voucher_number,
gll.JE_LINE_NUM,
glh.LAST_UPDATED_BY,
glh.LAST_UPDATED_BY last_updated_by_user,
gjb.name batch_name,
glc.segment1|| '-'|| apps.gl_flexfields_pkg.get_description_sql (glc.chart_of_accounts_id,1,glc.segment1) Company_name,
gl.NAME ledger_name,
glh.created_by,
glh.NAME journal_name,
gll.description Journal_Header_Description,
glh.je_source JE_Source,
gljc.user_je_category_name JE_Category,
glc.segment4 account_,
glc.concatenated_segments gl_code,
glh.currency_code,
glh.CURRENCY_CONVERSION_TYPE conversion_type,
glh.CURRENCY_CONVERSION_RATE conversion_rate,
glh.creation_date,
glh.PERIOD_NAME,
TO_CHAR (glh.default_effective_date, 'DD-MON-YYYY') Accounting_Date,
glh.POSTED_DATE,
gll.DESCRIPTION line_DESCRIPTION,
gll.entered_dr,
gll.entered_cr,
gll.ACCOUNTED_DR,
gll.ACCOUNTED_CR
FROM apps.gl_je_headers glh,
apps.gl_ledgers gl,
apps.gl_je_batches gjb,
apps.gl_je_lines gll,
apps.gl_je_categories_tl gljc,
apps.gl_code_combinations_kfv glc
WHERE glh.je_header_id = gll.je_header_id
AND gll.code_combination_id = glc.code_combination_id
AND glh.ledger_id = gl.ledger_id
and glh.je_batch_id = gjb.JE_BATCH_ID
AND glh.default_effective_date BETWEEN :lv_from_date AND :lv_to_date
AND glh.je_category = gljc.je_category_name
ORDER BY glh.doc_sequence_value,
glh.default_effective_date,
gll.entered_dr,
gll.entered_cr;
Query to find all responsibilities assigned to a user in Oracle apps
SELECT
fu.user_name "User Name",
frt.responsibility_name "Responsibility Name",
furg.start_date "Start Date",
furg.end_date "End Date",
fr.responsibility_key "Responsibility Key",
fa.application_short_name "Application Short Name"
FROM
fnd_user_resp_groups_direct furg,
applsys.fnd_user fu,
applsys.fnd_responsibility_tl frt,
applsys.fnd_responsibility fr,
applsys.fnd_application_tl fat,
applsys.fnd_application fa
WHERE
furg.user_id = fu.user_id
AND furg.responsibility_id = frt.responsibility_id
AND fr.responsibility_id = frt.responsibility_id
AND fa.application_id = fat.application_id
AND fr.application_id = fat.application_id
AND frt.language = userenv('LANG')
AND upper(fu.user_name) = upper('SYSADMIN') -- <change it>
-- AND (furg.end_date IS NULL OR furg.end_date >= TRUNC(SYSDATE))
ORDER BY
frt.responsibility_name;
Query to get Ex-Employees/Terminated/Deactivated Employees in Oracle Apps
SELECT DISTINCT
papf.employee_number "Employee Number",
papf.title "Title",
papf.first_name "First Name",
papf.last_name "Last Name",
--papf.national_identifier,
papf.email_address "E-mail",
--TO_CHAR(papf.effective_start_date, 'DD-MON-RRRR') "Start Date",
--TO_CHAR(papf.effective_end_date, 'DD-MON-RRRR') "End Date",
TO_CHAR(papf.original_date_of_hire,'DD-MON-RRRR') "Hire Date",
TO_CHAR(actual_termination_date) "ACTUAL_TERMINATION_DATE",
fu.user_name,
fu.start_date,
fu.end_date
FROM
apps.per_all_people_f papf,
apps.per_periods_of_service ppos,
fnd_user fu
WHERE
1 = 1
AND fu.employee_id = papf.person_id
AND papf.person_id = ppos.person_id
AND ppos.period_of_service_id = (
SELECT
MAX(period_of_service_id)
FROM
per_periods_of_service
WHERE
person_id = papf.person_id
)
AND ppos.actual_termination_date < trunc(SYSDATE);
-- AND ppos.actual_termination_date > trunc(SYSDATE - 340);
Query to get HRMS Active Positions in Oracle Apps EBz.
select HR_GENERAL.DECODE_AVAILABILITY_STATUS(pap.AVAILABILITY_STATUS_ID) AVAILABILITY_STATUS_DESC , pap.* from hr_all_positions_f pap where HR_GENERAL.DECODE_AVAILABILITY_STATUS(pap.AVAILABILITY_STATUS_ID) = 'Active'