EBS价目表设置导入功能(2)-价目表行

来源:互联网 发布:mac 实用软件 编辑:程序博客网 时间:2024/05/16 00:43

2.价目表行(qp_interface_list_lines)

 

2.1查询价目表行信息

Sql代码  收藏代码
  1. --2.2.查询价目信息  
  2. begin  
  3.     select qlh.list_header_id, qll.list_line_id  
  4.       into lt_lines.list_header_id, lt_lines.list_line_id  
  5.       from mtl_system_items_b msi, qp_pricing_attributes qpa, qp_list_lines qll, qp_list_headers qlh  
  6.      where msi.organization_id = 102  
  7.        and msi.inventory_item_id = qpa.product_attr_value  
  8.        and qpa.pricing_phase_id = 1  
  9.        and qpa.qualification_ind = 4  
  10.        and qpa.product_attribute_context = 'ITEM'  
  11.        and qpa.list_line_id = qll.list_line_id  
  12.        and qpa.list_header_id = qll.list_header_id  
  13.        and qll.list_line_type_code = 'PLL'  
  14.        and qll.list_header_id = qlh.list_header_id  
  15.        and qlh.active_flag = 'Y'  
  16.        and qlh.list_type_code = 'PRL'  
  17.        and qlh.end_date_active is null  
  18.        and qlh.name like '%外贸%'  
  19.        and qlh.currency_code = c_wm_lines.transactional_curr_code  
  20.        and upper(msi.segment1) = upper(c_wm_lines.segment1)  
  21.        and rownum < 2;  
  22.     lt_lines.interface_action_code := g_update; --更新  
  23. exception  
  24.     when no_data_found then  
  25.         lt_lines.interface_action_code := g_insert; --创建  
  26.     when others then  
  27.         raise e_exception;  
  28. end;  
  29. lt_lines.orig_sys_line_ref   := 'L_M_' || to_char(c_wm_lines.moss_price_id);  
  30. lt_lines.orig_sys_header_ref := prm_header.orig_sys_header_ref;  
  31. lt_lines.list_line_type_code := 'PLL';  
  32. --lt_lines.start_date_active   := c_wm_lines.start_date_active;  
  33. lt_lines.start_date_active   := l_current_date;  
  34. lt_lines.arithmetic_operator := 'UNIT_PRICE';  
  35. lt_lines.operand             := c_wm_lines.invoice_price;  
  36. lt_lines.primary_uom_flag    := 'Y';  
  37. lt_lines.product_precedence  := 220;  
  38. lt_lines.process_flag        := 'Y';  
  39. lt_lines.process_status_flag := 'P';  

 

2.2插入价目表行

Sql代码  收藏代码
  1. insert into qp_interface_list_lines  
  2. (orig_sys_line_ref, --1.原始价目表行ID  
  3.  orig_sys_header_ref, --2.原始价目表题头ID  
  4.  list_line_type_code, --3.行类型  
  5.  start_date_active, --4.有效起始日期  
  6.  arithmetic_operator, --5.UNIT_PRICE  
  7.  operand, --6.价格  
  8.  primary_uom_flag, --7.是否主要单位  
  9.  product_precedence, --8.优先顺序  
  10.  interface_action_code, --9.操作方式  
  11.  process_flag, --10.处理标志  
  12.  process_status_flag, --11.处理状态  
  13.  list_header_id,  
  14.  list_line_id)  
  15. values  
  16. (prm_line.orig_sys_line_ref, --1.原始价目表行ID  
  17.  prm_line.orig_sys_header_ref, --2.原始价目表题头ID  
  18.  prm_line.list_line_type_code, --3.行类型  
  19.  prm_line.start_date_active, --4.有效起始日期  
  20.  prm_line.arithmetic_operator, --5.UNIT_PRICE  
  21.  prm_line.operand, --6.价格  
  22.  prm_line.primary_uom_flag, --7.是否主要单位  
  23.  prm_line.product_precedence, --8.优先顺序  
  24.  prm_line.interface_action_code, --9.操作方式  
  25.  prm_line.process_flag, --10.处理标志  
  26.  prm_line.process_status_flag, --11.处理状态  
  27.  prm_line.list_header_id,  
  28.  prm_line.list_line_id); 
原创粉丝点击