Архив

Публикации с меткой ‘API’

OEBS API INV: Создание заказа на перемещение

Пример использования API для создания заказа на перемещение

declare 
  lx_doc_hdr    inv_move_order_pub.Trohdr_Rec_Type;
  lx_doc_lines  inv_move_order_pub.Trolin_Tbl_Type;    
  --
  lx_doc_hdr_vals   inv_move_order_pub.Trohdr_Val_Rec_Type;
  lx_doc_lines_vals inv_move_order_pub.Trolin_Val_Tbl_Type;
  lx_return_status  varchar2(1);
  lx_msg_data       varchar2(4000);
  lx_msg_count      number;
begin
  -- тип заказа на перемещение = заявка
  lx_doc_hdr.move_order_type        := inv_globals.G_MOVE_ORDER_REQUISITION;
  lx_doc_hdr.organization_id        := 1775;
  lx_doc_hdr.date_required          := sysdate;
  
  lx_doc_hdr.operation              := inv_globals.G_OPR_CREATE;
  lx_doc_hdr.header_status          := inv_globals.G_TO_STATUS_PREAPPROVED;
    
  -- создание заголовка заказа на перемещение
  inv_move_order_pub.create_move_order_header(
    p_api_version_number => 1,
    p_init_msg_list      => fnd_api.G_TRUE,
    p_return_values      => fnd_api.G_TRUE,
    p_commit             => fnd_api.G_FALSE,
    x_return_status      => lx_return_status,
    x_msg_count          => lx_msg_count,
    x_msg_data           => lx_msg_data,
    p_trohdr_rec         => lx_doc_hdr,
    p_trohdr_val_rec     => lx_doc_hdr_vals,
    x_trohdr_rec         => lx_doc_hdr,
    x_trohdr_val_rec     => lx_doc_hdr_vals
  );
  
  dbms_output.put_line('create_move_order_header='||lx_return_status);
  dbms_output.put_line('header_id='||lx_doc_hdr.header_id);

  if (lx_return_status!='S') then
    FOR j IN 1 .. lx_msg_count LOOP
      dbms_output.put_line('error('||j||')= ' ||fnd_msg_pub.get(j,fnd_api.g_false));
    END LOOP;  
  else

    lx_doc_lines(1).header_id      := lx_doc_hdr.header_id;
    
    lx_doc_lines(1).operation      := inv_globals.G_OPR_CREATE;
    lx_doc_lines(1).line_status    := inv_globals.G_TO_STATUS_PREAPPROVED;
    lx_doc_lines(1).date_required  := sysdate;       
    lx_doc_lines(1).status_date    := sysdate;
    -- 64 Перенос заказа на перемещение    
    lx_doc_lines(1).transaction_type_id := inv_globals.g_type_transfer_order_subxfr;
    --
    lx_doc_lines(1).from_subinventory_code := 'ttttttt';
    lx_doc_lines(1).organization_id        := 1775;
    lx_doc_lines(1).to_subinventory_code   := 'fffffff';      
    lx_doc_lines(1).to_organization_id     := 1775;
          
    lx_doc_lines(1).inventory_item_id      := 57878;
    lx_doc_lines(1).uom_code               := 'шт'; 
    lx_doc_lines(1).quantity               := 5;    
    
    -- создание строки заказа на перемещение
    inv_move_order_pub.create_move_order_lines(
      p_api_version_number       => 1,
      p_init_msg_list            => fnd_api.G_TRUE,
      p_return_values            => fnd_api.G_TRUE,      
      p_commit                   => fnd_api.G_FALSE,
      x_return_status            => lx_return_status,
      x_msg_count                => lx_msg_count,
      x_msg_data                 => lx_msg_data,
      p_trolin_tbl               => lx_doc_lines,
      p_trolin_val_tbl           => lx_doc_lines_vals,
      x_trolin_tbl               => lx_doc_lines,
      x_trolin_val_tbl           => lx_doc_lines_vals
    );    
    
    dbms_output.put_line('create_move_order_lines='||lx_return_status);
    if (lx_return_status!='S') then
      FOR j IN 1 .. lx_msg_count LOOP
        dbms_output.put_line('error('||j||')='||fnd_msg_pub.get(j,fnd_api.g_false));
      END LOOP;  
    else
      dbms_output.put_line('line_id='||lx_doc_lines(1).line_id);      
    end if;    

  end if;
  
end;

OEBS API BOM – Создание спецификаций через интерфейсные таблицы

11 Декабрь 2014 Нет комментариев

Описание шагов по заполнение интерфейсных таблиц для создания спецификаций (комплектов позиций).

1) Таблица BOM_BILL_OF_MTLS_INTERFACE — заголовок
список обязательных полей:

  • assembly_item_id
  • item_number
  • organization_id
  • organization_code
  • transaction_type
  • process_flag

2) Таблица BOM_INVENTORY_COMPS_INTERFACE — строки
список обязательных полей:

  • operation_seq_num
  • item_num
  • component_quantity
  • component_item_id
  • component_item_number
  • organization_id
  • organization_code
  • assembly_item_id
  • assembly_item_number
  • transaction_type
  • process_flag

Читать дальше про “OEBS API BOM – Создание спецификаций через интерфейсные таблицы” »

OEBS API INV – Удаление резервирований для позиции

10 Декабрь 2014 Нет комментариев

Пример использования API для удаления резервирований позиции:

declare
  l_rsv_rec                inv_reservation_global.mtl_reservation_rec_type;
  l_serial_number_tbl_type inv_reservation_global.serial_number_tbl_type;
  --
  lx_return_status varchar2(1);
  lx_msg_data      varchar2(4000);
  lx_msg_count     number;
begin
  fnd_global.apps_initialize(-1, 20634, 401); --Запасы - Запасы
  for i_cur in (select * from mtl_reservations t
                where 1=1
                      and rownum=1
                      -- and ...
           )
  loop
    l_rsv_rec.reservation_id               := i_cur.reservation_id;
    l_rsv_rec.organization_id              := i_cur.organization_id;          
    l_rsv_rec.inventory_item_id            := i_cur.inventory_item_id;
    l_rsv_rec.demand_source_type_id        := i_cur.demand_source_type_id; 
    l_rsv_rec.demand_source_header_id      := i_cur.demand_source_header_id; 
    l_rsv_rec.demand_source_line_id        := i_cur.demand_source_line_id;  
    l_rsv_rec.primary_uom_code             := i_cur.primary_uom_code;    
    l_rsv_rec.reservation_uom_code         := i_cur.reservation_uom_code;       
  -- l_rsv_rec.reservation_quantity         := 1;--i_cur.reservation_quantity;     
  -- l_rsv_rec.primary_reservation_quantity := 1;--i_cur.primary_reservation_quantity;
    l_rsv_rec.supply_source_type_id        := i_cur.supply_source_type_id;
        
    inv_reservation_pub.delete_reservation(p_api_version_number => 1.0
                                          ,p_rsv_rec            => l_rsv_rec
                                          ,p_serial_number      => l_serial_number_tbl_type
                                          ,x_return_status      => lx_return_status
                                          ,x_msg_count          => lx_msg_count 
                                          ,x_msg_data           => lx_msg_data
                                          );
                                          
    dbms_output.put_line(lx_return_status);   
    if (lx_return_status <> 'S') then    
      fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,                               
                                p_count   => lx_msg_count,                               
                                p_data    => lx_msg_data);       
      dbms_output.put_line('ERROR delete_reservation for reservation_id ='
                           ||l_rsv_rec.reservation_id ||':');       
      if lx_msg_count = 1 then      
        dbms_output.put_line(lx_msg_data);    
      else      
        FOR i IN 1 .. lx_msg_count 
        LOOP         
          dbms_output.put_line(fnd_msg_pub.get(fnd_msg_pub.g_next,fnd_api.g_false));
        END LOOP;     
      end if; 
    end if;
    commit;        
  end loop;                                  
                                          
end;

OEBS API INV – Текущее количество для позиции (ONHAND)

10 Декабрь 2014 Нет комментариев

Пример использования API для получения текущего или доступного для резервирования количества для позиции:


declare
  p_organization_id   NUMBER := 155;
  p_inventory_item_id NUMBER := 546;
  --
  p_revision          VARCHAR2(3);
  p_lot_number        VARCHAR2(80);
  p_subinventory_code VARCHAR2(10) := 'VAlVALVAL';
  p_locator_id        NUMBER;  
  --
  lx_qoh    NUMBER; -- Total Quantity (Onhand)
  lx_rqoh   NUMBER;
  lx_qr     NUMBER;
  lx_qs     NUMBER;
  lx_att    NUMBER; -- Available to Transact
  lx_atr    NUMBER; -- Available to Reserve
  --
  lx_return_status VARCHAR2(1);
  lx_msg_count     NUMBER;
  lx_msg_data      VARCHAR2(4000);
begin
  inv_quantity_tree_grp.clear_quantity_cache;
  inv_quantity_tree_pub.query_quantities(
        p_api_version_number         => 1.0,
        p_init_msg_lst               => fnd_api.g_false,
        x_return_status              => lx_return_status,
        x_msg_count                  => lx_msg_count,
        x_msg_data                   => lx_msg_data,
        --
        p_organization_id            => p_organization_id,
        p_inventory_item_id          => p_inventory_item_id,
        p_tree_mode                  => apps.inv_quantity_tree_pub.g_transaction_mode,
        p_is_revision_control        => case when p_revision is null   then FALSE else TRUE end,
        p_is_lot_control             => case when p_lot_number is null then FALSE else TRUE end,
        p_is_serial_control          => FALSE,
                                         
        p_revision                   => p_revision,
        p_lot_number                 => p_lot_number,
        p_subinventory_code          => p_subinventory_code,
        p_locator_id                 => p_locator_id,
                                         
        x_qoh                        => lx_qoh,  -- OnHand Quantity
        x_rqoh                       => lx_rqoh,
        x_qr                         => lx_qr,
        x_qs                         => lx_qs,
        x_att                        => lx_att, -- Available To Transact
        x_atr                        => lx_atr  -- Available To Reserve
                                        );
   if lx_return_status ='S' then
     DBMS_OUTPUT.put_line ('Общее количество: ' || lx_qoh);
     DBMS_OUTPUT.put_line ('Доступно для резервирования: ' || lx_atr);
     DBMS_OUTPUT.put_line ('Доступно для транзакции: ' || lx_att);
   else
    fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
                              p_count   => lx_msg_count,
                              p_data    => lx_msg_data);
 
    dbms_output.put_line('ERROR for p_inventory_item_id='||p_inventory_item_id);
 
    if lx_msg_count = 1 then
      dbms_output.put_line(lx_msg_data);
    else
      FOR i IN 1 .. lx_msg_count LOOP
        dbms_output.put_line(fnd_msg_pub.get(fnd_msg_pub.g_next,
                                             fnd_api.g_false));
      END LOOP;
    end if;
  end if;   
                                           
end;

Так же есть запрос для просмотра текущего количества Модуль INV – Текущее количество для позиции

OEBS API: Деактивация контрагента в HZ_PAPTIES (тип person)

6 Октябрь 2014 Нет комментариев

Пример использования API для перевода контрагента (таблица HZ_PAPTIES) с типом “PERSON” в статус “Неактивно”:

declare
  p_party_id      number := 17323325;
  --
  l_person_rec  HZ_PARTY_V2PUB.PERSON_REC_TYPE;
  l_party_rec   HZ_PARTY_V2PUB.PARTY_REC_TYPE;
  l_object_version_number number;
  --
  x_profile_id    NUMBER;
  x_return_status VARCHAR2(1);
  x_msg_count     NUMBER;
  x_msg_data      VARCHAR2(4000);  
begin
  
  fnd_global.apps_initialize(-1, 20639, 200); --Диспетчер кредиторов - Кредиторы
 
  l_party_rec.party_id   := p_party_id;
  l_party_rec.status     := 'I';
  
  l_person_rec.party_rec := l_party_rec;
 
  select hp.object_version_number into l_object_version_number
  from hz_parties hp where hp.party_id = l_party_rec.party_id;
  
  hz_party_v2pub.update_person (
      p_init_msg_list                    => fnd_api.g_false,
      p_person_rec                       => l_person_rec,
      p_party_object_version_number      => l_object_version_number,
      x_profile_id                       => x_profile_id,
      x_return_status                    => x_return_status,
      x_msg_count                        => x_msg_count,
      x_msg_data                         => x_msg_data
      );
      
  dbms_output.put_line(x_return_status);
  if (x_return_status <> 'S') then
    fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
                              p_count   => x_msg_count,
                              p_data    => x_msg_data);
 
    dbms_output.put_line('ERROR update for party_id='||l_party_rec.party_id||':');
 
    if x_msg_count = 1 then
      dbms_output.put_line(x_msg_data);
    else
      FOR i IN 1 .. x_msg_count LOOP
        dbms_output.put_line(fnd_msg_pub.get(fnd_msg_pub.g_next,
                                             fnd_api.g_false));
      END LOOP;
    end if;
  end if;
 
  commit;      
end;

OEBS API: Деактивация контрагента в HZ_PAPTIES (тип organization)

6 Октябрь 2014 Нет комментариев

Пример использования API для перевода контрагента (таблица HZ_PAPTIES) с типом «organization» в статус “Неактивно”:

declare
  p_party_id      number := 2661479911;
  --  
  l_organization_rec  HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;
  l_party_rec         HZ_PARTY_V2PUB.PARTY_REC_TYPE;
  l_object_version_number number;
  --
  x_profile_id    NUMBER;  
  x_return_status VARCHAR2(1);
  x_msg_count     NUMBER;
  x_msg_data      VARCHAR2(4000);  
begin
  
  fnd_global.apps_initialize(-1, 20639, 200); --Диспетчер кредиторов - Кредиторы

  l_party_rec.party_id  := p_party_id;
  l_party_rec.status    := 'I';
  l_organization_rec.party_rec := l_party_rec;
  
  select hp.object_version_number into l_object_version_number 
  from hz_parties hp where hp.party_id = l_party_rec.party_id;
    
  HZ_PARTY_V2PUB.update_organization(p_init_msg_list               => fnd_api.g_false,
                                     p_organization_rec            => l_organization_rec,
                                     p_party_object_version_number => l_object_version_number,
                                     x_profile_id                  => x_profile_id,
                                     x_return_status               => x_return_status,
                                     x_msg_count                   => x_msg_count,
                                     x_msg_data                    => x_msg_data);
      
  dbms_output.put_line(x_return_status);
  if (x_return_status <> 'S') then
    fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
                              p_count   => x_msg_count,
                              p_data    => x_msg_data);
                                      
    dbms_output.put_line('ERROR update for party_id='||l_party_rec.party_id||':');
     
    if x_msg_count = 1 then
      dbms_output.put_line(x_msg_data);
    else
      FOR i IN 1 .. x_msg_count LOOP
        dbms_output.put_line(fnd_msg_pub.get(fnd_msg_pub.g_next,
                                             fnd_api.g_false));
      END LOOP;
    end if;
  end if;
  
  commit;
                             
end;


OEBS API: Деактивация счета заказчика

1 Октябрь 2014 Нет комментариев

Пример использования API для перевода счета заказчика в статус «Неактивно» — деактивация счета заказчика.

declare
  l_cust_account_rec hz_cust_account_v2pub.cust_account_rec_type;
  l_object_version_number number;
  --
  x_return_status varchar2(1);
  x_msg_data      varchar2(4000);
  x_msg_count     number;
begin
  l_cust_account_rec := null;
  l_cust_account_rec.cust_account_id := 9787987;
  l_cust_account_rec.status := 'I';
  
  select ca.object_version_number into l_object_version_number 
  from hz_cust_accounts ca 
  where cust_account_id = l_cust_account_rec.cust_account_id;
  -- Call the procedure
  hz_cust_account_v2pub.update_cust_account(p_init_msg_list         => 'T',
                                            p_cust_account_rec      => l_cust_account_rec,
                                            p_object_version_number => l_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('x_return_status='||x_return_status);   
  commit;                                         
end;

API Модуль AP: Отмена счет-фактуры

Пример использования API для отмены счет-фактуры

declare
  l_result               BOOLEAN;
  l_all_count            NUMBER := 0;
  l_not_cancel_count     NUMBER := 0;
  l_error_count          NUMBER := 0;  
  l_successful_count     NUMBER := 0;    
  --
  lx_error_code  VARCHAR2(100);
  lx_debug_info  VARCHAR2(400);
  --
  lx_message_name                VARCHAR2(400);
  lx_invoice_amount              NUMBER;
  lx_base_amount                 NUMBER;
  lx_temp_cancelled_amount       NUMBER;
  lx_cancelled_by                NUMBER;
  lx_cancelled_amount            NUMBER;
  lx_cancelled_date              DATE;
  lx_last_update_date            DATE;
  lx_original_prepayment_amount  NUMBER;
  lx_pay_curr_invoice_amount     NUMBER;
  lx_token                       VARCHAR2(400);    
begin
  fnd_global.apps_initialize(-1, 20639, 200); --Диспетчер кредиторов - Кредиторы
  mo_global.init('SQLAP');
  
  for i in (select i.invoice_id, i.invoice_num
            from ap_invoices_all i
            where 1=1
                  ...
                  --and rownum<=5
            )
  loop
    l_all_count := l_all_count + 1;
    l_result :=ap_cancel_pkg.is_invoice_cancellable( p_invoice_id       => i.invoice_id,
                                                     p_error_code       => lx_error_code,   
                                                     p_debug_info       => lx_debug_info,
                                                     p_calling_sequence => NULL
                                                   );
    if NOT l_result then
      l_not_cancel_count:= l_not_cancel_count+ 1;
      dbms_output.put_line ('Invoice '||i.invoice_num||' is not cancellable' );
      continue;
    end if;
          
    l_result := ap_cancel_pkg.ap_cancel_single_invoice(
        p_invoice_id                 => i.invoice_id,
        p_last_updated_by            => fnd_global.user_id,
        p_last_update_login          => fnd_global.login_id,
        p_accounting_date            => sysdate,
        p_message_name               => lx_message_name,
        p_invoice_amount             => lx_invoice_amount,
        p_base_amount                => lx_base_amount,
        p_temp_cancelled_amount      => lx_temp_cancelled_amount,
        p_cancelled_by               => lx_cancelled_by,
        p_cancelled_amount           => lx_cancelled_amount,
        p_cancelled_date             => lx_cancelled_date,
        p_last_update_date           => lx_last_update_date,
        p_original_prepayment_amount => lx_original_prepayment_amount,
        p_pay_curr_invoice_amount    => lx_pay_curr_invoice_amount,
        p_token                      => lx_token,
        p_calling_sequence           => NULL
                                                     );
    if NOT l_result  then
      l_error_count := l_error_count + 1;
      dbms_output.put_line('Error for invoice '||i.invoice_num||':'||lx_message_name);
      continue;
    else
      dbms_output.put_line('Successfully cancelled the invoice '||i.invoice_num );
      l_successful_count := l_successful_count + 1;
    end if;   

  end loop;
  
  commit;
  
  dbms_output.put_line('');
  dbms_output.put_line('----------------------------------------');
  dbms_output.put_line('Total info:');
  dbms_output.put_line('----------------------------------------');  
  dbms_output.put_line('         ALL COUNT = '||l_all_count);
  dbms_output.put_line('IS NOT CANCELLABLE = '||l_not_cancel_count);  
  dbms_output.put_line('       ERROR COUNT = '||l_error_count);  
  dbms_output.put_line('  SUCCESSFUL COUNT = '||l_successful_count);  
  dbms_output.put_line('----------------------------------------');

end;

OEBS API: Добавляем счет на отделение поставщика

Скрипт добавления(назначения) счета на отделение заказчика.
В данном примере счета копируются из одного отделения в другое.

DECLARE
  p_org_id_from number := 111; 
  p_org_id_to   number := 112; 
  --
  l_payee_rec      iby_disbursement_setup_pub.payeecontext_rec_type;
  l_pay_instr_rec  iby_fndcpt_setup_pub.pmtinstrument_rec_type;  
  l_pay_assign_rec iby_fndcpt_setup_pub.pmtinstrassignment_rec_type;
  --
  x_assign_id           NUMBER;
  x_return_status       VARCHAR2(1);
  x_msg_count           NUMBER;
  x_msg_data            VARCHAR2(4000);
  x_response            apps.iby_fndcpt_common_pub.result_rec_type;  
BEGIN
  FND_MSG_PUB.initialize;
 
  fnd_global.apps_initialize(-1, 20639, 200); --Диспетчер кредиторов - Кредиторы
  
  for i in (
            SELECT sup.vendor_type_lookup_code
                 , sup.vendor_id
                 , ss.party_site_id
                 , ss2.party_site_id  party_site_id_to
                 , ss.vendor_site_id  vendor_site_id_from
                 , ss2.vendor_site_id vendor_site_id_to
                 , sup.party_id
                 , sup.segment1
                 , sup.vendor_name
                 , epa.org_id
                 , ss.vendor_site_code
                 , piu.order_of_preference priority
                 , eba.ext_bank_account_id
                 , eba.bank_id
                 , eba.branch_id
                 , eba.country_code
                 , eba.bank_account_name
                 , eba.bank_account_num
                 , eba.currency_code
                 , eba.foreign_payment_use_flag
                 , eba.payment_factor_flag
              FROM apps.ap_suppliers sup
                 , apps.ap_supplier_sites_all   ss
                 , apps.ap_supplier_sites_all   ss2
                 , apps.iby_external_payees_all epa
                 , apps.iby_pmt_instr_uses_all  piu
                 , apps.iby_ext_bank_accounts   eba
             WHERE sup.vendor_id     = ss.vendor_id
               AND ss.vendor_site_id = epa.supplier_site_id
               and ss2.vendor_id        = sup.vendor_id  
               and ss2.vendor_site_code = ss.vendor_site_code
               and ss2.org_id           = p_org_id_to
               AND epa.ext_payee_id  = piu.ext_pmt_party_id
               AND piu.instrument_id = eba.ext_bank_account_id
               AND epa.org_id    = p_org_id_from
               and not exists (select 1 
                               from apps.iby_external_payees_all epa1
                                  , apps.iby_pmt_instr_uses_all  piu1
                                  , apps.iby_ext_bank_accounts   eba1
                               where 1=1
                                     and epa1.supplier_site_id = ss2.vendor_site_id
                                     and epa1.ext_payee_id     = piu1.ext_pmt_party_id
                                     and piu1.instrument_id    = eba1.ext_bank_account_id
                                   and eba1.ext_bank_account_id = eba.ext_bank_account_id
                              )
                        
           )
  loop
    dbms_output.put_line('sup.vendor_id='||i.vendor_id);
 
    x_response := null;
    --    
    l_payee_rec.Party_Id         := i.party_id; 
    l_payee_rec.Payment_Function := 'PAYABLES_DISB';
    l_payee_rec.Party_Site_id    := i.party_site_id_to;
    l_payee_rec.Supplier_Site_id := i.vendor_site_id_to;
    l_payee_rec.Org_Id           := p_org_id_to;
    l_payee_rec.Org_Type         := 'OPERATING_UNIT';
    
    -- Instrument Record.
    l_pay_instr_rec.Instrument_Type := 'BANKACCOUNT';
    l_pay_instr_rec.Instrument_Id   := i.ext_bank_account_id;
          
    -- Assignment Record.
    l_pay_assign_rec.Instrument := l_pay_instr_rec;
    l_pay_assign_rec.Priority   := i.priority;
    l_pay_assign_rec.Start_Date := trunc(sysdate);    
    
    iby_disbursement_setup_pub.set_payee_instr_assignment(
        p_api_version        => 1.0,
        p_init_msg_list      => 'T',
        p_commit             => 'F',
        x_return_status      => x_return_status,
        x_msg_count          => x_msg_count,
        x_msg_data           => x_msg_data,
        p_payee              => l_payee_rec,
        p_assignment_attribs => l_pay_assign_rec,
        x_assign_id          => x_assign_id,
        x_response           => x_response);    
      
    dbms_output.put_line('x_return_status='||x_return_status);
    dbms_output.put_line('out_mesg.Result_Code     ='||x_response.Result_Code);
    dbms_output.put_line('out_mesg.Result_Category ='||x_response.Result_Category);
    dbms_output.put_line('out_mesg.Result_Message  ='||x_response.Result_Message);
   
    if x_return_status <> 'S' THEN
      fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
                                p_count   => x_msg_count,
                                p_data    => x_msg_data);
   
      dbms_output.put_line(chr(10)||'x_msg_count='||x_msg_count);
      if x_msg_count = 1 then
        dbms_output.put_line(x_msg_data);
      else
        FOR j IN 1 .. x_msg_count LOOP
          dbms_output.put_line(fnd_msg_pub.get(fnd_msg_pub.g_next,
                                               fnd_api.g_false));
        END LOOP;
      end if;
    end if;
    
  end loop;
  
  commit;
end;

Доп. информацию можно прочитать в ноте How to create bank account through API and associate to multiple supplier sites. [ID 1299614.1]

OEBS API: Добавление записи в lookup

Пример использования API для добавление записи в код поиска (lookup):

declare
 lx_rowid rowid;
begin
  for i in (select 'TEST'    as lookup_code,
                   'TEST'    as meaning,
                   null      as tag,
                   'TEST'    as descr,
                   sysdate   as start_date_active,
                   null      as end_date_active
              from dual t
            )
  loop
    -- Call the procedure
    fnd_lookup_values_pkg.insert_row(x_rowid               => lx_rowid,
                                     x_lookup_type         => 'LOOKUP_TYPE_NAME',
                                     x_security_group_id   => 0,
                                     x_view_application_id => 3,
                                     x_lookup_code         => i.lookup_code,
                                     x_tag                 => i.tag,
                                     x_attribute_category  => null,
                                     x_attribute1          => null,
                                     x_attribute2          => null,
                                     x_attribute3          => null,
                                     x_attribute4          => null,
                                     x_enabled_flag        => 'Y',
                                     x_start_date_active   => i.start_date_active,
                                     x_end_date_active     => i.end_date_active,
                                     x_territory_code      => null,
                                     x_attribute5          => null,
                                     x_attribute6          => null,
                                     x_attribute7          => null,
                                     x_attribute8          => null,
                                     x_attribute9          => null,
                                     x_attribute10         => null,
                                     x_attribute11         => null,
                                     x_attribute12         => null,
                                     x_attribute13         => null,
                                     x_attribute14         => null,
                                     x_attribute15         => null,
                                     x_meaning             => i.meaning,
                                     x_description         => i.descr,
                                     x_creation_date       => sysdate,
                                     x_created_by          => -1,
                                     x_last_update_date    => sysdate,
                                     x_last_updated_by     => -1,
                                     x_last_update_login   => -1);
  end loop;   
  commit;                                  
end;
/