使用API失效供应商地址Demo(转)

原文地址  使用API失效供应商地址Demo

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;
  l_party_site_rec         hz_party_site_v2pub.party_site_rec_type;
  lt_location_rec          hz_location_v2pub.location_rec_type;
  ln_object_version_number NUMBER;
  ln_object_version_number2 NUMBER;
  ln_vendor_site_id        NUMBER := NULL;
  ln_party_site_id         NUMBER := NULL;
  lv_party_site_name       VARCHAR2(240);
  lv_party_site_number     VARCHAR2(30);
  ln_location_id           NUMBER;
  -- WHO columns
  l_user_id        NUMBER := -1;
  l_resp_id        NUMBER := -1;
  l_application_id NUMBER := -1;
  l_row_cnt        NUMBER := 1;
  l_user_name      VARCHAR2(30) := &user_name;
  l_resp_name      VARCHAR2(30) := &resp_name;
  lv_vendor_site_code VARCHAR2(15) := &vendor_site_code;
  ln_org_id NUMBER := &org_id;

  /*CURSOR sup_site IS
    SELECT vendor_site_code_de
      FROM xxwe_mg_supplier_sites_xross
     WHERE batch_id = 234
       AND segment1_so NOT LIKE ‘NON%‘;*/
BEGIN
  -- Get the user_id
  SELECT user_id INTO l_user_id FROM fnd_user WHERE upper(user_name) = upper(l_user_name);

  -- Get the application_id and responsibility_id
  SELECT application_id,
         responsibility_id
    INTO l_application_id,
         l_resp_id
    FROM fnd_responsibility_vl
   WHERE upper(responsibility_name) = upper(l_resp_name);

  -- Initialize applications information
  fnd_global.apps_initialize(l_user_id, l_resp_id, l_application_id); -- Mfg / Mfg & Dist Mgr / INV
  dbms_output.put_line(‘Initialized applications context: ‘ || l_user_id || ‘ ‘ || l_resp_id || ‘ ‘ || l_application_id);
  --
  dbms_output.put_line(‘------------------Start Update-------------------‘);
  --FOR rec IN sup_site LOOP
  --dbms_output.put_line(‘Supplier site code:‘ || rec.vendor_site_code_de);
  --dbms_output.put_line(‘Supplier org id:‘ || ln_org_id);
  --SELECT NECESSARY INFORMATION

  BEGIN
    SELECT pvs.vendor_site_id,
           pvs.party_site_id,
           hps.party_site_name,
           hps.object_version_number,
           hps.party_site_number,
           pvs.location_id,
           hl.object_version_number
      INTO ln_vendor_site_id,
           ln_party_site_id,
           lv_party_site_name,
           ln_object_version_number,
           lv_party_site_number,
           ln_location_id,
           ln_object_version_number2
      FROM ap_supplier_sites_all pvs,
           hz_party_sites        hps,
           hz_locations          hl
     WHERE pvs.vendor_site_code = lv_vendor_site_code--rec.vendor_site_code_de
       AND pvs.org_id = ln_org_id
       AND pvs.party_site_id = hps.party_site_id
       AND pvs.location_id = hl.location_id;
  EXCEPTION
    WHEN no_data_found THEN
      lv_errmsg := ‘Can not find the vendor site need to update!The site code is:‘ || lv_vendor_site_code/*rec.vendor_site_code_de*/;
      dbms_output.put_line(lv_errmsg);
  END;
  --
  lt_vendor_site_rec.vendor_site_id   := ln_vendor_site_id;
  lt_vendor_site_rec.vendor_site_code := substr(lv_vendor_site_code, length(lv_vendor_site_code) - 7, 8) || ‘disable‘;
  lt_vendor_site_rec.inactive_date    := SYSDATE;

  --UPDATE vendor_site_code
  ap_vendor_pub_pkg.update_vendor_site(p_api_version      => 1.0,
                                       p_init_msg_list    => fnd_api.g_true,
                                       p_commit           => fnd_api.g_false,
                                       p_validation_level => fnd_api.g_valid_level_full,
                                       x_return_status    => lv_return_status,
                                       x_msg_count        => ln_msg_count,
                                       x_msg_data         => lv_errmsg,
                                       p_vendor_site_rec  => lt_vendor_site_rec,
                                       p_vendor_site_id   => ln_vendor_site_id);
  IF (nvl(lv_return_status, fnd_api.g_ret_sts_error) <> fnd_api.g_ret_sts_success) THEN
    ln_msg_count := fnd_msg_pub.count_msg;
    IF ln_msg_count > 0 THEN
      lv_errmsg := substr(fnd_msg_pub.get(fnd_msg_pub.g_first, fnd_api.g_false), 1, 512);

      FOR i IN 1 .. (ln_msg_count - 1) LOOP

        lv_errmsg := lv_errmsg || chr(10) || substr(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false), 1, 512);
      END LOOP;
      fnd_msg_pub.delete_msg();
    END IF;
    dbms_output.put_line(‘------------------Update Error-------------------‘);
    dbms_output.put_line(‘Error1 :‘ || lv_errmsg);
  END IF;
  --UPDATE party_site_name
  l_party_site_rec.party_site_id   := ln_party_site_id;
  l_party_site_rec.party_site_name := lv_party_site_name || ‘disable‘;
  l_party_site_rec.status          := ‘I‘;
  --
  hz_party_site_v2pub.update_party_site(p_init_msg_list         => fnd_api.g_false,
                                        p_party_site_rec        => l_party_site_rec,
                                        p_object_version_number => ln_object_version_number,
                                        x_return_status         => lv_return_status,
                                        x_msg_count             => ln_msg_count,
                                        x_msg_data              => lv_errmsg);
  IF (nvl(lv_return_status, fnd_api.g_ret_sts_error) <> fnd_api.g_ret_sts_success) THEN
    ln_msg_count := fnd_msg_pub.count_msg;
    IF ln_msg_count > 0 THEN
      lv_errmsg := substr(fnd_msg_pub.get(fnd_msg_pub.g_first, fnd_api.g_false), 1, 512);

      FOR i IN 1 .. (ln_msg_count - 1) LOOP

        lv_errmsg := lv_errmsg || chr(10) || substr(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false), 1, 512);
      END LOOP;
      fnd_msg_pub.delete_msg();
    END IF;
    dbms_output.put_line(‘------------------Update Error-------------------‘);
    dbms_output.put_line(‘Error2 :‘ || lv_errmsg);
  END IF;
  --update location
  lt_location_rec.address_style := ‘POSTAL_ADDR_DEF‘;
  lt_location_rec.location_id   := ln_location_id;

  hz_location_v2pub.update_location(p_init_msg_list         => fnd_api.g_true,
                                    p_location_rec          => lt_location_rec,
                                    p_object_version_number => ln_object_version_number2,
                                    x_return_status         => lv_return_status,
                                    x_msg_count             => ln_msg_count,
                                    x_msg_data              => lv_errmsg);
  IF (nvl(lv_return_status, fnd_api.g_ret_sts_error) <> fnd_api.g_ret_sts_success) THEN
    ln_msg_count := fnd_msg_pub.count_msg;
    IF ln_msg_count > 0 THEN
      lv_errmsg := substr(fnd_msg_pub.get(fnd_msg_pub.g_first, fnd_api.g_false), 1, 512);

      FOR i IN 1 .. (ln_msg_count - 1) LOOP

        lv_errmsg := lv_errmsg || chr(10) || substr(fnd_msg_pub.get(fnd_msg_pub.g_next, fnd_api.g_false), 1, 512);
      END LOOP;
      fnd_msg_pub.delete_msg();
    END IF;
    dbms_output.put_line(‘------------------Update Error-------------------‘);
    dbms_output.put_line(‘Error3 :‘ || lv_errmsg);
  END IF;
  --
  IF lv_return_status = fnd_api.g_ret_sts_success THEN
    dbms_output.put_line(‘------------------Update Success-------------------‘);
    DELETE xxwe_mg_supplier_sites_xross x
     WHERE x.party_site_number_de = lv_party_site_number
       AND x.org_id_de = ln_org_id;
  END IF;
  --END LOOP;
  dbms_output.put_line(‘------------------Update End-------------------‘);
END;
时间: 2024-12-08 03:53:44

使用API失效供应商地址Demo(转)的相关文章

QQ地图api里的 地址解析函数 看不懂 javascript_百度知道

QQ地图api里的 地址解析函数 看不懂 javascript_百度知道 ??? QQ地图api里的 地址解析函数 看不懂 javascript??? 2011-09-18 12:18 ??? 匿名 ??? | ??? 分类:JavaScript ??? | 浏览126次 ??? http://cstar.qq.com/qqmapapi/classdoc/symbols/QGeocoder.html函数 帮忙写函数根据地址返回坐标 x y函数看懂??? QGeocoder比? function(

EBS标准的查看供应商地址

--获取供应商PARTY_ID SELECT * FROM HZ_PARTIES HP WHERE HP.PARTY_NAME='XXXXXX' VO数据源:oracle.apps.pos.supplier.server.AddrSummVO --获取供应商地址--将代码中的:1,:2,:3替换为供应商对应的PARTY_ID SELECT hps.party_site_id, hps.party_site_name AS address_name, 'CURRENT' AS status, hz

API之IP地址查询---权威的IP地址查询接口集合

原文地址:http://yushine.iteye.com/blog/1717586 推荐实用IP138 http://www.baidu.com/s?wd=IP&rsv_spt=1&issp=1&f=8&rsv_bp=0&ie=utf-8&tn=19045005_9_pg&rsv_enter=1&rsv_sug3=2&rsv_sug4=60&rsv_sug1=1&rsv_sug2=0&inputT=520  

Paypal Rest Api自定义物流地址(跳过填写物流地址)

PayPal之前的Rest Api是不支持自定义物流地址的,最新升级版本的提供了这个服务(Payment Experience),大概步骤如下: 1.申请一个自定义的配置ID 自定义配置包括Logo,Url,Shipping物流地址方案,允许填写备注等等 2.生成订单付款的时候,将该ID传送 示例代码在最新的SDK中都有Demo:如下: 一.Payment Experience Create var apiContext = Configuration.GetAPIContext(); // S

使用API更新供应商名称及曾用名

原文地址 更新供应商名称 EBS R12 (12.1.3) 更新供应商名称或曾用名不能直接使用 pos_vendor_pub_pkg.update_vendor(p_vendor_rec => l_vendor_rec,x_return_status => l_return_status, --返回的状态x_msg_count => l_msg_count, --返回的错误数量x_msg_data => l_msg_data); --返回的错误信息 此API,需要使用另外一个API

bootstrapvalidator API 文档地址: http://bootstrapvalidator.votintsev.ru/api/

bootstrap验证插件 bootstrapvalidator 文档API 地址 (原始作者英文):http://bootstrapvalidator.votintsev.ru/api/ 附中文图片版:(看不清的话:右键 -->在新标签页打开)

angularjs英文版api学习 (附demo)

1.angular.bind var self = {name: 'boy'}; var f = angular.bind(self, function (age) { alert(this.name + ' is ' + age + ' !')}); f(12); 2.angular.bootstrap var app = angular.module('demo', []) .controller('WelcomeController', function($scope) { $scope.

供应商和管理员查看供应商地址簿信息SQL

--管理员查看地址簿 SELECT hps.party_site_id, hps.party_site_name AS address_name, 'CURRENT' AS status, hzl.address1 AS loc_address1, hzl.address2 AS loc_address2, hzl.address3 AS loc_address3, hzl.city AS loc_city, hzl.county AS loc_county, hzl.state AS loc_

通过百度地图API实现搜索地址--第三方开源--百度地图(三)

搜索地址功能是建立在能够通过百度地图API获取位置的基础上 通过百度地图定位获取位置详情:http://www.cnblogs.com/zzw1994/p/5008134.html 1 package com.zzw.baidumappoint; 2 3 import com.baidu.location.BDLocation; 4 import com.baidu.location.BDLocationListener; 5 import com.baidu.location.Location