206: if(kacc_rec.natural_account_acc_id is null) then
207: l_prb_counts := 0;
208: select count(distinct natural_account_value)
209: into l_prb_counts
210: from amw_fin_key_accounts_vl
211: where end_date is null
212: and account_name in (select distinct afkav.account_name
213: from amw_fin_key_accounts_vl afkav
214: where afkav.natural_account_id=kacc_rec.natural_account_id
209: into l_prb_counts
210: from amw_fin_key_accounts_vl
211: where end_date is null
212: and account_name in (select distinct afkav.account_name
213: from amw_fin_key_accounts_vl afkav
214: where afkav.natural_account_id=kacc_rec.natural_account_id
215: and afkav.end_date is null);
216: if(l_prb_counts > 1) then
217: fnd_message.set_name('AMW', 'AMW_WEBADI_VALID_ERROR');
241: /*computed NaturalAccountId*/
242:
243: begin
244: select 1 into l_valid_acc from dual
245: where exists (select * from amw_fin_key_accounts_vl
246: where natural_account_id=l_natural_account_id
247: and natural_account_value=l_natural_account_value
248: and end_date is null);
249: exception