Friday 14 August 2020

api to create internal bank account in r12

 api to create internal bank account in r12

Hi Friends , we are going to discuss about the api to create internal bank account in r12. Internal Bank account in oracle r12 is those banks , which we used to make supplier payments and for customer receipts. In oracle r12, we have the standard api which helps to create these internal bank accounts in r12. In my earlier posts , i have share the api and the plsql script for supplier banks and bank account creation but that api we cannot use to create the internal bank accounts in r12. API helps to create the internal bank accounts we have the mass volume of the internal banks in r12. In r12, we have the separate api for internal bank account creation as compared to the supplier bank account. We will try to share the plsql code which will help to create the complete internal bank accounts details. Please find below the complete api to create internal bank account in r12 .


Complete PLSQL script using api to create internal bank account in r12

Here below is the complete code for creation of internal bank accounts but before starting going through this script we assumed that we have already create the bank and branch for the bank under which we are creating this internal bank account. 

Please arrange the Bank Id , Branch ID and Organization Id under which this bank account will be create handy.


api to create internal bank account in r12
api to create internal bank account in r12

Internal Bank Account Creation Script: 

Here below is the first API to create internal Bank Accounts.

DECLARE
   p_init_msg_list   VARCHAR2 (200);
   p_bnk_acct_rec        apps.ce_bank_pub.bankacct_rec_type;
   v_bnk_acct_id         NUMBER;
   v_return_status   VARCHAR2 (200);
   v_msg_count       NUMBER;
   v_msg_data        VARCHAR2 (200);
   p_count           NUMBER;
  
BEGIN
   p_init_msg_list := NULL;
   p_bnk_acct_rec.bank_id := 45666;
   p_bnk_acct_rec.branch_id :=45666;
   p_bnk_acct_rec.account_owner_org_id := 23273;
   p_bnk_acct_rec.account_classification := 'INTERNAL';
   p_bnk_acct_rec.currency := 'INR';
   p_bnk_acct_rec.start_date := SYSDATE;
   p_bnk_acct_rec.bank_account_name := 'Bank Account Name';
   p_bnk_acct_rec.bank_account_num := '000334433';
  
   CE_BANK_PUB.CREATE_BANK_ACCT
                  (p_init_msg_list      => p_init_msg_list,
                   p_acct_rec           => p_bnk_acct_rec,
                   x_acct_id            => v_bnk_acct_id,
                   x_return_status      => v_return_status,
                   x_msg_count          => v_msg_count,
                   x_msg_data           => v_msg_data
                  );
   DBMS_OUTPUT.put_line ('API_RETURN_STATUS = ' || v_return_status);
   DBMS_OUTPUT.put_line ('X_MSG_COUNT = ' || v_msg_count);
   DBMS_OUTPUT.put_line ('X_MSG_DATA = ' || v_msg_data);                   
   DBMS_OUTPUT.put_line ('Internal Bank Account Id = ' || v_bnk_acct_id);


   IF v_msg_count = 1
   THEN
      DBMS_OUTPUT.put_line ('Error_msg_data ' || v_msg_data);
   ELSIF v_msg_count > 1
   THEN
      LOOP
         p_count := p_count + 1;
         v_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);

         IF v_msg_data IS NULL
         THEN
            EXIT;
         END IF;

         DBMS_OUTPUT.put_line (' Error Message for Internal Bank Account API Details' || p_count || ' ---' || v_msg_data);
      END LOOP;
   END IF;
END;

api to create internal bank account in r12

api to create internal bank account in r12


Internal Bank Account Use Creation Script: 

Here below is the first API to create internal Bank Account Uses in Oracle Apps. 
We need to use the Internal Bank Account Id created in the last script of Internal Bank Account Creation.

DECLARE

  p_init_msg_list    VARCHAR2(200);

  p_bnk_acct_use_rec     apps.ce_bank_pub.bankacct_use_rec_type;

  v_acct_use_id      NUMBER;

  v_return_status    VARCHAR2(200);

v_msg_count        NUMBER;

  v_msg_data         VARCHAR2(200);

  l_msg              VARCHAR2(200);

  lv_bank_account_id NUMBER;

  lv_used_org_id     NUMBER;

  lv_org_type        VARCHAR2(10);

  lv_asset_ccid      NUMBER;

  lv_ar_use_flag     VARCHAR2(10);

  lv_ap_use_flag     VARCHAR2(10);

BEGIN

  fnd_global.apps_initialize(33422,44444,200);  --userid,respid,orgid--

  mo_global.init('SQLAP');

  fnd_client_info.set_org_context(85);

  lv_bank_account_id := '92554';

  lv_used_org_id := '85'; --operating_unit_id--

  lv_org_type    := 'OU';

  lv_ar_use_flag := 'Y';

  lv_ap_use_flag := 'Y';

  -- for AP and AR we need to provide the asset code combination id from gl_code_combinations table for the desired account'

  lv_asset_ccid := 203314;
  
  --- Assigning the Parameters---

  p_init_msg_list                          := fnd_api.g_true;

  p_bnk_acct_use_rec.bank_acct_use_id          := NULL;

  p_bnk_acct_use_rec.bank_account_id           := lv_bank_account_id;

  p_bnk_acct_use_rec.org_type                  := lv_org_type;

  p_bnk_acct_use_rec.primary_flag              := NULL;

  p_bnk_acct_use_rec.org_id                    := lv_used_org_id;

  p_bnk_acct_use_rec.org_party_id              := NULL;

  p_bnk_acct_use_rec.ap_use_enable_flag        := lv_ap_use_flag;

  p_bnk_acct_use_rec.ar_use_enable_flag        := lv_ar_use_flag;

  p_bnk_acct_use_rec.asset_code_combination_id := lv_asset_ccid;
  
  p_bnk_acct_use_rec.authorized_flag             := 'Y';

  p_bnk_acct_use_rec.default_account_flag        := 'N';


  -- Call the API CE_BANK_PUB.CREATE_BANK_ACCT_USE

  ce_bank_pub.create_bank_acct_use(p_init_msg_list => p_init_msg_list,

                                p_acct_use_rec  => p_bnk_acct_use_rec,

                                   x_acct_use_id   => v_acct_use_id,

                                   x_return_status => v_return_status,

                                   x_msg_count     => v_msg_count,

                                   x_msg_data      => v_msg_data);

                                  

  DBMS_OUTPUT.put_line('Bank Account Use Id' || v_acct_use_id);

  DBMS_OUTPUT.put_line('API RETURN STATUS = ' || v_return_status);

  DBMS_OUTPUT.put_line('V_MSG_COUNT = ' || v_msg_count);

  DBMS_OUTPUT.put_line('V_MSG_DATA = ' || v_msg_data);

 

  IF (V_return_status <> fnd_api.g_ret_sts_success) THEN

    FOR i IN 1 .. fnd_msg_pub.count_msg LOOP

      l_msg := fnd_msg_pub.get(p_msg_index => i,

                               p_encoded   => fnd_api.g_false);

      DBMS_OUTPUT.put_line('The BANK ACCT USE API call failed with error ' || l_msg);

    END LOOP;

  ELSE

    DBMS_OUTPUT.put_line('The BANK ACCT USE API call ended with SUCESSS status');

  END IF;

END;

0 comments:

Post a Comment

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

Name

Email *

Message *