Пример использования API для обновления БИК банка.
declare p_brunch_number varchar2(30) := '!NUM'; p_bic varchar2(9) := '!NEW_BIC'; -- l_contact_point_rec hz_contact_point_v2pub.contact_point_rec_type; l_eft_rec hz_contact_point_v2pub.eft_rec_type; l_eft_vers number; l_party_id number; -- x_return_status varchar2(1); x_msg_count number; x_msg_data varchar2(4000); begin select party_id into l_party_id from ar.hz_organization_profiles hop where 1=1 and sysdate between hop.effective_start_date and nvl(hop.effective_end_date, sysdate+1) and hop.bank_or_branch_number = p_brunch_number; dbms_output.put_line('l_party_id='||l_party_id); SELECT contact_point_id, object_version_number into l_contact_point_rec.contact_point_id, l_eft_vers FROM hz_contact_points WHERE contact_point_type = 'EFT' AND owner_table_name = 'HZ_PARTIES' AND owner_table_id = l_party_id; dbms_output.put_line('l_eft_vers='||l_eft_vers); dbms_output.put_line('contact_point_id='||l_contact_point_rec.contact_point_id); l_eft_rec.eft_swift_code := p_bic; hz_bank_pub.update_eft_contact_point ( fnd_api.g_true, l_contact_point_rec, l_eft_rec, l_eft_vers, x_return_status, x_msg_count, x_msg_data ); dbms_output.put_line('--'); dbms_output.put_line('Return status = '||x_return_status); if x_return_status != fnd_api.g_ret_sts_success then if x_msg_count = 1 then dbms_output.put_line ('Error:' || x_msg_data); else FOR i IN 1 .. x_msg_count LOOP dbms_output.put_line('Error:' ||fnd_msg_pub.get(fnd_msg_pub.g_next,fnd_api.g_false)); END LOOP; end if; end if; -- commit; exception when others then dbms_output.put_line('SQLERRM:'||SQLERRM||chr(10)); dbms_output.put_line('FORMAT_ERROR_BACKTRACE:'||chr(10) ||dbms_utility.format_error_backtrace); raise; end;
Последние комментарии