Tuesday 2 February 2021

API to update supplier payment method in r12

API to update supplier payment method in r12

Hi friends, we are going to discuss about the api to update supplier payment method in r12. We will share the detail plsql script to update the supplier payment methods in oracle r12. We have the standard api in oracle apps r12 to maintain and update the supplier payment method details. We are using this api in our plsql script to update the supplier payment method in oracle r12. This is one of the most useful script while working on oracle r12 projects. We need to use this api script to update supplier details in r12. Please find below the complete detail about the API to update supplier payment method in r12.

API to update supplier payment method in r12
API to update supplier payment method in r12

Important API to update supplier payment method in r12

iby_disbursement_setup_pub.update_external_payee

API to update supplier payment method in r12
API to update supplier payment method in r12


Detail PLSQL API to update supplier payment method in r12

Here below is the complete script using the api to update the payment method of suppliers in oracle apps r12. You just need to use this , to make the changes in the supplier payment method.

API to update supplier payment method in r12
API to update supplier payment method in r12

DECLARE
   x_return_status             VARCHAR2 (200) := NULL;
   x_msg_count                 NUMBER :=0;
   x_msg_data                  VARCHAR2 (200) := NULL;
   l_payee_upd_status          iby_disbursement_setup_pub.ext_payee_update_tab_type;
   p_external_payee_tab_type   iby_disbursement_setup_pub.external_payee_tab_type;
   p_ext_payee_id_tab_type     iby_disbursement_setup_pub.ext_payee_id_tab_type;
   p_ext_payee_id_rec          iby_disbursement_setup_pub.Ext_Payee_ID_Rec_Type;
   l_ext_payee_rec             IBY_DISBURSEMENT_SETUP_PUB.External_Payee_Rec_Type;

   i                           NUMBER := 0;
   g_org_id                    NUMBER := 85;
   g_user_id                   NUMBER := 3675;
   g_resp_id                   NUMBER := 20639;
   g_resp_appl_id              NUMBER := 200;
BEGIN
      fnd_global.apps_initialize (user_id        => g_user_id,
                                  resp_id        => g_resp_id,
                                  resp_appl_id   => g_resp_appl_id);

     mo_global.set_policy_context ('S',115);
     
FOR I IN C LOOP

      p_external_payee_tab_type (1).default_pmt_method := 'CHECK';
      p_external_payee_tab_type (1).payment_function := 'PAYABLES_DISB';
      p_external_payee_tab_type (1).exclusive_pay_flag := 'N';
      p_external_payee_tab_type (1).payee_party_id :=12234;
      p_external_payee_tab_type (1).Delivery_Channel:='CRDB';
      p_external_payee_tab_type (1).payer_org_id := 115;
      p_external_payee_tab_type (1).payer_org_type := 'OPERATING_UNIT';
      p_external_payee_tab_type (1).supplier_site_id :=33444;
      p_external_payee_tab_type (1).Payee_Party_Site_Id :=45555;
      p_ext_payee_id_tab_type (1).ext_payee_id :=3456;
      
      iby_disbursement_setup_pub.update_external_payee (
         p_api_version            => 1.0,
         p_init_msg_list          => 'T',
         p_ext_payee_tab          => p_external_payee_tab_type,
         p_ext_payee_id_tab       => p_ext_payee_id_tab_type,
         x_return_status          => x_return_status,
         x_msg_count              => x_msg_count,
         x_msg_data               => x_msg_data,
         x_ext_payee_status_tab   => l_payee_upd_status
      );

      COMMIT;
    --  DBMS_OUTPUT.PUT_LINE ('External Payee Update :' || j.ext_payee_id);
      DBMS_OUTPUT.PUT_LINE ('x_return_status: ' || x_return_status);

      IF x_return_status = 'E'
      THEN
         FOR k IN l_payee_upd_status.FIRST .. l_payee_upd_status.LAST
         LOOP
            DBMS_OUTPUT.put_line('Error Message from table type : '
                                 || l_payee_upd_status (k).Payee_update_Msg);
         END LOOP;
      END IF;
      COMMIT;
     END LOOP;

EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.PUT_LINE ('Error ' || SQLERRM);
END;

API to update supplier payment method in r12
API to update supplier payment method in r12

1 comments:

sujini said...

declare
v_status varchar2(1);
v_error_message varchar2(2000);
v_vendor_id number;
v_email_address varchar2(30);
v_employee_id number;
v_vendor_site_id number;
v_party_id number;
v_name varchar2(100);
p_country_code VARCHAR2 (200):='US';
-- p_bank_name VARCHAR2 (200);
p_bank_number VARCHAR2 (200);
p_branch_number VARCHAR2 (200);
v_bank_id NUMBER;
v_branch_id NUMBER;
x_end_date DATE;

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;
lv_return_status varchar2(1);
lv_msg_count number;
lv_msg_data varchar2(2000);

lv_vendor_site_id ap_supplier_sites.vendor_site_id%type;
lv_vendor_site_rec AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
lv_vendor_rec AP_VENDOR_PUB_PKG.r_vendor_rec_type;
ext_payee_rec IBY_DISBURSEMENT_SETUP_PUB.EXTERNAL_PAYEE_REC_TYPE;
x_return_status VARCHAR2 (200) := NULL;
x_msg_count NUMBER := 0;
x_msg_data VARCHAR2 (200) := NULL;
t_output VARCHAR2 (200) := NULL;
t_msg_dummy VARCHAR2 (200) := NULL;
l_payee_upd_status iby_disbursement_setup_pub.ext_payee_update_tab_type;
p_external_payee_tab_type iby_disbursement_setup_pub.external_payee_tab_type;
p_ext_payee_id_tab_type iby_disbursement_setup_pub.ext_payee_id_tab_type;
p_ext_payee_id_rec iby_disbursement_setup_pub.Ext_Payee_ID_Rec_Type;
l_ext_payee_rec IBY_DISBURSEMENT_SETUP_PUB.External_Payee_Rec_Type;
p_contact_point_rec HZ_CONTACT_POINT_V2PUB.CONTACT_POINT_REC_TYPE;
p_edi_rec HZ_CONTACT_POINT_V2PUB.EDI_REC_TYPE;
p_email_rec HZ_CONTACT_POINT_V2PUB.EMAIL_REC_TYPE;
p_phone_rec HZ_CONTACT_POINT_V2PUB.PHONE_REC_TYPE;
p_telex_rec HZ_CONTACT_POINT_V2PUB.TELEX_REC_TYPE;
p_web_rec HZ_CONTACT_POINT_V2PUB.WEB_REC_TYPE;
x_contact_point_id NUMBER;
i NUMBER := 0;
v_email varchar2(10):='EMAIL';

begin
FOR j
IN (SELECT ieppm.payment_method_code,
iepa.payee_party_id,
iepa.ext_payee_id,
iepa.remit_advice_email,
iepa.supplier_site_id
FROM ap_suppliers sup,
iby_external_payees_all iepa,
iby_ext_party_pmt_mthds ieppm
WHERE iepa.payee_party_id = sup.party_id
and iepa.ext_payee_id = ieppm.ext_pmt_party_id(+)
AND sup.segment1='392905'
and supplier_site_id is null)
LOOP
fnd_global.apps_initialize (fnd_global.user_id,fnd_global.RESP_ID,fnd_global.RESP_APPL_ID);
MO_GLOBAL.INIT('SQLAP');

dbms_output.put_line('Step1');
p_external_payee_tab_type (i).default_pmt_method := 'WIRE';
p_external_payee_tab_type (i).payment_function := 'PAYABLES_DISB';
p_external_payee_tab_type (i).exclusive_pay_flag := 'N';
p_external_payee_tab_type (i).payee_party_id := j.payee_party_id;
p_external_payee_tab_type (i).payer_org_id := null;
p_external_payee_tab_type (i).payer_org_type := 'OPERATING_UNIT';
p_ext_payee_id_tab_type (i).ext_payee_id := j.ext_payee_id;
p_external_payee_tab_type (i).remit_advice_email :='Supplier_Test351@gmail.com';
dbms_output.put_line('Step2');
iby_disbursement_setup_pub.update_external_payee (
p_api_version => 1.0,
p_init_msg_list => 'T',
p_ext_payee_tab => p_external_payee_tab_type,
p_ext_payee_id_tab => p_ext_payee_id_tab_type,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_ext_payee_status_tab => l_payee_upd_status
);
dbms_output.put_line('Step3');
COMMIT;
DBMS_OUTPUT.PUT_LINE ('External Payee Update :' || j.ext_payee_id);
DBMS_OUTPUT.PUT_LINE ('x_return_status: ' || x_return_status);
IF x_return_status = 'E'
THEN
FOR k IN l_payee_upd_status.FIRST .. l_payee_upd_status.LAST
LOOP
DBMS_OUTPUT.put_line('Error Message from table type : '|| l_payee_upd_status (k).Payee_update_Msg);
END LOOP;
END IF;
i := 0;
Commit;

END LOOP;
end;
/

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *