DECLARE
l_rec_pmt_int_asig iby_fndcpt_setup_pub.pmtinstrassignment_rec_type := NULL;
l_rec_payeecontext iby_disbursement_setup_pub.payeecontext_rec_type := NULL;
l_num_party_id NUMBER;
l_num_vendor_id NUMBER;
l_num_assign_id NUMBER;
l_num_acct_id NUMBER;
l_num_branch_id NUMBER;
l_chr_return_status VARCHAR2(200) := NULL;
l_num_msg_count NUMBER := 0;
l_chr_msg_data VARCHAR2(200) := NULL;
l_rec_response iby_fndcpt_common_pub.result_rec_type := NULL;
l_msg VARCHAR2(2000);
BEGIN
dbms_output.put_line('program start');
l_rec_pmt_int_asig.priority := 1;
l_rec_pmt_int_asig.start_date := SYSDATE;
l_rec_pmt_int_asig.instrument.instrument_type := 'BANKACCOUNT';
l_rec_pmt_int_asig.instrument.instrument_id := 224771;--iby_ext_bank_accounts_v.EXT_BANK_ACCOUNT_ID
l_rec_payeecontext.party_id := 12182106;--l_num_party_id; --ap_suppliers.party_id
l_rec_payeecontext.payment_function := 'PAYABLES_DISB';
l_rec_payeecontext.org_type := 'OPERATING_UNIT';
l_rec_payeecontext.org_id := 142;
l_rec_payeecontext.party_site_id :=10582852;--ap_supplier_sites_all.party_site_id
l_rec_payeecontext.supplier_site_id :=1867031;--ap_supplier_sites_all.vendor_site_id
/*l_rec_payeecontext.org_type := NULL;--'OPERATING_UNIT';
l_rec_payeecontext.org_id := NULL;--142;--82;
l_rec_payeecontext.party_site_id := NULL;--10576832;--site_rec.party_site_id;
l_rec_payeecontext.supplier_site_id := NULL;--1857039;--site_rec.vendor_site_id; */
dbms_output.put_line('api start');
iby_disbursement_setup_pub.set_payee_instr_assignment
(p_api_version => 1,
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_true,
x_return_status=> l_chr_return_status,
x_msg_count => l_num_msg_count,
x_msg_data => l_chr_msg_data,
p_payee => l_rec_payeecontext,
p_assignment_attribs => l_rec_pmt_int_asig,
x_assign_id => l_num_assign_id,
x_response => l_rec_response);
COMMIT;
dbms_output.put_line('l_chr_return_status' || l_chr_return_status);
dbms_output.put_line('l_num_msg_count.' || l_num_msg_count);
dbms_output.put_line('l_chr_msg_data.' || l_chr_msg_data);
dbms_output.put_line('l_num_assign_id' || l_num_assign_id);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('main exception.');
END;
Script output
------------------------------
program start
api start
l_chr_return_statusS
l_num_msg_count.1
l_chr_msg_data.IBY
l_num_assign_id:10239388
Query
-----------------------------
select * from IBY_PMT_INSTR_USES_ALL where
--INSTRUMENT_ID =224771
INSTRUMENT_PAYMENT_USE_ID=10239388
Note: Record will be inserted into IBY_PMT_INSTR_USES_ALL table.
Assign bank to supplier level then pass below parameters to NULL.
l_rec_payeecontext.org_type := NULL;
l_rec_payeecontext.org_id := NULL;
l_rec_payeecontext.party_site_id := NULL;
l_rec_payeecontext.supplier_site_id := NULL;
Thursday, 22 August 2019
Friday, 9 August 2019
How To run Environment file
bash
ls -1
ls -1
. EBSapps.env run
Unix Command to find file in Directory and Subdirectories
find . -name SupplierSiteNameValidator.java
API to Create External Bank Account (IBY_EXT_BANKACCT_PUB.create_ext_bank_acct)
DECLARE
x_acct_id NUMBER;
x_response_rec iby_fndcpt_common_pub.result_rec_type;
x_return_status VARCHAR2(10);
x_msg_count NUMBER;
x_msg_data VARCHAR2(256);
x_bank_acct_rec iby_ext_bankacct_pub.extbankacct_rec_type;
BEGIN
dbms_output.put_line('Program Start');
x_bank_acct_rec.country_code := 'IN';
x_bank_acct_rec.branch_id := 12182104;--ce_bank_branches_v.branch_party_id
x_bank_acct_rec.bank_id := 12182101;--ce_bank_branches_v.bank_party_id
x_bank_acct_rec.acct_owner_party_id := 12182106;--ap_suppliers.party_id
x_bank_acct_rec.currency := 'INR';
x_bank_acct_rec.bank_account_name := 'Sandy Test Account';---new bank account name
x_bank_acct_rec.bank_account_num := 999999999;--23593 ;--new bank account number
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
iby_ext_bankacct_pub.create_ext_bank_acct
(p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_ext_bank_acct_rec => x_bank_acct_rec,
x_acct_id => x_acct_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_response => x_response_rec
);
COMMIT;
dbms_output.put_line('External bank account created.');
dbms_output.put_line('x_acct_id:' || x_acct_id);
dbms_output.put_line('x_return_status:' || x_return_status);
dbms_output.put_line('x_msg_count:' || x_msg_count);
dbms_output.put_line('x_msg_data:' || x_msg_data);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('main exception-IBY_EXT_BANKACCT_PUB.create_ext_bank_acct.');
END;
Script Output
---------------------------------
Program Start
External bank account created.
x_acct_id224771
x_return_statusS
x_msg_count.0
x_msg_data.
Query to find the record
------------------------------------
SELECT * FROM iby_ext_bank_accounts_v where EXT_BANK_ACCOUNT_ID =224771
x_acct_id NUMBER;
x_response_rec iby_fndcpt_common_pub.result_rec_type;
x_return_status VARCHAR2(10);
x_msg_count NUMBER;
x_msg_data VARCHAR2(256);
x_bank_acct_rec iby_ext_bankacct_pub.extbankacct_rec_type;
BEGIN
dbms_output.put_line('Program Start');
x_bank_acct_rec.country_code := 'IN';
x_bank_acct_rec.branch_id := 12182104;--ce_bank_branches_v.branch_party_id
x_bank_acct_rec.bank_id := 12182101;--ce_bank_branches_v.bank_party_id
x_bank_acct_rec.acct_owner_party_id := 12182106;--ap_suppliers.party_id
x_bank_acct_rec.currency := 'INR';
x_bank_acct_rec.bank_account_name := 'Sandy Test Account';---new bank account name
x_bank_acct_rec.bank_account_num := 999999999;--23593 ;--new bank account number
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
iby_ext_bankacct_pub.create_ext_bank_acct
(p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_ext_bank_acct_rec => x_bank_acct_rec,
x_acct_id => x_acct_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_response => x_response_rec
);
COMMIT;
dbms_output.put_line('External bank account created.');
dbms_output.put_line('x_acct_id:' || x_acct_id);
dbms_output.put_line('x_return_status:' || x_return_status);
dbms_output.put_line('x_msg_count:' || x_msg_count);
dbms_output.put_line('x_msg_data:' || x_msg_data);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('main exception-IBY_EXT_BANKACCT_PUB.create_ext_bank_acct.');
END;
Script Output
---------------------------------
Program Start
External bank account created.
x_acct_id224771
x_return_statusS
x_msg_count.0
x_msg_data.
Query to find the record
------------------------------------
SELECT * FROM iby_ext_bank_accounts_v where EXT_BANK_ACCOUNT_ID =224771
API to Create Supplier Site (pos_vendor_pub_pkg.create_vendor_site)
DECLARE
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_site_id NUMBER;
l_party_site_id NUMBER;
l_location_id NUMBER;
BEGIN
--Required
l_vendor_site_rec.vendor_id :='1737017';
l_vendor_site_rec.vendor_site_code := 'Sandy_Supp_001';
l_vendor_site_rec.address_line1 := 'Sandy_Supplier_001';
l_vendor_site_rec.country := 'IN';
l_vendor_site_rec.org_id := '142';
l_vendor_site_rec.purchasing_site_flag:='Y';
l_vendor_site_rec.pay_site_flag :='Y';
l_vendor_site_rec.rfq_only_site_flag :='N';
pos_vendor_pub_pkg.create_vendor_site
(
p_vendor_site_rec => l_vendor_site_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id
);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
dbms_output.put_line('vendor_site_id: '||l_vendor_site_id);
dbms_output.put_line('party_site_id: '||l_party_site_id);
dbms_output.put_line('l_location_id: '||l_location_id);
END;
l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_site_id NUMBER;
l_party_site_id NUMBER;
l_location_id NUMBER;
BEGIN
--Required
l_vendor_site_rec.vendor_id :='1737017';
l_vendor_site_rec.vendor_site_code := 'Sandy_Supp_001';
l_vendor_site_rec.address_line1 := 'Sandy_Supplier_001';
l_vendor_site_rec.country := 'IN';
l_vendor_site_rec.org_id := '142';
l_vendor_site_rec.purchasing_site_flag:='Y';
l_vendor_site_rec.pay_site_flag :='Y';
l_vendor_site_rec.rfq_only_site_flag :='N';
pos_vendor_pub_pkg.create_vendor_site
(
p_vendor_site_rec => l_vendor_site_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id
);
COMMIT;
dbms_output.put_line('return_status: '||l_return_status);
dbms_output.put_line('msg_data: '||l_msg_data);
dbms_output.put_line('vendor_site_id: '||l_vendor_site_id);
dbms_output.put_line('party_site_id: '||l_party_site_id);
dbms_output.put_line('l_location_id: '||l_location_id);
END;
Script Output
-------------------------------
return_status: S
msg_data:
vendor_site_id: 1867031
party_site_id: 10582852
l_location_id: 362546
Query
-------------------------------
select * from ap_supplier_sites_all where vendor_id = 1737017;
API to Create Supplier (pos_vendor_pub_pkg.create_vendor)
DECLARE
l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_id NUMBER;
l_party_id NUMBER;
BEGIN
--Required
l_vendor_rec.segment1 := NULL;--'10001'; --ID
l_vendor_rec.vendor_name := 'Sandy Test Supplier'; --Supplier Name
---l_vendor_rec.party_id := 115422;
l_vendor_rec.jgzz_fiscal_code := 'ABUFS3022M';
l_vendor_rec.tax_reference := '09753805106C';
l_vendor_rec.start_date_active := SYSDATE;
l_vendor_rec.invoice_currency_code := 'INR';
l_vendor_rec.payment_currency_code := 'INR';
l_vendor_rec.pay_group_lookup_code := 'CUSTOMER';
-- l_vendor_rec.EMPLOYEE_ID := 18635;
pos_vendor_pub_pkg.create_vendor
(p_vendor_rec => l_vendor_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_id => l_vendor_id,
x_party_id => l_party_id);
COMMIT;
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_data: ' || l_msg_data);
dbms_output.put_line('vendor_id: ' || l_vendor_id);
dbms_output.put_line('party_id: ' || l_party_id);
END;
Script Output
--------------------------
return_status: S
msg_data:
vendor_id: 1737017
party_id: 12182106
l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type;
l_return_status VARCHAR2(10);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_id NUMBER;
l_party_id NUMBER;
BEGIN
--Required
l_vendor_rec.segment1 := NULL;--'10001'; --ID
l_vendor_rec.vendor_name := 'Sandy Test Supplier'; --Supplier Name
---l_vendor_rec.party_id := 115422;
l_vendor_rec.jgzz_fiscal_code := 'ABUFS3022M';
l_vendor_rec.tax_reference := '09753805106C';
l_vendor_rec.start_date_active := SYSDATE;
l_vendor_rec.invoice_currency_code := 'INR';
l_vendor_rec.payment_currency_code := 'INR';
l_vendor_rec.pay_group_lookup_code := 'CUSTOMER';
-- l_vendor_rec.EMPLOYEE_ID := 18635;
pos_vendor_pub_pkg.create_vendor
(p_vendor_rec => l_vendor_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_id => l_vendor_id,
x_party_id => l_party_id);
COMMIT;
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_data: ' || l_msg_data);
dbms_output.put_line('vendor_id: ' || l_vendor_id);
dbms_output.put_line('party_id: ' || l_party_id);
END;
Script Output
--------------------------
return_status: S
msg_data:
vendor_id: 1737017
party_id: 12182106
Query:
--------------------------
select aps.Party_id, aps.* from ap_suppliers aps where vendor_id =1737017
API to Create Bank Branch (iby_ext_bankacct_pub.create_ext_bank_branch)
DECLARE
p_api_version NUMBER := 1.0;
p_init_msg_list VARCHAR2(1) := 'F';
l_bank_id NUMBER := 12182101;--530705;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER(5);
x_msg_data VARCHAR2(2000);
x_branch_id NUMBER;
p_count NUMBER;
x_response iby_fndcpt_common_pub.result_rec_type;
p_ext_bank_branch_rec iby_ext_bankacct_pub.extbankbranch_rec_type;
BEGIN
dbms_output.put_line('Program Start');
p_ext_bank_branch_rec.bch_object_version_number := 1.0;
p_ext_bank_branch_rec.branch_name := 'Bank Test Branch';
p_ext_bank_branch_rec.branch_type := 'ABA';
p_ext_bank_branch_rec.bank_party_id := l_bank_id;
iby_ext_bankacct_pub.create_ext_bank_branch(
p_api_version => p_api_version,
p_init_msg_list => p_init_msg_list,
p_ext_bank_branch_rec => p_ext_bank_branch_rec,
x_branch_id => x_branch_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_response => x_response);
dbms_output.put_line('x_branch_id: ' || x_branch_id);
dbms_output.put_line('x_return_status: ' || x_return_status);
IF
( x_msg_count = 1 )
THEN
dbms_output.put_line('x_msg_data ' || x_msg_data);
ELSIF ( x_msg_count > 1 ) THEN
LOOP
p_count := p_count + 1;
x_msg_data := fnd_msg_pub.get(fnd_msg_pub.g_next,fnd_api.g_false);
IF
( x_msg_data IS NULL )
THEN
EXIT;
END IF;
dbms_output.put_line('Message:' || p_count|| ' ---' || x_msg_data);
END LOOP;
END IF;
COMMIT;
dbms_output.put_line('Program End');
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line('Main Exception Error:'||sqlerrm);
END;
/
Script output
---------------------------------------
Program Start
x_branch_id: 12182104
x_return_status: S
Program End
Query to check
------------------------------
select * from ce_bank_branches_v where BRANCH_PARTY_ID=12182104
select * from iby_ext_bank_branches_v where BRANCH_PARTY_ID=12182104
p_api_version NUMBER := 1.0;
p_init_msg_list VARCHAR2(1) := 'F';
l_bank_id NUMBER := 12182101;--530705;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER(5);
x_msg_data VARCHAR2(2000);
x_branch_id NUMBER;
p_count NUMBER;
x_response iby_fndcpt_common_pub.result_rec_type;
p_ext_bank_branch_rec iby_ext_bankacct_pub.extbankbranch_rec_type;
BEGIN
dbms_output.put_line('Program Start');
p_ext_bank_branch_rec.bch_object_version_number := 1.0;
p_ext_bank_branch_rec.branch_name := 'Bank Test Branch';
p_ext_bank_branch_rec.branch_type := 'ABA';
p_ext_bank_branch_rec.bank_party_id := l_bank_id;
iby_ext_bankacct_pub.create_ext_bank_branch(
p_api_version => p_api_version,
p_init_msg_list => p_init_msg_list,
p_ext_bank_branch_rec => p_ext_bank_branch_rec,
x_branch_id => x_branch_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_response => x_response);
dbms_output.put_line('x_branch_id: ' || x_branch_id);
dbms_output.put_line('x_return_status: ' || x_return_status);
IF
( x_msg_count = 1 )
THEN
dbms_output.put_line('x_msg_data ' || x_msg_data);
ELSIF ( x_msg_count > 1 ) THEN
LOOP
p_count := p_count + 1;
x_msg_data := fnd_msg_pub.get(fnd_msg_pub.g_next,fnd_api.g_false);
IF
( x_msg_data IS NULL )
THEN
EXIT;
END IF;
dbms_output.put_line('Message:' || p_count|| ' ---' || x_msg_data);
END LOOP;
END IF;
COMMIT;
dbms_output.put_line('Program End');
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line('Main Exception Error:'||sqlerrm);
END;
/
Script output
---------------------------------------
Program Start
x_branch_id: 12182104
x_return_status: S
Program End
Query to check
------------------------------
select * from ce_bank_branches_v where BRANCH_PARTY_ID=12182104
select * from iby_ext_bank_branches_v where BRANCH_PARTY_ID=12182104
Thursday, 8 August 2019
API to Create Bank (iby_ext_bankacct_pub.create_ext_bank)
DECLARE
l_output VARCHAR2(4000);
lc_msg_dummy VARCHAR2(3000);
lc_return_status VARCHAR2(3000);
lc_msg_data VARCHAR2(3000);
ln_bank_id NUMBER;
ln_msg_count NUMBER;
lr_extbank_rec apps.iby_ext_bankacct_pub.extbank_rec_type;
lr_response_rec apps.iby_fndcpt_common_pub.result_rec_type;
BEGIN
dbms_output.put_line('Progam start');
--lc_return_status := '';
--ln_msg_count := '';
--lc_msg_data := '';
lr_extbank_rec.bank_name := 'Bank Test';
lr_extbank_rec.bank_number := 'BT0001';
lr_extbank_rec.country_code := 'IN';
iby_ext_bankacct_pub.create_ext_bank
(
p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_ext_bank_rec => lr_extbank_rec,
x_bank_id => ln_bank_id,
x_return_status => lc_return_status,
x_msg_count => ln_msg_count,
x_msg_data => lc_msg_data,
x_response => lr_response_rec
);
dbms_output.put_line('ln_bank_id:' || ln_bank_id);
dbms_output.put_line('lc_return_status:' || lc_return_status);
l_output := ' ';
IF
( lc_return_status <> 'S' )
THEN
FOR i IN 1..ln_msg_count LOOP
apps.fnd_msg_pub.get(i,apps.fnd_api.g_false,lc_msg_data,lc_msg_dummy);
l_output := l_output || ( TO_CHAR(i) || ': ' || substr(lc_msg_data,1,250) );
END LOOP;
dbms_output.put_line('l_output:' || l_output);
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line('Main Exception Error:'||sqlerrm);
END;
/
Script Output
-------------------------------------
Progam start
ln_bank_id:12182101
lc_return_status:S
Query to Check
-------------------------------------
select * from CE_BANKS_V WHERE BANK_PARTY_ID=12182101
select * FROM iby_ext_banks_v WHERE BANK_PARTY_ID=12182101
l_output VARCHAR2(4000);
lc_msg_dummy VARCHAR2(3000);
lc_return_status VARCHAR2(3000);
lc_msg_data VARCHAR2(3000);
ln_bank_id NUMBER;
ln_msg_count NUMBER;
lr_extbank_rec apps.iby_ext_bankacct_pub.extbank_rec_type;
lr_response_rec apps.iby_fndcpt_common_pub.result_rec_type;
BEGIN
dbms_output.put_line('Progam start');
--lc_return_status := '';
--ln_msg_count := '';
--lc_msg_data := '';
lr_extbank_rec.bank_name := 'Bank Test';
lr_extbank_rec.bank_number := 'BT0001';
lr_extbank_rec.country_code := 'IN';
iby_ext_bankacct_pub.create_ext_bank
(
p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_ext_bank_rec => lr_extbank_rec,
x_bank_id => ln_bank_id,
x_return_status => lc_return_status,
x_msg_count => ln_msg_count,
x_msg_data => lc_msg_data,
x_response => lr_response_rec
);
dbms_output.put_line('ln_bank_id:' || ln_bank_id);
dbms_output.put_line('lc_return_status:' || lc_return_status);
l_output := ' ';
IF
( lc_return_status <> 'S' )
THEN
FOR i IN 1..ln_msg_count LOOP
apps.fnd_msg_pub.get(i,apps.fnd_api.g_false,lc_msg_data,lc_msg_dummy);
l_output := l_output || ( TO_CHAR(i) || ': ' || substr(lc_msg_data,1,250) );
END LOOP;
dbms_output.put_line('l_output:' || l_output);
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line('Main Exception Error:'||sqlerrm);
END;
/
Script Output
-------------------------------------
Progam start
ln_bank_id:12182101
lc_return_status:S
Query to Check
-------------------------------------
select * from CE_BANKS_V WHERE BANK_PARTY_ID=12182101
select * FROM iby_ext_banks_v WHERE BANK_PARTY_ID=12182101
Subscribe to:
Posts (Atom)