Tuesday, June 2, 2015

API to Create Internal Bank Account Uses in Oracle Apps R12 (CE_BANK_PUB.CREATE_BANK_ACCT_USE)

 

 

 

 

 

 

Script:

 

DECLARE

  p_init_msg_list    VARCHAR2(200);

  p_acct_use_rec     apps.ce_bank_pub.bankacct_use_rec_type;

  x_acct_use_id      NUMBER;

  x_return_status    VARCHAR2(200);

  x_msg_count        NUMBER;

  x_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

  -- Initialize apps session

  fnd_global.apps_initialize(1234, 50833, 200);

  mo_global.init('SQLAP');

  fnd_client_info.set_org_context(101);

 

  -- Input Values

  -- SELECT bank_account_id from CE_BANK_ACCOUNTS

  lv_bank_account_id := '13029';

 

  -- SELECT org_id from HR_OPERATING_UNITS

  lv_used_org_id := '101';

 

  -- required, valid values: LE, OU, BG

  lv_org_type    := 'OU';

  lv_ar_use_flag := 'Y';

  lv_ap_use_flag := 'Y';

 

  -- required for AP and AR use

  -- SELECT asset_code_combination_id from CE_BANK_ACCOUNTS

  -- WHERE bank_account_name = 'TEST'

  lv_asset_ccid := 14944;

 

  -- Assign API parameters

  p_init_msg_list                          := fnd_api.g_true;

  p_acct_use_rec.bank_acct_use_id          := NULL;

  p_acct_use_rec.bank_account_id           := lv_bank_account_id;

  p_acct_use_rec.org_type                  := lv_org_type;

  p_acct_use_rec.primary_flag              := NULL;

  p_acct_use_rec.org_id                    := lv_used_org_id;

  p_acct_use_rec.org_party_id              := NULL;

  p_acct_use_rec.ap_use_enable_flag        := lv_ap_use_flag;

  p_acct_use_rec.ar_use_enable_flag        := lv_ar_use_flag;

  p_acct_use_rec.asset_code_combination_id := lv_asset_ccid;

  -- NOT NULL COLUMNS

  p_acct_use_rec.authorized_flag             := 'Y';

  p_acct_use_rec.default_account_flag        := 'N';

  p_acct_use_rec.xtr_use_enable_flag         := NULL;

  p_acct_use_rec.pay_use_enable_flag         := NULL;

  p_acct_use_rec.edisc_receivables_trx_id    := NULL;

  p_acct_use_rec.unedisc_receivables_trx_id  := NULL;

  p_acct_use_rec.end_date                    := NULL;

  p_acct_use_rec.br_std_receivables_trx_id   := NULL;

 

  -- required if org_type is LE

  p_acct_use_rec.legal_entity_id             := NULL;

 

  p_acct_use_rec.investment_limit_code       := NULL;

  p_acct_use_rec.funding_limit_code          := NULL;

  p_acct_use_rec.ap_default_settlement_flag  := NULL;

  p_acct_use_rec.xtr_default_settlement_flag := NULL;

  p_acct_use_rec.payroll_bank_account_id     := NULL;

  p_acct_use_rec.pricing_model               := NULL;

  p_acct_use_rec.eft_script_name             := NULL;

  p_acct_use_rec.portfolio_code              := NULL;

  p_acct_use_rec.ap_asset_ccid               := NULL;

  p_acct_use_rec.ar_asset_ccid               := NULL;

  p_acct_use_rec.cash_clearing_ccid          := NULL;

  p_acct_use_rec.bank_charges_ccid           := NULL;

  p_acct_use_rec.bank_errors_ccid            := NULL;

  p_acct_use_rec.gain_code_combination_id    := NULL;

  p_acct_use_rec.loss_code_combination_id    := NULL;

  p_acct_use_rec.on_account_ccid             := NULL;

  p_acct_use_rec.unapplied_ccid              := NULL;

  p_acct_use_rec.unidentified_ccid           := NULL;

  p_acct_use_rec.factor_ccid                 := NULL;

  p_acct_use_rec.receipt_clearing_ccid       := NULL;

  p_acct_use_rec.remittance_ccid             := NULL;

  p_acct_use_rec.ar_short_term_deposit_ccid  := NULL;

  p_acct_use_rec.br_short_term_deposit_ccid  := NULL;

  p_acct_use_rec.future_dated_payment_ccid   := NULL;

  p_acct_use_rec.br_remittance_ccid          := NULL;

  p_acct_use_rec.br_factor_ccid              := NULL;

  p_acct_use_rec.bank_interest_expense_ccid  := NULL;

  p_acct_use_rec.bank_interest_income_ccid   := NULL;

  p_acct_use_rec.xtr_asset_ccid              := NULL;

  p_acct_use_rec.ar_bank_charges_ccid        := NULL;

  --7437641

 

  -- 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_acct_use_rec,

                                   x_acct_use_id   => x_acct_use_id,

                                   x_return_status => x_return_status,

                                   x_msg_count     => x_msg_count,

                                   x_msg_data      => x_msg_data);

                                  

  DBMS_OUTPUT.put_line('X_ACCT_USE_ID = ' || x_acct_use_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);

 

  IF (x_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 API call failed with error ' || l_msg);

    END LOOP;

  ELSE

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

  END IF;

END;

 

Test Results:

clip_image002

 

0 Responses to “API to Create Internal Bank Account Uses in Oracle Apps R12 (CE_BANK_PUB.CREATE_BANK_ACCT_USE)”

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.