Wednesday, August 29, 2012

Script to identify inactive supplier records



The following script can be used to identify the supplier records not used for a specific number of days:

SELECT aps.vendor_id, aps.vendor_name, aps.segment1, aps.vendor_type_lookup_code FROM ap_suppliers aps WHERE NOT EXISTS (SELECT DISTINCT vendor_id FROM (SELECT vendor_id FROM ap_invoices_all WHERE creation_date > (sysdate - p_days) AND org_id = UNION ALL SELECT vendor_id FROM po_headers_all WHERE creation_date > (sysdate - p_days) AND closed_code <> 'CLOSED') AND org_id = WHERE vendor_id = aps.vendor_id) AND aps.end_date_active IS NULL; 

Wednesday, June 20, 2012

Pre AME rollout - HR sanity check scripts

Prior to rolling out AME for iProcurement and/or Internet Expenses, it is important to ensure the HR hierarchy is clean with no breaks or holes in it.

Here's an example of a script to help identify corrupt data in the HR hierarchy (e.g. direct reports with no supervisors, missing default expense accounts, jobs (positions), office location, email address)


select distinct ppf.full_name empl_name
from per_all_assignments_f paa,
     per_people_f ppf,
     fnd_user f
where paa.person_id = ppf.person_id
  and f.end_date is null
  and ppf.person_id = f.employee_id
and paa.supervisor_id is null --with missing supervisor record
and sysdate BETWEEN paa.effective_start_date AND paa.effective_end_date
and paa.primary_flag = 'Y'
union
select distinct ppf.full_name empl_name
from per_all_assignments_f paa,
     per_people_f ppf,
     fnd_user f
where paa.person_id = ppf.person_id
  and f.end_date is null
  and ppf.person_id = f.employee_id
and paa.default_code_comb_id is null --with missing default expense account
and sysdate BETWEEN paa.effective_start_date AND paa.effective_end_date
and paa.primary_flag = 'Y'
union
select distinct ppf.full_name empl_name
from per_all_assignments_f paa,
     per_people_f ppf,
     fnd_user f
where paa.person_id = ppf.person_id
  and f.end_date is null
  and ppf.person_id = f.employee_id
and paa.job_id is null  --with missing job (or position, for fetching the DOA)
and sysdate BETWEEN paa.effective_start_date AND paa.effective_end_date
and paa.primary_flag = 'Y'
union
select distinct ppf.full_name empl_name
from per_all_assignments_f paa,
     per_people_f ppf,
     fnd_user f
where paa.person_id = ppf.person_id
  and f.end_date is null
  and ppf.person_id = f.employee_id
and paa.location_id is null  --with missing location (used to create supplier records of Employees with OIE)
and sysdate BETWEEN paa.effective_start_date AND paa.effective_end_date
and paa.primary_flag = 'Y'
union
select distinct ppf.full_name empl_name
from per_all_assignments_f paa,
     per_people_f ppf,
     fnd_user f
where paa.person_id = ppf.person_id
  and f.end_date is null
  and ppf.person_id = f.employee_id
and ppf.email_address is null  --with missing email address (to send email notifications)
and sysdate BETWEEN paa.effective_start_date AND paa.effective_end_date
and paa.primary_flag = 'Y'
order by 1;


Review of OIE processes, expense items, expense report templates



Here's a script that extracts all expense report templates and expense items with accounting information, the extract should be reviewed by the Finance and/or Accounts Payable team(s) on a regular basis and make changes when required:

select decode (exi.org_id,1,'',2,'org name 2',3,'org name 3',4,'org name 4') organisation,
ext.report_type template_name, exi.prompt, exi.vat_code, category_code, exi.flex_concactenated, exi.flex_description, exi.creation_date
from AP_EXPENSE_REPORT_PARAMS_ALL exi,
ap_expense_reports_all ext
where ext.org_id = exi.org_id
and ext.expense_report_id = exi.expense_report_id
and ext.inactive_date is null
and ext.web_enabled_flag = 'Y'
and exi.end_date is null
order by 1, 2, 3;


Thursday, May 24, 2012

Some tech tips and links


Where are the .wft files located, like APEXP.wft ?

WFLOAD - what does this command do in PUTTY?
Have a read of this blog entry here.

More to come - keep watching !


Monday, May 7, 2012

Tax Codes not enabled for Internet Expenses


Try the following SQL scripts to help you identify if the setup of tax codes were correctly done or upgraded:

--Query 1
SELECT lookup_code, meaning, description
FROM zx_input_classifications_v
WHERE lookup_type = 'ZX_INPUT_CLASSIFICATIONS'
AND org_id =
AND enabled_flag = 'Y'

--Query 2
SELECT lookup_code, meaning, description
FROM zx_input_classifications_v
WHERE lookup_type = 'ZX_WEB_EXP_TAX_CLASSIFICATIONS'
AND org_id =  
AND enabled_flag = 'Y'

If the tax code appears in both queries, then the tax code should appear in the Internet Expenses module, when the tax code only appears in query 1 above, then you know there is an issue with the tax code.

To fix this issue, follow the additional setups identified in Oracle note 1312692.1 : Payables - Upgrade - Tax Codes not Enabled for Internet Expenses OIE

Tuesday, May 1, 2012

Steps for debugging issues in Oracle


How to capture the back-end FND debugging messages thrown when errors are thrown.

See the action plan below:

(a) Set the following profile options at your user level

FND: Diagnostics: Yes
FND: Debug Log Enabled: Yes
FND: Debug Log Level: Statement
FND: Debug Log Mode: Asynchronous with Cross-Tier Sequencing
FND: Debug Log Module to %


(b) Go to the form or prior step where the issue arises.

At this point, run the following SQL:

select max(log_sequence) from fnd_log_messages;

Note the max(log_sequence) value as &start


(c) Then proceed to replicate the error.

After clicking away the error, re-run the SQL:

select max(log_sequence) from fnd_log_messages;

Note the max(log_sequence) value as &end


(d) Then run

SELECT substr(module,1,70), MESSAGE_TEXT, timestamp, log_sequence
FROM fnd_log_messages msg
WHERE log_sequence between &start and &end
ORDER BY LOG_SEQUENCE


(e) REMOVE PROFILE OPTION VALUES AT YOUR USER LEVEL!!!!


Wednesday, April 11, 2012

R12 SLA Tree: a visual diagram

>> ADR JED JLT

>>>> JLD


>>>>>> AAD

>>>>>>>> SLAM

Where:
ADR = Account Derivation Rules
JED = Journal Entry Description
JLT = Journal Line Type
JLD = Journal Line Definition
AAD = Application Accounting Definition
SLAM = Subledger Accounting Method