壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1184|回复: 5

[订单] 销售协议接口导入报错

[复制链接]
发表于 2012/6/21 14:01:21 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
DECLARE
  l_hdr_rec       OE_Blanket_PUB.header_Rec_type;
  l_hdr_val_rec   OE_Blanket_PUB.header_val_Rec_type;
  l_line_tbl      OE_Blanket_PUB.line_tbl_Type;
  l_line_val_tbl  OE_Blanket_PUB.line_Val_tbl_Type;
  l_line_rec      OE_Blanket_PUB.line_rec_Type;
  l_line_val_rec  OE_Blanket_PUB.line_val_rec_Type;
  l_control_rec   OE_Blanket_PUB.Control_rec_type;
  x_line_tbl      OE_Blanket_PUB.line_tbl_Type;
  x_header_rec    OE_Blanket_PUB.header_Rec_type;
  x_msg_count     NUMBER;
  x_msg_data      VARCHAR2(2000);
  x_return_status VARCHAR2(30);
  i               NUMBER;
  j               NUMBER;
BEGIN
  oe_debug_pub.setdebuglevel(5);
  oe_debug_pub.add('Enter create BSA ', 1);
  dbms_output.put_line('The debug file is :' || OE_DEBUG_PUB.G_DIR || '/' ||
                       OE_DEBUG_PUB.G_FILE);
  --Fnd_Global.apps_initialize(&user_Id,&responsibility_Id,&resp_appl_id);   
  Fnd_Global.apps_initialize(1318, 21623, 660);
  MO_GLOBAL.INIT('ONT');
  For j IN 1 .. 1 LOOP
    l_hdr_rec                          := OE_Blanket_PUB.G_MISS_HEADER_REC;
    l_hdr_val_rec                      := OE_Blanket_PUB.G_MISS_HEADER_VAL_REC;
    l_hdr_rec.operation                := OE_Globals.G_OPR_CREATE;
    l_hdr_rec.accounting_rule_id       :=1000;
    l_hdr_rec.agreement_id             :=1001;
    l_hdr_rec.sold_to_org_id           := 5087;
    l_hdr_rec.order_type_id            := 1076;
   --- l_hdr_rec.ship_to_org_id           := 1323;
    l_hdr_rec.attribute1               := 'dr test';
    l_hdr_rec.start_date_active        := sysdate;
    l_hdr_rec.end_date_active          := sysdate + 5 ;
    l_hdr_rec.PRICE_LIST_NAME      := 'PRICE_LIST_NAME';
    l_hdr_rec.PRICE_LIST_Id            :=9007;
   --- l_hdr_rec.new_modifier_list_name   := 'dr modifier list22';
    l_hdr_rec.default_discount_percent := 15;
     l_hdr_rec.DEFAULT_DISCOUNT_AMOUNT :=100;
    l_hdr_rec.order_number             :='2110120001';
    l_hdr_rec.transactional_curr_code  :='CNY';
    l_hdr_rec.CREATION_DATE            :=sysdate;
    l_hdr_rec.CREATED_BY               :=-1;
    l_hdr_rec.LAST_UPDATED_BY          :=-1;
    l_hdr_rec.LAST_UPDATE_DATE         :=sysdate;
    l_hdr_rec.LAST_UPDATE_LOGIN        :=-1;
    l_hdr_rec.operation                :='INSERT';
    l_hdr_rec.cust_po_number           :='TEST';
    l_hdr_rec.FREIGHT_TERMS_CODE       :='CIP';
    l_hdr_rec.org_id                   :=81;
    l_hdr_rec.VERSION_NUMBER           :=0;
    l_hdr_rec.OPEN_FLAG                :='N';
    l_hdr_rec.accounting_rule_id       :=1;
    l_hdr_rec.header_id                :=1006;
    l_hdr_rec.lock_control             :=1;
   
   
   --- l_hdr_rec.payment_term_id          :=1032;
   
   
   
    l_line_rec                         := OE_Blanket_PUB.G_MISS_BLANKET_LINE_REC;
    l_line_val_rec                     := OE_Blanket_PUB.G_MISS_BLANKET_LINE_VAL_REC;
    l_line_rec.operation               := OE_Globals.G_OPR_CREATE;
    l_line_rec.accounting_rule_id      :=l_hdr_rec.accounting_rule_id ;
     l_line_rec.agreement_id           := l_hdr_rec.agreement_id ;     
    l_line_rec.sold_to_org_id          := 5087;
    l_line_rec.inventory_item_id       := 4;
    l_line_rec.ordered_item            :='1711800016';
   --- l_line_rec.inventory_item          :='吹风机,600W';
    l_line_rec.blanket_min_quantity    := 499;
    l_line_rec.blanket_max_quantity    := 999;
    l_line_rec.min_release_quantity    := 499;
    l_line_rec.max_release_quantity    := 999;
    l_line_rec.unit_list_price         := 888;
    l_line_rec.ITEM_IDENTIFIER_TYPE    := 'INT';
    l_line_rec.pricing_uom             := '片';
    l_line_rec.ORDER_QUANTITY_UOM      := '片';
    l_line_rec.ACCOUNTING_RULE_ID      :=1;
    l_line_rec.header_id               :=l_hdr_rec.header_id;
    l_line_rec.lock_control           :=l_hdr_rec.lock_control;
    l_line_rec.override_blanket_controls_flag  :='N' ;
     l_line_rec.override_release_controls_flag :='N' ;
      l_line_rec.operation                :='INSERT';
   
    l_line_rec.CREATION_DATE            :=sysdate;
    l_line_rec.CREATED_BY               :=-1;
    l_line_rec.LAST_UPDATED_BY          :=-1;
    l_line_rec.LAST_UPDATE_DATE         :=sysdate;
    l_line_rec.LAST_UPDATE_LOGIN        :=-1;
    l_line_rec.org_id                   :=l_hdr_rec.org_id;
   
    for i in 1 .. 1 loop
      l_line_tbl(i) := l_line_rec;
      l_line_val_tbl(i) := l_line_val_rec;
    end loop;
    oe_debug_pub.add('Before calling Process Blanket API', 1);
    oe_msg_pub.initialize;
    OE_Blanket_PUB.Process_Blanket(p_org_id             => 246,
                                   p_operating_unit     => NULL,
                                   p_api_version_number => 1.0,
                                   x_return_status      => x_return_status,
                                   x_msg_count          => x_msg_count,
                                   x_msg_data           => x_msg_data,
                                   p_header_rec         => l_hdr_rec,
                                   p_header_val_rec     => l_hdr_val_rec,
                                   p_line_tbl           => l_line_tbl,
                                   p_line_val_tbl       => l_line_val_tbl,
                                   p_control_rec        => l_control_rec,
                                   x_header_rec         => x_header_rec,
                                   x_line_tbl           => x_line_tbl);
    oe_debug_pub.add('Number of OE messages :' || x_msg_count, 1);
    for k in 1 .. x_msg_count loop
      x_msg_data := oe_msg_pub.get(p_msg_index => k, p_encoded => 'F');
      dbms_Output.put_line('Message :' || x_msg_data);
      oe_debug_pub.add(substr(x_msg_data, 1, 255));
      oe_debug_pub.add(substr(x_msg_data, 255, length(x_msg_data)));
    end loop;
     dbms_output.put_line('x_return_status:   ' ||x_return_status);
     dbms_output.put_line('x_msg_data:   ' ||x_msg_data);
     
      dbms_output.put_line('x_msg_count:   ' ||x_msg_count);
      dbms_output.put_line('FND_API.G_RET_STS_SUCCESS:   ' ||FND_API.G_RET_STS_SUCCESS);
    if x_return_status <> FND_API.G_RET_STS_SUCCESS then
      oe_debug_pub.add('Error in process blanket ', 1);
      dbms_output.put_line('Error in Process blanket, Check the debug log file ');
      rollback;
    else
      dbms_output.put_line('New Sales Agreement Number is :' ||
                           x_header_rec.order_number || '(Header ID : ' ||
                           x_header_rec.header_id || ')');
      oe_debug_pub.add('Line ID :' || x_line_tbl(1).line_id, 1);
      oe_debug_pub.add('Header ID :' || x_header_rec.header_id, 1);
      oe_debug_pub.add('Order number :' || x_header_rec.order_number, 1);
      oe_debug_pub.add('Sold To :' || x_header_rec.sold_to_org_id, 1);
      oe_debug_pub.add('Invoice To :' || x_header_rec.invoice_to_org_id, 1);
      oe_debug_pub.add('Ship To :' || x_header_rec.ship_to_org_id, 1);
    end if;
  end loop;
  commit;
End;
/


x_return_status:   E
x_msg_data:   
x_msg_count:   0
FND_API.G_RET_STS_SUCCESS:   S
Error in Process blanket, Check the debug log file

请高手指点。
 楼主| 发表于 2012/6/21 15:15:38 | 显示全部楼层
呼叫高手,呼叫高手,   
发表于 2012/6/22 08:48:40 | 显示全部楼层
错误讯息? 先跟大家讲一下
 楼主| 发表于 2012/7/10 10:43:43 | 显示全部楼层
wilson1966 发表于 2012/6/22 08:48
错误讯息? 先跟大家讲一下

问题已经解决了,谢谢!

点评

解决了问题不更新上来?  发表于 2013/8/26 15:14
发表于 2013/8/26 14:51:47 | 显示全部楼层
maggiem 发表于 2012/7/10 10:43
问题已经解决了,谢谢!

楼主,能否共享下导入销售协议的代码啊,谢谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 06:15 , Processed in 0.014941 second(s), 15 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表