Loading

Wednesday, June 1, 2011

API to update an Internal Bank Account in Oracle Apps R12 (CE_BANK_PUB.UPDATE_BANK_ACCT)



Below script helps you to update an Internal Bank Account in Oracle Apps R12. 
Test Instance: R12.1.1
API:  CE_BANK_PUB.UPDATE_BANK_ACCT
TABLE INVOLVED: CE_BANK_ACCOUNTS

SCRIPT:

set serveroutput on;
DECLARE
   p_init_msg_list           VARCHAR2 (200);
   p_acct_rec                apps.ce_bank_pub.bankacct_rec_type;
   p_object_version_number   NUMBER;
   x_return_status           VARCHAR2 (200);
   x_msg_count               NUMBER;
   x_msg_data                VARCHAR2 (200);
   p_count                   NUMBER;
BEGIN
   p_init_msg_list := NULL;
   p_acct_rec.bank_account_id := 41001;
   -- HZ_PARTIES.PARTY_ID BANK BRANCH
   p_acct_rec.branch_id := 8056;
   -- HZ_PARTIES.PARTY_ID BANK
   p_acct_rec.bank_id := 8042;
   -- HZ_PARTIES.PARTY_ID ORGANIZATION
   p_acct_rec.account_owner_org_id := 23273;
   -- HZ_PARTIES.PARTY_ID Person related to ABOVE ORGANIZATION
   p_acct_rec.account_owner_party_id := 2041;
   p_acct_rec.account_classification := 'INTERNAL';
   p_acct_rec.bank_account_name := 'Test Bank Accunt';
   p_acct_rec.bank_account_num := 18256889;
   p_acct_rec.currency := 'USD';
   p_acct_rec.start_date := SYSDATE;
   p_acct_rec.end_date := NULL;
   p_object_version_number := 1;
   CE_BANK_PUB.UPDATE_BANK_ACCT
           (p_init_msg_list              => p_init_msg_list,
            p_acct_rec                   => p_acct_rec,
            p_object_version_number      => p_object_version_number,
            x_return_status              => x_return_status,
            x_msg_count                  => x_msg_count,
            x_msg_data                   => x_msg_data
           );
   DBMS_OUTPUT.put_line (   'P_OBJECT_VERSION_NUMBER = '
                         || p_object_version_number
                        );
   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);

   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;
END;


0 Responses to “API to update an Internal Bank Account in Oracle Apps R12 (CE_BANK_PUB.UPDATE_BANK_ACCT)”

Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.