zoukankan      html  css  js  c++  java
  • SO中确定工厂的逻辑

    由一个issue进而引起的思考和探究。笔者近日接到一个ticket。当客户在修改SO中客户代码信息时,报错batch no找不到被cancelled.如下:’

    The batch number of item 000020 is cancelled

    Message No. V1255

    image

    点击确认后,系统又报出另外一个error ‘Item 000020: Requirement type can no longer be changed due to prod. order 6004237’

    image

    咋看下,这两个报错毫无关联可言。经过大量的debug后,发现是因为在修改sold to party客户变了,导致工厂重新决定,进而导致的以上的问题。

    那么下面就详细分析下工厂在SO里面是如何决定出来的。以下代码是SO里面关于werks的取值逻辑。

    Main program: SAPFV45P

    INCLUDE: FV45PF0V_VBAP-WERKS_ERMITTELN

    Form: VBAP-WERKS_ERMITTELN

    image

    首先,对于下列两种情况在order change时不会重新确定工厂的,

    1. Configurable material will not be re-determined for plant.
    2. Order type category 为'D' item proposal时不会re-determine plant.

    决定工厂时顺序:

    1. 订单手工输入的werks优先级最高, 如果订单werks 不为空,则直接跳过下面的检查取值

    clip_image001

    2. 订单抬头的delivery plant输入的情况,且vbap-werks为空。

    clip_image002

    clip_image003

    3. 针对有bill of material bom的情况,即有上下级别item level时;下级的item会自动取上级的plant作为delivery plant

    image

    20行item自动取10行Plant。

    image

    该物料主数据里面维护的为CN01,并没有取这里,而是来自其上级。

    image

    再看个例子,这里ship to 里面维护的工厂为CN01; 且CNINSTALL 物料里面也是CN01. 但系统依然取其上级的plant作为delivery plant.

    image

    4. customer material infor record里面; table KNMT-werks

    image

    5. 从ship to party 决定; 如果ship to party里面维护了shipping plant而且vbap-werks 为空(对于order change的情况,当修改sold to或ship to 等信息时会清空该值,然后重新确定;可以说当sold to 修改了基本上很多表都会清空然后重新赋值)

    该案例当中的工厂取ship to party里面的CN01, 这时就报batch number was cancelled. 因为这时候vbap-werks = CN01. 而该batch number根本就不存在CN01中。

    点击确认后,报错。Item 000020: Requirement type can no longer be changed due to prod. order 6004237

    这是因为该物料在CN01工厂下的strategy group为空,mrp type = ND; 根据系统设定,requirement type变成了011, 所以系统认为这时要修改requirement type, 然而对于mto 来讲,该SO+Item已经有工单,且blue了。所以不能修改requirement type.

    clip_image001[5]

    clip_image002[5]

    clip_image003[5]

    clip_image004

    或者是在修改sold to party信息后,点击don't re-determine plant / shipping point.这样,工厂就不会取ship to 里面的了。

    clip_image001[7]

    这里要补充一点,倘若ship to party里面维护了工厂,但该物料不存在该工厂中,那么就会去物料主数据中的delivery plant.继续下面的取值逻辑。

    6. 从物料主数据中决定plant. 如果上面没有取到,即vbap-werks为空时,会走该逻辑。取物料销售视图里面维护的shipping plant.

    clip_image001[9]

    clip_image002[7]


    7. 最后如果以上条件都没有取到工厂,那么就会把*vbap-werks即现有item 上面带的plant赋值给vbap-werks.(这种仅仅是对于order change的)

    clip_image003[7]


    2020-12-15 @changzhou

  • 相关阅读:
    web http协议
    swoole udp
    swoole线程和进程
    SVN中trunk,branches,tags用法详解
    mysql外键使用和事物使用
    xml
    dedecms开启报错
    Django CBV方法装饰器
    Django Cookie和Session
    ORM基础5
  • 原文地址:https://www.cnblogs.com/chrisrockdl/p/14138803.html
Copyright © 2011-2022 走看看