Successful Expense Report In “Expense Report Export” Concurrent Program Output File

— Following Query gives Successful Expense Report In “Expense Report Export” Concurrent Program Output File
— This will help to debug issue related to Expense Report Export

SELECT *
FROM
(SELECT per.full_name,
per.employee_num,
aps.vendor_name,
aps.segment1,
aeh.invoice_num,
aeh.week_end_date,
aeh.payment_currency_code,
aeh.total,
alc.description lookup_desc,
aeh.description header_desc,
NVL(aeh.vouchno,0),
aeh.org_id OU_ID,
hou.name,
aeh.default_currency_code
FROM ap_expense_report_headers_all aeh,
ap_suppliers aps,
per_employees_x per,
ap_lookup_codes alc,
hr_organization_units hou
WHERE aeh.request_id = 2015061
AND NVL(aeh.vouchno, 0) > 0
AND aeh.reject_code IS NULL
AND hou.organization_id(+) = aeh.org_id
AND per.employee_id = aeh.employee_id
AND aps.employee_id(+) = aeh.employee_id
AND alc.lookup_type = DECODE(aeh.hold_lookup_code, NULL, ‘EXPENSE REPORT STATUS’, ‘HOLD CODE’)
AND alc.lookup_code = DECODE(aeh.hold_lookup_code, NULL, aeh.expense_status_code, aeh.hold_lookup_code)
— AND aeh.REPORT_HEADER_ID= 693624
UNION ALL
SELECT per.full_name,
per.npw_number,
aps.vendor_name,
aps.segment1,
aeh.invoice_num,
aeh.week_end_date,
aeh.payment_currency_code,
aeh.total,
alc.description lookup_desc,
aeh.description header_desc,
NVL(aeh.vouchno,0),
aeh.org_id OU_ID,
hou.name,
aeh.default_currency_code
FROM ap_expense_report_headers_all aeh,
ap_suppliers aps,
per_cont_workers_x per,
ap_lookup_codes alc,
hr_organization_units hou
WHERE aeh.request_id = 2015061
AND NVL(aeh.vouchno, 0) > 0
AND aeh.reject_code IS NULL
AND hou.organization_id(+) = aeh.org_id
AND per.person_id = aeh.employee_id
AND aps.vendor_id(+) = aeh.vendor_id
AND alc.lookup_type = DECODE(aeh.hold_lookup_code, NULL, ‘EXPENSE REPORT STATUS’, ‘HOLD CODE’)
AND alc.lookup_code = DECODE(aeh.hold_lookup_code, NULL, aeh.expense_status_code, aeh.hold_lookup_code)
— AND aeh.REPORT_HEADER_ID= 693624
)
ORDER BY OU_ID;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s