• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
黄洪波写点东西的地方
博客园    首页    新随笔    联系   管理    订阅  订阅
EBS R12使用接口表往已存在的供应商地址下创建新的地点

在供应商 "测试供应商A" 下已经有了两个地址,分别为 "地址A","地址B",现在由于某些原因,需要在地址A下面创建新的地点。

由于业务需要,所以使用的是将数据导入ap_supplier_sites_int接口表,再使用 "供应商站点开放接口导入" 请求来创建新的地点。

参考代码如下:根据实际业务补充。

SELECT * FROM ap.ap_supplier_sites_int;

/

truncate TABLE ap.ap_supplier_sites_int;

/

    SELECT pv.vendor_id,
           hl.location_id,
           hp.party_id,
           hps.party_site_id,
           hl.country,
           hl.address1,
           hps.party_site_name,
           hl.address1,
           hl.address2,
           hl.address3,
           hl.address4,
           hl.city,
           hl.state,
           hl.province,
           hl.country,
           hl.county,
           hl.language,
           hl.address_style
      FROM hz_locations   hl,
           hz_parties     hp,
           po_vendors     pv,
           hz_party_sites hps
     WHERE pv.party_id = hp.party_id
       AND hps.party_id = hp.party_id
       AND hps.location_id = hl.location_id
       AND pv.vendor_name = '简单的供应商导入1'
       AND hl.address_lines_phonetic = 'Y';

/

DECLARE
-- Local variables here

l_iface_site_rec ap_supplier_sites_int%ROWTYPE;

BEGIN
    -- Test statements here

    FOR cc IN (SELECT pv.vendor_id,
                      hl.location_id,
                      hp.party_id,
                      hps.party_site_id,
                      hps.party_site_name,
                      hl.address1,
                      hl.address2,
                      hl.address3,
                      hl.address4,
                      hl.city,
                      hl.state,
                      hl.province,
                      hl.country,
                      hl.county,
                      hl.language,
                      hl.address_style
                 FROM hz_locations   hl,
                      hz_parties     hp,
                      po_vendors     pv,
                      hz_party_sites hps
                WHERE pv.party_id = hp.party_id
                  AND hps.party_id = hp.party_id
                  AND hps.location_id = hl.location_id
                  AND pv.vendor_name = '简单的供应商导入1'
                  AND hl.address_lines_phonetic = 'Y') LOOP
        l_iface_site_rec.vendor_id     := cc.vendor_id; --供应商ID
        l_iface_site_rec.location_id   := cc.location_id;
        l_iface_site_rec.address_line1 := cc.address1;
        l_iface_site_rec.address_line2 := cc.address2;
        l_iface_site_rec.address_line3 := cc.address3;
        l_iface_site_rec.address_line4 := cc.address4;
        l_iface_site_rec.city          := cc.city;
        l_iface_site_rec.state         := cc.state;
        -- l_iface_site_rec.zip            :=     --此字段我未找到
        l_iface_site_rec.province      := cc.province;
        l_iface_site_rec.country       := cc.country;
        l_iface_site_rec.county        := cc.county;
        l_iface_site_rec.language      := cc.language;
        l_iface_site_rec.address_style := cc.address_style;
        --付款标识
        l_iface_site_rec.pay_site_flag := 'Y';
        --采购标识
        l_iface_site_rec.purchasing_site_flag := 'Y';
        l_iface_site_rec.org_id               := 161; --地点对应的业务实体  
        l_iface_site_rec.vendor_site_code     := substr('地点0626_1',
                                                        1,
                                                        15);
    END LOOP;

    INSERT INTO ap.ap_supplier_sites_int VALUES l_iface_site_rec;

    COMMIT;
END;

/

    SELECT * FROM ap.ap_supplier_sites_int;

 

 

再执行"供应商站点开放接口导入"请求,导入地点。

 

参考文章:

交易方地点名称与地址详细信息不一致。

此供应商已经存在地址/交易方地点名称。请重新输入唯一名称。

Oracle EBS R12 接口导 供应商

供应商接口的使用 

供应商导入

 

posted on 2015-06-16 17:54  红无酒伤  阅读(1151)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3