Tuesday, August 19, 2014

API to create bank in Oracle Account Payables

API to create bank in Oracle AP


Important Note: Please visit my post
'API to create bank branch in Oracle Applications R12' in this blog to know how to create bank branch in Oracle Applications.
'API to create bank account in Oracle Applications R12' in this blog to know how to create bank account in Oracle Applications.
'API to associate bank account to supplier site in Oracle Applications R12' in this blog to know how to associate created bank account to supllier site.



--Declaration
x_msg_count NUMBER;
x_bank_id NUMBER;
v_return_status_account VARCHAR2 (100);
x_response_rec iby_fndcpt_common_pub.result_rec_type;
x_msg_data VARCHAR2 (2000);
x_error_message VARCHAR2 (2000);
--r_ext_bank_rec this is record type

--CHECK THT BANK EXIST OR NOT by passing bank name

SELECT COUNT (bank_party_id)
INTO x_bank_count
FROM iby_ext_banks_v
WHERE UPPER (bank_name) = UPPER (c_supp_site_pre_rec.bank_name)
AND home_country = 'GB' --for testing, change as per req
AND bank_institution_type = 'BANK';
                 
            

iby_ext_bankacct_pub.create_ext_bank
                                          (p_api_version        => 1.0,
                                           p_init_msg_list      => fnd_api.g_true,
                                           p_ext_bank_rec       => r_ext_bank_rec,
                                           x_bank_id            => x_bank_id,
                                           x_return_status      => v_return_status,
                                           x_msg_count          => x_msg_count,
                                           x_msg_data           => x_msg_data,
                                           x_response           => x_response_rec
                                         );
 
COMMIT;
                         
IF v_return_status_account <> 'S'
THEN
--error
--print error message or use x_msg_data
x_error_message:=fnd_msg_pub.get_detail (x_msg_count, 'F' );
FOR i IN x_msg_count .. 1
LOOP
fnd_msg_pub.delete_msg (i);
END LOOP;
else
--success
end if;


 

1 comment:

  1. Regards
    Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
    LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
    Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.

    ReplyDelete