Oracle EBS 更新客户地点

--更新客户地点
declare
  x_return_status         VARCHAR2(150);
  x_msg_count             NUMBER;
  x_msg_data              VARCHAR2(2000);
  x_profile_id            NUMBER;
  l_location_id           NUMBER;
  l_object_version_number NUMBER;
  l_party_rec             hz_party_site_v2pub.party_site_rec_type;
  cursor cur_DT is
    SELECT loc.location_id,
           loc.object_version_number,
           addr.PARTY_SITE_ID,
           hc.ACCOUNT_NUMBER,
           hc.CUST_ACCOUNT_ID,
           party_site.PARTY_SITE_NAME,
           hcp.CUST_ACCOUNT_PROFILE_ID,
           hcp.CREDIT_HOLD,
           hc.CREATION_DATE,
           hc.CREATED_BY,
           hc.ORIG_SYSTEM_REFERENCE,
           hc.PARTY_ID,
           addr.status status1,
       party_site.STATUS status2
      FROM hz_cust_acct_sites_all addr,
           hz_party_sites         party_site,
           hz_locations           loc,
           HZ_CUSTOMER_PROFILES   hcp,
           HZ_CUST_ACCOUNTS       hc
     WHERE 1 = 1
       AND addr.party_site_id = party_site.party_site_id
       AND loc.location_id = party_site.location_id
       and hc.PARTY_ID = party_site.PARTY_ID
       and hc.CUST_ACCOUNT_ID = hcp.CUST_ACCOUNT_ID
       and party_site.PARTY_ID =
           (select hz.PARTY_ID
              from hz_parties hz
             where hz.PARTY_ID = party_site.PARTY_ID
               and hz.PARTY_NUMBER = ‘10984‘);

begin
  fnd_global.apps_initialize(0, 50738, 20003);
  mo_global.init(‘AR‘);
  FOR rec IN CUR_DT LOOP
    begin
      select hc.OBJECT_VERSION_NUMBER
        into l_object_version_number
        from hz_party_sites hc
       where hc.PARTY_ID = rec.PARTY_ID;
    end;
    l_party_rec.party_id       := rec.party_id;
    l_party_rec.PARTY_SITE_ID        := rec.PARTY_SITE_ID;
    l_party_rec.status                := ‘I‘;
    l_party_rec.location_id := rec.location_id;

    hz_party_site_v2pub.update_party_site(p_init_msg_list         => fnd_api.g_false,
                                          p_party_site_rec        => l_party_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);

    IF x_return_status = fnd_api.g_ret_sts_error THEN
      x_msg_count := fnd_msg_pub.count_msg;
      x_msg_data  := substr(fnd_msg_pub.get(fnd_msg_pub.g_first,
                                            fnd_api.g_false),
                            1,
                            512);
      dbms_output.put_line(x_msg_data);
      fnd_msg_pub.delete_msg();
      RAISE fnd_api.g_exc_error;
    ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
      x_msg_count := fnd_msg_pub.count_msg;
      x_msg_data  := substr(fnd_msg_pub.get(fnd_msg_pub.g_first,
                                            fnd_api.g_false),
                            1,
                            512);
      dbms_output.put_line(x_msg_data);

      fnd_msg_pub.delete_msg();
      RAISE fnd_api.g_exc_unexpected_error;
    END IF;
    IF x_return_status = fnd_api.g_ret_sts_success THEN
      dbms_output.put_line(‘------------------Update Success-------------------‘);

    END IF;
  END LOOP;
END;

原文地址:https://www.cnblogs.com/jenrry/p/10006834.html

时间: 2024-07-29 11:15:31

Oracle EBS 更新客户地点的相关文章

Oracle EBS R12 客户表结构

R12 客户表结构 客户表/联系人/PARTY关联 HZ_PARTIES 客户账户表 HZ_CUST_ACCOUNTS 例子: SELECT hp.party_number --客户注册标识 , hp.party_name --组织名/客户 , hp.known_as --别名 , hp.organization_name_phonetic --名称拼音 , acc.account_number --帐号 , flv_sale.meaning sales_channel_code --销售渠道

Oracle EBS更新销售订单行信息API

 更新销售订单行信息 DECLARE l_header_rec             oe_order_pub.header_rec_type; l_line_tbl               oe_order_pub.line_tbl_type; l_line_tb2               oe_order_pub.line_tbl_type; l_action_request_tbl     oe_order_pub.request_tbl_type; l_return_sta

Oracle EBS AP 供应商地点失效

/* 供应商地点失效 creation: created by jenrry 20161108 1.00 */ DECLARE lv_return_status VARCHAR2(1) := NULL; ln_msg_count NUMBER; lv_errmsg VARCHAR2(5000); lt_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type; p_vendor_rec ap_vendor_pub_pkg.r_vendor_

Oracle EBS AR 客户取数SQL

SELECT acct.cust_account_id, acct.party_id, acct.account_number, party.party_name, lkp1.meaning party_type, profile.cust_account_profile_id, acct.account_name, party.party_number, party.category_code, lkp.meaning category, party.jgzz_fiscal_code, par

Oracle EBS AR 客户API

------------------------------------ 1. Set Environment ------------------------------------ -- 1a. Setup the Org_id ------------------------------------ exec dbms_application_info.set_client_info('204'); ------------------------------------ -- 1b. S

如何面对客户评价Oracle EBS界面难看,不符合操作习惯

如何面对客户评价Oracle EBS界面难看,不符合操作习惯 首先 ,我把网上摘录的信息加以总结. 可简单自定义,可以修改Oracle EBS的界面颜色. Form 界面逻辑调理清晰,更加注重简单实用,界面设计标准化,统筹规划了各种操作习惯及方式,沿用严肃的风格. 刚接触新系统的时候都不太习惯,起初操作会感觉有点儿怪,但是实际用下来会相当方便,而且系统对于数据的保护性也做到了最佳,用久了就能发现系统的高明之处. 和SAP相比,用户界面要好得多. Form会逐渐转向Web,主推Fusion. Fu

ORACLE EBS常用表

http://www.cnblogs.com/quanweiru/archive/2012/09/26/2704628.html call fnd_global.APPS_INITIALIZE(1318,50583,401) select fnd_profile.VALUE('ORG_ID') FROM DUAL select * from hr_operating_units hou where hou.organization_id=204 --fnd select * from fnd_a

[转]oracle EBS 基础100问

from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 ORACLE EBS学习的其他资源有哪四个? 1002 ORACLE OPEN WORLD大会是不是一个市场营销活动? 1003 Oracle 大学有哪五种课程? 1004 多个责任分配给一个人,是多对一关系,还是一对多关系? 1005 一个责任分配给多个人,是什么样的关系? 1006 双+号和双-号,

Oracle EBS 如何月结、对账[Z]

在Oracle系统处理月结业务时,需要遵循一定的操作顺序.这些业务,牵涉到相应的模块,包括:应付模块.采购模块.库存模块.应收模块.薪资模块.固定资产和总帐模块等 在Oracle系统中,总帐模块处于财务核算的核心地位,它从其他模块中接收财务信息.总帐接收到的财务信息与子模块业务必须保持一致,才能保证整个系统的帐务是正确的,所以要进行对帐. 后面将描述一下模块之间的关帐顺序及模块间关帐要完成的步骤 一.Oracle EBS 月结应付(AP)对账顺序 步骤,1.检查业务是否全部录入:2.检查是否有