首页 > 其他分享 >EBS 接口创建采购订单

EBS 接口创建采购订单

时间:2024-04-08 09:01:24浏览次数:25  
标签:default 接口 订单 varchar2 lr EBS rec null id

程序包头:

CREATE OR REPLACE PACKAGE CUX_PO_DOC_IMP_PKG IS
  /* $Header: CUXPOIMPS.pls 120.1 2012/02/18 12:30:11 iven.lin ship $ */
  /*============================================================
    Copyright (C) IBM Global Business Services
                AllRights Reserved
  ==============================================================
  
  * ============================================================
  *   REQUEST NUMBER:
  *   PROGRAM NAME:   CUX_PO_DOC_IMP_PKG
  *   TYPE: PACKAGE
  *   DESCRIPTION: To import Open PO
  *
  *   HISTORY:
  *     Version Date        Author Name      Desc
  *     1.0     02/18/2012   IVEN.LIN        Draft
  *     
  *
  * ===========================================================*/

  /* =============================================
  *   REQUEST NUMBER:
  *   FUNCTION / PROCEDURE: PROCEDURE
  *   NAME:    open_po_import
  *   DESCRIPTION:
  *       Main procedure to import PO
  *   ARGUMENT:
  *       p_cux_paramN    VARCHAR2  -- 自定义数据列不属于接口表,用于扩展
  *       其它参数同表   的列含义。或者对应接口表中ID/CODE列的名称。
  *
  *   RETURN:
  *   HISTORY:
  *     Version Date        Author Name      Desc
  *     1.0     02/18/2009   IVEN.LIN        Draft
  *
  *   自定义数据列说明:
  *       p_cux_paramN 用于收集模板中没有对应的接口表字段的信息。
  *       比如接口表中存放ID或CODE列,而数据收集为名称/说明信息。可以使用自定义数据列来传递名称/说明信息。从而转换成接口需要的字段。
  *
  *       以下对程序中占用的自定义数据列说明。根据模板的不同,开发人员可相应的修改这些自定义数据列对应的信息,以及校验规则。
  * ==============================================*/
  PROCEDURE open_po_import( --Pub---------
                           p_submit_request_flag IN VARCHAR2 DEFAULT 'Y',
                           p_org_name            in varchar2 default null,
                           p_org_id              in number default null,
                           p_order_num           in varchar2 default null,
                           p_vendor_name         in varchar2 default null,
                           p_vendor_id           in number default null,
                           p_vendor_site         in varchar2 default null,
                           p_vendor_site_id      in number default null,
                           p_ship_location       in varchar2 default null,
                           p_ship_location_id    in number default null,
                           p_bill_location       in varchar2 default null,
                           p_bill_location_id    in number default null,
                           p_agent_name          in varchar2 default null,
                           p_agent_id            in number default null,
                           p_po_amount           in number default null,
                           p_tax_name            in varchar2 default null,
                           p_tax_code            in varchar2 default null,
                           p_tax_rate            in number default null,
                           p_currency_name       in varchar2 default null,
                           p_currency_code       in varchar2 default null,
                           p_line_num            in number default null,
                           p_line_type_name      in varchar2 default null,
                           p_line_type_code      in varchar2 default null,
                           p_item_code           in varchar2 default null,
                           p_item_id             in number default Null,
                           p_item_category       in varchar2 default null,
                           p_item_category_id    in number default null,
                           p_item_desc           in varchar2 default null,
                           p_uom                 in varchar2 default null,
                           p_uom_code            in varchar2 default null,
                           p_order_quantity      in number default null,
                           p_unit_price          in number default null,
                           p_need_by_date        in date default null,
                           p_payment_term        in varchar2 default null,
                           p_term_id             in number default null,
                           p_source_doc_type     in varchar2 default null,
                           p_source_doc_num      in varchar2 default null,
                           p_source_doc_line     in number default null,
                           p_ship_org            in varchar2 default null,
                           p_ship_org_id         in number default null,
                           p_error_flag          in varchar2 default null,
                           p_error_message       in varchar2 default null,
                           p_attribute1          in varchar2 default null,
                           p_attribute2          in varchar2 default null,
                           p_attribute3          in varchar2 default null,
                           p_attribute4          in varchar2 default null,
                           p_attribute5          in varchar2 default null,
                           p_attribute6          in varchar2 default null,
                           p_attribute7          in varchar2 default null,
                           p_attribute8          in varchar2 default null,
                           p_attribute9          in varchar2 default null,
                           p_attribute10         in varchar2 default null,
                           p_cux_param1          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param2          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param3          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param4          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param5          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param6          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param7          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param8          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param9          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param10         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param11         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param12         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param13         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param14         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param15         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param16         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param17         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param18         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param19         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param20         IN VARCHAR2 DEFAULT NULL);
END CUX_PO_DOC_IMP_PKG;

程序包体:

CREATE OR REPLACE PACKAGE BODY CUX_PO_DOC_IMP_PKG IS
  /* $Header: CUXPOIMPS.pls 120.1 2009/02/18 12:30:11 iven.lin ship $ */
  g_session_id          NUMBER := fnd_global.session_id;
  g_request_id          NUMBER;
  g_interface_header_id Number := -1;
  g_order_num           Varchar2(40) := '-1';
  g_org_id              Number := -1;
  g_vendor_id           Number := -1;
  g_vendor_site_id      Number := -1;
  /* =============================================
  *   REQUEST NUMBER:
  *   FUNCTION / PROCEDURE: PROCEDURE
  *   NAME:    open_po_import
  *   DESCRIPTION:
  *       导入采购订单
  *   ARGUMENT:
  *
  *   RETURN:
  *   HISTORY:
  *     Version Date        Author Name      Desc
  *     1.0     02/18/2009    IVEN.LIN       Draft
  *
  * ==============================================*/
  PROCEDURE open_po_import( --Pub---------
                           p_submit_request_flag IN VARCHAR2 DEFAULT 'Y',
                           p_org_name            in varchar2 default null,
                           p_org_id              in number default null,
                           p_order_num           in varchar2 default null,
                           p_vendor_name         in varchar2 default null,
                           p_vendor_id           in number default null,
                           p_vendor_site         in varchar2 default null,
                           p_vendor_site_id      in number default null,
                           p_ship_location       in varchar2 default null,
                           p_ship_location_id    in number default null,
                           p_bill_location       in varchar2 default null,
                           p_bill_location_id    in number default null,
                           p_agent_name          in varchar2 default null,
                           p_agent_id            in number default null,
                           p_po_amount           in number default null,
                           p_tax_name            in varchar2 default null,
                           p_tax_code            in varchar2 default null,
                           p_tax_rate            in number default null,
                           p_currency_name       in varchar2 default null,
                           p_currency_code       in varchar2 default null,
                           p_line_num            in number default null,
                           p_line_type_name      in varchar2 default null,
                           p_line_type_code      in varchar2 default null,
                           p_item_code           in varchar2 default null,
                           p_item_id             in number default Null,
                           p_item_category       in varchar2 default null,
                           p_item_category_id    in number default null,
                           p_item_desc           in varchar2 default null,
                           p_uom                 in varchar2 default null,
                           p_uom_code            in varchar2 default null,
                           p_order_quantity      in number default null,
                           p_unit_price          in number default null,
                           p_need_by_date        in date default null,
                           p_payment_term        in varchar2 default null,
                           p_term_id             in number default null,
                           p_source_doc_type     in varchar2 default null,
                           p_source_doc_num      in varchar2 default null,
                           p_source_doc_line     in number default null,
                           p_ship_org            in varchar2 default null,
                           p_ship_org_id         in number default null,
                           p_error_flag          in varchar2 default null,
                           p_error_message       in varchar2 default null,
                           p_attribute1          in varchar2 default null,
                           p_attribute2          in varchar2 default null,
                           p_attribute3          in varchar2 default null,
                           p_attribute4          in varchar2 default null,
                           p_attribute5          in varchar2 default null,
                           p_attribute6          in varchar2 default null,
                           p_attribute7          in varchar2 default null,
                           p_attribute8          in varchar2 default null,
                           p_attribute9          in varchar2 default null,
                           p_attribute10         in varchar2 default null,
                           p_cux_param1          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param2          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param3          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param4          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param5          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param6          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param7          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param8          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param9          IN VARCHAR2 DEFAULT NULL,
                           p_cux_param10         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param11         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param12         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param13         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param14         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param15         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param16         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param17         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param18         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param19         IN VARCHAR2 DEFAULT NULL,
                           p_cux_param20         IN VARCHAR2 DEFAULT NULL) IS
    lv_err_msg VARCHAR2(2000); --返回错误信息
    lv_status  VARCHAR2(30); --处理状态
    ln_user_id NUMBER := fnd_global.user_id;
  
    lr_ph_rec po_headers_interface%ROWTYPE;
    lr_pl_rec po_lines_interface%ROWTYPE;
    lr_pd_rec po_distributions_interface%ROWTYPE;
  
    lb_ph_existed_flag BOOLEAN := FALSE;
    lb_pl_existed_flag BOOLEAN := FALSE;
    lb_pd_existed_flag BOOLEAN := FALSE;
    lb_expense_acct_id Number;
  
    ln_cnt NUMBER := 0;
    -- < This part of the code should be added for Bug>------------------------
    msgdata       VARCHAR2(32000);
    msgname       VARCHAR2(30);
    msgapp        VARCHAR2(50);
    msgencoded    VARCHAR2(32100);
    msgencodedlen NUMBER(6);
    msgnameloc    NUMBER(6);
    msgtextloc    NUMBER(6);
  BEGIN
    lv_status  := NULL;
    lv_err_msg := NULL;
    lr_ph_rec  := NULL;
    lr_pl_rec  := NULL;
    lr_pd_rec  := NULL;
  
    /*-- Step 1: Validate the records ---------------------------------------------*/
    --Init variables
  
    --po_headers_interface
    lr_ph_rec.interface_source_code := 'PO';
    lr_ph_rec.document_type_code    := 'STANDARD';
    lr_ph_rec.document_num          := p_order_num;
    lr_ph_rec.process_code          := 'PENDING';
    lr_ph_rec.approval_status       := 'APPROVED';
    lr_ph_rec.action                := 'ORIGINAL';
    lr_ph_rec.currency_code         := p_currency_code;
    lr_ph_rec.agent_id              := p_agent_id;
    lr_ph_rec.vendor_id             := p_vendor_id;
    lr_ph_rec.vendor_site_id        := p_vendor_site_id;
    lr_ph_rec.ship_to_location_id   := p_ship_location_id;
    lr_ph_rec.bill_to_location_id   := p_bill_location_id;
    lr_ph_rec.terms_id              := p_term_id;
    lr_ph_rec.creation_date         := SYSDATE;
    lr_ph_rec.created_by            := ln_user_id;
    lr_ph_rec.last_update_date      := Sysdate;
    lr_ph_rec.Last_Updated_By       := ln_user_id;
    lr_ph_rec.org_id                := p_org_id;
  
    --po_lines_interface
    lr_pl_rec.action              := 'ORIGINAL';
    lr_pl_rec.line_num            := p_line_num;
    lr_pl_rec.shipment_num        := 1;
    lr_pl_rec.line_type           := p_line_type_code;
    lr_pl_rec.item_id             := p_item_id;
    lr_pl_rec.uom_code            := p_uom_code;
    lr_pl_rec.quantity            := p_order_quantity;
    lr_pl_rec.unit_price          := p_unit_price;
    lr_pl_rec.promised_date       := p_need_by_date;
    lr_pl_rec.need_by_date        := p_need_by_date;
    lr_pl_rec.shipment_type       := 'STANDARD';
    lr_pl_rec.ship_to_location_id := p_ship_location_id;
    lr_pl_rec.last_update_date    := SYSDATE;
    lr_pl_rec.last_updated_by     := ln_user_id;
    lr_pl_rec.creation_date       := SYSDATE;
    lr_pl_rec.created_by          := ln_user_id;
  
    --po_distributions_interface
    lr_pd_rec.quantity_ordered  := p_order_quantity;
    lr_pd_rec.charge_account_id := p_attribute1;
    lr_pd_rec.last_update_date  := SYSDATE;
    lr_pd_rec.last_updated_by   := ln_user_id;
    lr_pd_rec.creation_date     := SYSDATE;
    lr_pd_rec.created_by        := ln_user_id;
  
    --Header
    --==============================================================================
    --Org
    IF lr_ph_rec.org_id IS NULL THEN
      BEGIN
        Select hou.organization_id
          Into lr_ph_rec.org_id
          From hr_operating_units hou
         Where hou.Name = p_org_name;
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '组织错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --==============================================================================
    --Vendor Name
    IF lr_ph_rec.vendor_id IS NULL THEN
      BEGIN
        Select pv.vendor_id
          Into lr_ph_rec.vendor_id
          From po_vendors pv
         Where pv.vendor_name = p_vendor_name
           And pv.enabled_flag = 'Y';
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '供应商名称错误;';
          lv_status  := 'E';
      END;
    END IF;
  
    --==============================================================================
    --Vendor Site
    IF lr_ph_rec.vendor_site_id IS NULL THEN
      BEGIN
        Select pvs.vendor_site_id
          Into lr_ph_rec.vendor_site_id
          From po_vendor_sites_all pvs
         Where pvs.vendor_site_code = p_vendor_site
           And pvs.vendor_id = lr_ph_rec.vendor_id
           And pvs.org_id = lr_ph_rec.org_id;
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '供应商地点错误;';
          lv_status  := 'E';
      END;
    END IF;
  
    --==============================================================================
    --Ship Site
    IF lr_ph_rec.ship_to_location_id IS NULL THEN
      BEGIN
        Select pl.location_id
          Into lr_ph_rec.ship_to_location_id
          From po_locations_val_v pl
         Where pl.location_code = p_ship_location
           And pl.ship_to_site_flag = 'Y';
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '供应商收货地点错误;';
          lv_status  := 'E';
      END;
    END IF;
  
    --==============================================================================
    --Bill Site
    IF lr_ph_rec.bill_to_location_id IS NULL THEN
      BEGIN
        Select pl.location_id
          Into lr_ph_rec.bill_to_location_id
          From po_locations_val_v pl
         Where pl.location_code = p_bill_location
           And pl.bill_to_site_flag = 'Y';
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '供应商发票地点错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --==============================================================================
    --Buyer
    IF lr_ph_rec.agent_id IS NULL THEN
      BEGIN
        Select pan.buyer_id
          Into lr_ph_rec.agent_id
          From po_agents_name_v pan
         Where pan.full_name = p_agent_name;
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '供应商发票地点错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --==============================================================================
    --Term
    IF lr_ph_rec.terms_id IS NULL THEN
      BEGIN
        Select term_id
          Into lr_ph_rec.terms_id
          From ap_terms
         Where Name = p_payment_term;
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '付款条款错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --==============================================================================
    --Currency
    IF lr_ph_rec.currency_code IS NULL THEN
      BEGIN
        Select currency_code
          Into lr_ph_rec.currency_code
          From fnd_currencies
         Where currency_code = p_currency_name;
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '币种错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --Line
    --==============================================================================
    --Line Type
    IF lr_pl_rec.line_type IS NULL THEN
      BEGIN
        /*  -- Modify By Jianghua at 2009/03/20 09:01
         Select decode(p_line_type_name,
                       '货物', 'Goods',
                       '服务', 'Services','Goods')
           Into lr_pl_rec.line_type
           From dual;
        */
      
        SELECT pt.line_type_id
          INTO lr_pl_rec.line_type_id
          FROM po_line_types pt
         WHERE pt.line_type = p_line_type_name;
      
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '发票行类型错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --==============================================================================
    --ITEM, Material Account
    IF lr_pl_rec.item_id IS Null THEN
      BEGIN
        Select msi.inventory_item_id,
               msi.organization_id,
               msi.expense_account
          Into lr_pl_rec.item_id,
               lr_pl_rec.ship_to_organization_id,
               lb_expense_acct_id
          From mtl_system_items_b msi, org_organization_definitions ood
         Where 1 = 1
           And ood.operating_unit = lr_ph_rec.org_id
           And ood.organization_code = p_ship_org
           And ood.organization_id = msi.organization_id
              /* msi.organization_id = lr_ph_rec.Org_Id */ -- Remark By Jianghua at 2009/03/19 10:50
           And msi.segment1 = p_item_code
           And msi.purchasing_item_flag = 'Y';
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '物料名称和费用科目错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --==============================================================================
    --UOM
    IF lr_pl_rec.Uom_Code IS Null THEN
      BEGIN
        Select muo.uom_code
          Into lr_pl_rec.Uom_Code
          From mtl_units_of_measure muo
         Where muo.unit_of_measure_tl = p_uom;
        /*muo.unit_of_measure = p_uom; */ -- Remark By Jianghua at 2009/03/19 10:50
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || '物料单位错误;';
          lv_status  := 'E';
      END;
    END If;
  
    --Distribution
    --==============================================================================
    --Expense
    IF lr_pd_rec.charge_account_id IS Null THEN
      If lb_expense_acct_id Is Not Null Then
        lr_pd_rec.charge_account_id := lb_expense_acct_id;
      Else
        lv_err_msg := lv_err_msg || '物料费用科目错误;';
        lv_status  := 'E';
      End If;
    END If;
  
    IF lv_status = 'E' THEN
      raise_application_error(-20000, lv_err_msg);
      RETURN;
    END IF;
  
    /*-- Step 2: Import valid records into interface ------------------------------*/
    --==============================================================================
    --Assign Sequence
    If lr_ph_rec.interface_header_id IS Null Then
      If lr_ph_rec.org_id = g_org_id And
         lr_ph_rec.document_num = g_order_num And
         lr_ph_rec.vendor_id = g_vendor_id And
         lr_ph_rec.vendor_site_id = g_vendor_site_id Then
      
        lb_ph_existed_flag            := True;
        lr_ph_rec.interface_header_id := g_interface_header_id;
      Else
        Select po_headers_interface_s.Nextval
          Into lr_ph_rec.interface_header_id
          From dual;
      
        lb_ph_existed_flag := False;
        -- Add By Jianghua at 2009/03/20 10:50
        g_interface_header_id := lr_ph_rec.interface_header_id;
      
      End If;
    End If;
  
    If lr_pl_rec.interface_header_id IS Null And
       lr_pl_rec.interface_line_id Is Null Then
      lr_pl_rec.interface_header_id := g_interface_header_id;
    
      Select po_lines_interface_s.Nextval
        Into lr_pl_rec.interface_line_id
        From dual;
    
    End If;
  
    If lr_pd_rec.interface_header_id Is Null And
       lr_pd_rec.interface_line_id Is Null And
       lr_pd_rec.Interface_Distribution_Id Is Null Then
    
      lr_pd_rec.interface_header_id := g_interface_header_id;
    
      Select po_lines_interface_s.Currval,
             po_distributions_interface_s.Nextval
        Into lr_pd_rec.interface_line_id,
             lr_pd_rec.Interface_Distribution_Id
        From dual;
    End If;
  
    If Not lb_ph_existed_flag Then
      Begin
        Insert Into po_headers_interface Values lr_ph_rec;
      EXCEPTION
        WHEN OTHERS THEN
          lv_err_msg := lv_err_msg || 'po_headers_interface接口表插入异常;' ||
                        substr(SQLERRM, 1, 20);
          lv_status  := 'E';
      End;
    End If;
  
    IF lv_status = 'E' THEN
      raise_application_error(-20000, lv_err_msg);
    END IF;
  
    Begin
      Insert Into po_lines_interface Values lr_pl_rec;
    EXCEPTION
      WHEN OTHERS THEN
        lv_err_msg := lv_err_msg || 'po_lines_interface接口表插入异常;' ||
                      substr(SQLERRM, 1, 20);
        lv_status  := 'E';
    End;
  
    IF lv_status = 'E' THEN
      raise_application_error(-20000, lv_err_msg);
    END IF;
  
    Begin
      Insert Into po_distributions_interface Values lr_pd_rec;
    EXCEPTION
      WHEN OTHERS THEN
        lv_err_msg := lv_err_msg || 'po_distributions_interface接口表插入异常;' ||
                      substr(SQLERRM, 1, 20);
        lv_status  := 'E';
    End;
  
    IF lv_status = 'E' THEN
      raise_application_error(-20000, lv_err_msg);
    END IF;
  
    g_order_num      := lr_ph_rec.document_num;
    g_org_id         := lr_ph_rec.org_id;
    g_vendor_id      := lr_ph_rec.vendor_id;
    g_vendor_site_id := lr_ph_rec.vendor_site_id;
  
    -- Remark By Jianghua at 2009/03/20 10:50
    -- g_interface_header_id := lr_ph_rec.interface_header_id;
  
    /*-- Step 3: Submit request to process interface ------------------------------*/
    --Can not return request id to Web ADI. Hold.
    IF g_request_id IS NULL AND p_submit_request_flag = 'Y' THEN
    
      g_request_id := fnd_request.submit_request(application => 'PO',
                                                 program     => 'POXPOPDOI',
                                                 description => 'STANDARD',
                                                 argument1   => null,
                                                 argument2   => 'STANDARD',
                                                 argument3   => null,
                                                 argument4   => 'N',
                                                 argument5   => null,
                                                 argument6   => 'APPROVED',
                                                 argument7   => null,
                                                 argument8   => Null,
                                                 argument9   => Null,
                                                 argument10  => null);
    
      IF g_request_id = 0 THEN
        lv_err_msg := lv_err_msg || '提交系统请求发生异常;' ||
                      substr(SQLERRM, 1, 200);
        --lv_status := 'E';
        raise_application_error(-20000, lv_err_msg);
      END IF;
    END IF;
  
    --< This part of the code should be added >-------------------------
    msgencoded    := fnd_message.get_encoded();
    msgencodedlen := length(msgencoded);
    msgnameloc    := instr(msgencoded, chr(0));
    msgapp        := substr(msgencoded, 1, msgnameloc - 1);
    msgencoded    := substr(msgencoded, msgnameloc + 1, msgencodedlen);
    msgencodedlen := length(msgencoded);
    msgtextloc    := instr(msgencoded, chr(0));
    msgname       := substr(msgencoded, 1, msgtextloc - 1);
    IF (msgname <> 'CONC-SINGLE PENDING REQUEST') THEN
      fnd_message.set_name(msgapp, msgname);
    END IF;
  EXCEPTION
    WHEN OTHERS THEN
      ROLLBACK;
      raise_application_error(-20000, SQLERRM);
  END open_po_import;

END CUX_PO_DOC_IMP_PKG;

 

标签:default,接口,订单,varchar2,lr,EBS,rec,null,id
From: https://www.cnblogs.com/ivenlin/p/18120334

相关文章

  • 抽象类和接口
    一、抽象类和抽象方法1.引言:在继承体系中,共性的方法抽取到父类当中。如果子类没有重写该方法,是没有办法的2.抽象方法:将共性的行为(方法)抽取到父类之后,由于每一个子类执行的内容是不一样的。所以,在父类中不能确定具体的方法体。该方法就可以定义为抽象方法,不用书写方法体,其......
  • 外汇API接口分类 ,包含黄金和贵金属API等行情数据,亲测有效
    数据服务提供商在金融科技领域扮演着至关重要的角色,它们通过外汇API(应用程序编程接口)为用户提供实时和历史的外汇API数据。这些外汇API使得开发者和分析师能够轻松地将市场数据集成到他们的应用程序、算法模型或研究工作中。通过外汇API接口,用户可以构建各种金融应用程序,如投资组......
  • STM32CubeMX+MDK通过I2S接口进行音频输入输出(全双工读写一个DMA回调)
    一、前言目前有一个关于通过STM32F411CEUx的I2S总线接口控制SSS1700芯片进行音频输入输出的研究。SSS1700是具有片上振荡器的3S高度集成的USB音频控制器芯片。SSS1700功能支持96KHz24位采样率,带外部音频编解码器(24位/96KHzI2S输入和输出)并具有内置立体声16/24......
  • 前后端接口写法(传输数据)
    目录前言1.零散数据2.函数体3.总结前言对于后端常用的两个注解:详细分析Java中的@RequestParam和@RequestBody以下文章主要用于笔记总结,后续可翻看1.零散数据前端数据exportconstdoWeekPlan=(ids,selectedPeriod)=>{returnrequest({url:'/api......
  • 调用方使用“复杂接口”与“是否使用事务”
    问题“底层能力接口比较复杂,涉及到多个表的更新操作以及外部rpc的接口调用,并且部分接口使用了事务,支持回滚。”上面这种接口直接对外提供rpc接口是没问题的,因为内部已经保证了数据的一致性;但是如果直接提供给其他serviceA方法调用(非rpc调用),serviceA调用方是否使用事务,会发生不......
  • Udemy AWS SAA - EBS, AMI, EFS
    EBS(ElasticBlockStore)Volumeitisanetworkdriveyoucanattachtoyouinstanceswhiletheyrunitallowsyouinstancestopersistdata,evenaftertheirtermination.Justlikea"networkUSBstick"(notphysical)theycanonlybemounted......
  • 携程景点详情数据API接口丨携程景点详情数据采集接口丨携程API接口文档
    携程景点详情数据API接口是用于获取特定景点详细信息的编程接口。要使用这个API接口,你需要遵循以下步骤:注册开发者账号:访问携程开放平台,并注册成为一个开发者。创建应用并获取权限:在携程开放平台上创建一个应用,并获取相应的API权限。构建请求:根据文档指导,构建HTTP请求,设置必......
  • 携程获取景点列表API接口丨携程景点API接口丨携程API接口文档
    携程获取景点列表API接口为开发者提供了一种方便的方式来获取景点的详细信息。以下是使用该API接口的具体步骤:注册开发者账号:您需要在携程开放平台注册一个开发者账号,这是使用API接口的前提条件。创建应用并获取API密钥:登录到您的开发者账号后,创建一个新的应用,并获取相应的API......
  • 携程网获取地方美食品列表API数据接口丨携程商品列表数据接口丨携程API接口文档
    携程网提供了API接口用于获取地方美食品列表,具体接口名称为item_local_cuisine。为了使用这个API接口,你需要进行以下几个步骤:注册账号:访问携程开放平台,注册并开通相应的API服务。或者是根据PHP,java,C,Python等开发语言进行亚马逊商品详情数据接口,复制Taobaoapi2014添加薇好......
  • HIS系统是什么?一套前后端分离云HIS系统源码 接口技术RESTful API + WebSocket + WebSe
    HIS系统是什么?一套前后端分离云HIS系统源码接口技术RESTfulAPI+WebSocket+WebService医院管理信息系统(全称为HospitalInformationSystem)即HIS系统。常规模版包括门诊管理、住院管理、药房管理、药库管理、院长查询、电子处方、物资管理、媒体管理等,为医院管理提......