销售订单BOM组件分配(CP_BD_DIRECT_INPUT_PLAN_EXT)

转自:http://www.baidusap.com/abap/function/520

1, 销售订单BOM组件分配前台操作

Tcode:CA02,输入物料,工厂,销售订单以及行项目,回车进入下一屏幕

点击组件分配按钮

选中要分配的行,点击 new assignment按钮,输入operation

保存。

2, CP_BD_DIRECT_INPUT_PLAN_EXT参数介绍

可以通过调用函数CP_BD_DIRECT_INPUT_PLAN_EXT实现销售订单BOM的组件分配,函数参数如下:

1, 输入参数

RC271_EX_IMP:

下图 routing head details中可以找到group和group counter

RC27M_EX:

SAVE_DI_IMP:

2, 组件分配相关tables参数

PLMZ_DI_EX_TAB:

          注意:BOMAT字段-->当bom header material(截图中编号18处)是phantom件(截图中编号19处勾上),需要向父层上找,一直找到不是phantom件的父层物料为止,

3, 例子程序

给销售订单BOM 940602-01的10行组件57432049分配0030的operation

程序如下:

REPORT ztest_component_allocate.

DATA:l_rc271_ex_imp     TYPE rc271_ex,
     l_rc27m_ex_imp     TYPE rc27m_ex,
     l_save_di_imp      TYPE save_di,
     lit_err            TYPE STANDARD TABLE OF cmfmsg,
     lwa_err            TYPE cmfmsg,
     lit_err_di         TYPE STANDARD TABLE OF error_di,
     lwa_err_di         TYPE error_di,
     lit_plmz           TYPE STANDARD TABLE OF plmz_di_ex,
     lwa_plmz           TYPE plmz_di_ex,
     lit_rcuob2         TYPE STANDARD TABLE OF rcuob2,
     lit_rcuob1_ex      TYPE STANDARD TABLE OF rcuob1_ex,
     lit_plko           TYPE STANDARD TABLE OF plko_di_ex,
     lit_mapl           TYPE STANDARD TABLE OF mapl_di_ex,
     lit_plpo           TYPE STANDARD TABLE OF plpo_di_ex,
     lit_plfl           TYPE STANDARD TABLE OF plfl_di_ex,
     lit_plfh           TYPE STANDARD TABLE OF plfh_di_ex,
     lit_text           TYPE STANDARD TABLE OF txt_obj_ex,
     lit_text_di_tab    TYPE STANDARD TABLE OF tline,
     lit_obj_null_field TYPE STANDARD TABLE OF obj_nfield.

*   相关notes:Notes 1944995
l_rc271_ex_imp-tcode = ‘CA02‘.
CALL FUNCTION ‘CONVERT_DATE_TO_EXTERNAL‘
  EXPORTING
    date_internal            = sy-datum
  IMPORTING
    date_external            = l_rc271_ex_imp-sttag
  EXCEPTIONS
    date_internal_is_invalid = 1
    OTHERS                   = 2.

l_rc271_ex_imp-werks = ‘8800‘.
l_rc271_ex_imp-plnnr = ‘50001594‘.
l_rc271_ex_imp-plnal = ‘01‘.
l_rc271_ex_imp-vbeln = ‘0690000006‘.
l_rc271_ex_imp-posnr = ‘000100‘.

l_rc27m_ex_imp-werks = ‘8800‘.
CALL FUNCTION ‘CONVERSION_EXIT_MATN1_INPUT‘
  EXPORTING
    input        = ‘940602-01‘
  IMPORTING
    output       = l_rc27m_ex_imp-matnr
  EXCEPTIONS
    length_error = 1
    OTHERS       = 2.

l_save_di_imp-save_error = ‘X‘.
l_save_di_imp-syn_save   = ‘X‘.

REFRESH:lit_plmz.
CLEAR:lwa_plmz.
lwa_plmz-acttyp = ‘H‘.               "create
lwa_plmz-plnal  = ‘01‘.              "Group Counter
lwa_plmz-plnfl  = ‘000000‘.          "Sequence
lwa_plmz-plnkn  = ‘00000000‘.        "Node number (batch input)
lwa_plmz-vornr  = ‘0030‘.            "Operation/Activity Number
lwa_plmz-stlty  = ‘K‘.               "BOM category:order bom
lwa_plmz-stlnr  = ‘00001094‘.        "Bill of material
lwa_plmz-stlal  = ‘01‘.              "Alternative BOM
lwa_plmz-stlkn  = ‘00000001‘.        "Node number (batch input)
lwa_plmz-posnr  = ‘0010‘.            "BOM Item Number
*       "Material Number components
CALL FUNCTION ‘CONVERSION_EXIT_MATN1_INPUT‘
  EXPORTING
    input        = ‘57432049‘
  IMPORTING
    output       = lwa_plmz-matnr
  EXCEPTIONS
    length_error = 1
    OTHERS       = 2.
lwa_plmz-werks  = ‘8800‘.             "plant
lwa_plmz-stlst  = ‘1‘.                "Order level
lwa_plmz-stlwg  = ‘1‘.                "Order path
CALL FUNCTION ‘CONVERSION_EXIT_MATN1_INPUT‘
  EXPORTING
    input        = ‘940602-01‘
  IMPORTING
    output       = lwa_plmz-bomat
  EXCEPTIONS
    length_error = 1
    OTHERS       = 2.
* stlnr_w  stlal_w stlty_w是上层物料BOM和Alternative BOM,
* 如果上层物料是Phantom件,接着向上找,一直找到非Phantom件
lwa_plmz-stlnr_w = ‘00001093‘.        "
lwa_plmz-stlal_w = ‘01‘.              "
lwa_plmz-stlty_w = ‘K‘.               "
lwa_plmz-stlan   = ‘1‘.               "BOM Usage
APPEND lwa_plmz TO lit_plmz.
REFRESH:lit_err,
        lit_obj_null_field.
CALL FUNCTION ‘CP_BD_DIRECT_INPUT_PLAN_EXT‘
  EXPORTING
    rc271_ex_imp              = l_rc271_ex_imp
    rc27m_ex_imp              = l_rc27m_ex_imp
    save_di_imp               = l_save_di_imp
  TABLES "MAPL_DI_EX_TAB
    plko_di_ex_tab            = lit_plko[]
    mapl_di_ex_tab            = lit_mapl[]
    plpo_di_ex_tab            = lit_plpo[]
    plfl_di_ex_tab            = lit_plfl[]
    plfh_di_ex_tab            = lit_plfh[]
    text_obj_di_ex_tab        = lit_text[]
    text_di_tab               = lit_text_di_tab[]
    knowl_alloc_di_ex_tab     = lit_rcuob2[]
    knowl_alloc_obj_di_ex_tab = lit_rcuob1_ex[]
    plmz_di_ex_tab            = lit_plmz[]
    obj_null_field_tab        = lit_obj_null_field[]
    error_plan_di_tab         = lit_err_di[]
    error_plan_tab            = lit_err[].

LOOP AT lit_err INTO lwa_err.
  "error handling
ENDLOOP.

程序运行结果,30的operation分配成功

以上。

原文地址:https://www.cnblogs.com/rainysblog/p/12110471.html

时间: 2024-10-11 06:38:30

销售订单BOM组件分配(CP_BD_DIRECT_INPUT_PLAN_EXT)的相关文章

未清销售订单及预测的所有工序物料需求(按BOM展开不考虑已发料)

--按截止日考虑库存分配(所有物料及工序) DECLARE @dueDate DATETIME --截止交期 SELECT @dueDate = T0.T_DueDate FROM OFPR T0 WHERE T0.T_DueDate = [%0] SELECT @dueDate = '[%0]' --------------------------------------------------------------------------------------------- -- ===

[SAP ABAP开发技术总结]SD销售订单定价过程

目录导航 声明:原创作品,转载时请注明文章来自SAP师太博客,并以超链接形式标明文章原始出处,否则将追究法律责任!原文出自: 16.3.2.     定价过程... 141 16.3.2.1.           条件技术七要素... 141 16.3.2.2.           条件表V/03.V/04.V/05. 142 16.3.2.3.           存取顺序 V/07. 142 16.3.2.4.           条件类型 V/06. 142 16.3.2.5.      

成功建立销售订单必须做好的配置

一.VA01界面進來的時候提示產品組不在工廠和分銷渠道的范圍內 解决方法: 在建立销售单之前,得建好销售区域和销售组 a:建立销售区域 SPRO->企业结构->定义->销售和分销->维护销售办公室 b:建立销售组 SPRO->企业结构->定义->销售和分销->维护销售组 把建立好的销售区域和销售组分配给销售区域和办公室 C:办公室分配给销售区域 SPRO->企业结构->分配->销售和分销->给销售范围分配销售办公室 D:分销组分配办公

转载]SAP囚徒 - 通过销售订单领用到成本中心,FI替代

转载]SAP囚徒 - 通过销售订单领用到成本中心,FI替代 原文地址:SAP囚徒 - 通过销售订单领用到成本中心,FI替代实现不同成本中心记账科目不同作者:SAP囚徒 物品领用通常是库存管理的范畴,直接移动类型201计入成本中心即可:但是也有通过销售订单直接领用到成本中心,记费用科目,比如:给客户送少量的样品可以使用销售订单的成本中心来是实现(公司直接送东西给客户有偷税的嫌疑,这里忽略不计): 系统操作步骤如下: 1.VA01创建可以录入成本中心的免费订单 2.VL01N.VL02N对销售订单过

销售订单、外向交货单、交货 bapi

转自[http://www.cnblogs.com/elegantok/archive/2009/10/18/1585398.html]***********SALES ORDER INPUT CREATION. REPORT soi. PARAMETERS: p_auart TYPE auart OBLIGATORY.PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.PARAM

BAPI 修改销售订单的方法 ‘BAPI_SALESORDER_CHANGE’

(原创)BAPI 修改销售订单的方法 ‘BAPI_SALESORDER_CHANGE’ 2009-08-21 16:22:55 分类: Linux sap 标准程序中可以使用VA02来修改销售订单 change sales order,也可以在程序中调用BAPI来更改订单(如物料编号material,订购数量 order quantity等),用到的函数是 BAPI_SALESORDER_CHANGE.sap bapi Explorer中的文档.   Method SalesOrder.Chan

销售订单-修改量-高级定价关联sql

修改量消耗明细 --修改量消耗明细 SELECT t.name, t.comments, t.version_no, cux_rebate_pub.get_hou_name(p_organization_id => t.orig_org_id) org_name, ac.customer_name, --ql.amount "限额", -- qlb.limit_balance_id, qlb.consumed_amount "总消耗", qlb.availab

AR_销售订单收款基本操作(流程)

2014-06-04 BaoXinjian 一.步骤 1. 输入销售订单,输入(Enter)-->预定(Book)-->计划(Schedule)-->保留(Reserve) 2. 进行挑库操作, 挑库(Pick Release)-->挑库确认(Pick Confirm) 3. 制作发运单,制作发运单(Create Delivery)-->发运确认(Ship Confirm) 4. 程式停靠接口(Interface Trip Stop) 5. 关闭订单, 启动workflow处

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