Saturday 30 January 2021

How to update payment_method_lookup_code in r12

How to update payment_method_lookup_code in r12

Hi friends, we are going to discuss about the how to update payment_method_lookup_code in r12. We will share the detail steps with complete script to update the payment method in oracle apps r12. We will share the real time working example to update the supplier payment method lookup codes in oracle apps r12. This is one of the most important plsql script for supplier data maintenance. Using this script we can update supplier IBY payment attributes in oracle apps. We have standard API to update and maintain the supplier payment attributes in oracle apps r12. We will be use this API in the plsql script for update supplier payment_method_lookup_code in r12. This script will target to update and maintain the Supplier Payment attributes page under supplier maintenance in oracle apps r12. Please find below the complete detail about how to update payment_method_lookup_code in r12.

How to update payment_method_lookup_code in r12
How to update payment_method_lookup_code in r12


API to update the Supplier Payment Method Code in Oracle R12

 iby_disbursement_setup_pub.update_external_payee

Detail PLSQL script to update the payment_method_lookup_code in r12

Here below is the shared detail plsql script to update the supplier iby payment attributes under supplier master in oracle apps r12.
DECLARE
CURSOR C IS 
select distinct 
ppm.payment_method_code,
ppm.primary_flag,
epa.default_payment_method_code,
epa.payment_function,
epa.exclusive_payment_flag,
epa.payee_party_id,
epa.org_type ,
epa.org_id,
epa.supplier_site_id,
epa.Party_Site_Id,
epa.ext_payee_id
from apps.ap_suppliers a2,apps.ap_supplier_sites_all apss,apps.iby_external_payees_all epa,apps.iby_ext_party_pmt_mthds ppm
where 1=1
and a2.vendor_id=apss.vendor_id
and apss.vendor_site_id = epa.supplier_site_id
and epa.ext_payee_id  = ppm.ext_pmt_party_id
  AND apss.inactive_date    IS NULL
   AND a2.end_date_active IS NULL
   AND ppm.inactive_date   IS NULL
   AND epa.inactive_date   IS NULL
   AND ppm.payment_method_code='CHECK'
   AND APSS.ORG_ID=85
   AND NVL(A2.VENDOR_TYPE_LOOKUP_CODE,'RR') not in ('EMPLOYEE')
   AND NVL(EPA.DELIVERY_CHANNEL_CODE,'YY') NOT IN ('CRDB')
  -- AND epa.supplier_site_id='256490'
   ORDER BY 2;
   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 := 362275;
   g_resp_id                   NUMBER := 2062239;
   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',105);
     
FOR I IN C LOOP

      p_external_payee_tab_type (1).default_pmt_method := 'WIRE';
      p_external_payee_tab_type (1).payment_function := 'PAYABLES_DISB';
      p_external_payee_tab_type (1).payer_org_id := 105;
      p_external_payee_tab_type (1).exclusive_pay_flag := 'Y';
      p_external_payee_tab_type (1).payee_party_id :=I.payee_party_id;
      p_external_payee_tab_type (1).Delivery_Channel:='TBDB';
      p_external_payee_tab_type (1).payer_org_type := 'OPERATING_UNIT';
      p_external_payee_tab_type (1).supplier_site_id :=I.supplier_site_id;
      p_external_payee_tab_type (1).Payee_Party_Site_Id :=I.Party_Site_Id;
      p_ext_payee_id_tab_type (1).ext_payee_id :=I.ext_payee_id;
      
      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);
      
     INSERT INTO  XX_SUP_PMETHD_RSL VALUES (I.supplier_site_id,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: '
                                 || 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;

How to update payment_method_lookup_code in r12
How to update payment_method_lookup_code in r12


0 comments:

Post a Comment

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

Name

Email *

Message *