Protected by Copyscape Web Copyright Protection Software

Pages

Search This Blog

Wednesday, June 26, 2013

How to display bank account number based on operating unit?

By using Below code we can achieve this.

select a.bank_account_num from ce_banks_v c,ce_bank_accounts a,ce_bank_branches_v d
WHERE a.bank_account_id IN (SELECT b.bank_account_id
                              FROM CE_BANK_ACCT_USES_ALL b
                              WHERE b.org_id=84-- :$FLEX$.XXST_OPERATING_UNIT1
AND (NVL(AP_USE_ENABLE_FLAG,'N' ) = 'Y' OR NVL(AR_USE_ENABLE_FLAG,'N' ) = 'Y' ))
AND   c.BANK_PARTY_ID = a.BANK_ID
AND  d.branch_party_id=a.bank_branch_id
--and c.bank_name='Petty cash'
and d.bank_branch_name='Petty Cash - USA'
  ORDER BY a.bank_account_name;

Here XXST_OPERATING_UNIT1 is a value set for operating unit.

No comments:

Post a Comment