加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle EBS 更新客户地点

发布时间:2020-12-12 13:40:16 所属栏目:百科 来源:网络整理
导读:-- 更新客户地点 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;
--更新客户地点
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,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;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读