Tuesday, March 29, 2011

Cancelling Payment Batch

I just got requirement to cancel the payment batch. It’s pretty easy if you know all underlying tables. You can use below statements as ready to use statements where you have update Payment batch name.


DELETE ap_checkrun_conc_processes_all
WHERE checkrun_name = '< Batch name>';

DELETE ap_selected_invoices_all
WHERE checkrun_name = '< Batch name>';

DELETE ap_selected_invoice_checks_all
WHERE checkrun_name = '< Batch name>';

DELETE ap_checkrun_confirmations_all
WHERE checkrun_name = '< Batch name>';

DELETE ap_awt_temp_distributions_all
WHERE checkrun_name = '< Batch name>';

UPDATE ap_inv_selection_criteria_all
SET status = 'CANCELED'
WHERE checkrun_name = '< Batch name>';

Friday, March 11, 2011

To know the particular user responsibilities


To know the particular user responsibilities
Below query provides all responsibilities of all Users available in EBS, its same query as "Active Users" report.

select user_name, responsibility_name,application_name,
       greatest(u.start_date, ur.start_date, r.start_date) start_date,
        decode(
             least(nvl(u.end_date,to_date('01/01/4712','DD/MM/YYYY')),
                     nvl(ur.end_date,to_date('01/01/4712','DD/MM/YYYY')),
                      nvl(r.end_date,to_date('01/01/4712','DD/MM/YYYY'))),
             to_date('01/01/4712','DD/MM/YYYY'),'',
 least(nvl(u.end_date,  nvl(ur.end_date, r.end_date)),
             nvl(ur.end_date, nvl(u.end_date,  r.end_date)),
             nvl(r.end_date,  nvl(u.end_date,  ur.end_date)))) end_date,
             EMAIL_ADDRESS        
from fnd_user u,
     fnd_user_resp_groups_all ur,
     fnd_responsibility_vl r,
     fnd_application_vl a,
     fnd_security_groups_vl s
where a.application_id = r.application_id
and   u.user_id = ur.user_id
and   r.application_id = ur.responsibility_application_id
and   r.responsibility_id = ur.responsibility_id
and   ur.start_date <= sysdate
and   nvl(ur.end_date, sysdate + 1) > sysdate
and   u.start_date <= sysdate
and   nvl(u.end_date, sysdate + 1) > sysdate
and   r.start_date <= sysdate
and   nvl(r.end_date, sysdate + 1) > sysdate
order by user_name,application_name,responsibility_name