BW转换中建立树递归模型算法计算BOM结构中物料MB

In the start routine transformation ZPP_O55->ZPP_C55

*$*$ begin of 2nd part global - insert your code only below this line  *
*begin add by zhangj26 for crd1112 on 26-Apr-2011
*global part data defination and perform in the global part2.
TYPES: BEGIN OF ty_chil,
        children TYPE /bi0/oimaterial,
       END OF ty_chil.

TYPES ty_t_chil TYPE STANDARD TABLE OF ty_chil.

TYPES:  BEGIN OF ty_node,
        node TYPE  /bi0/oimaterial,
        plant TYPE /bi0/oiplant,
        END OF ty_node.

DATA: BEGIN OF tree ,
       plant TYPE /bi0/oiplant,
       node TYPE /bi0/oimaterial,
       t_children TYPE STANDARD TABLE OF ty_chil,
       parent TYPE  /bi0/oimaterial,
       qty TYPE /bic/oizcomp_qty, "QUANTITY
       stock TYPE /bic/oizclabs_n1, " Unrestricted use
       maxbuild TYPE /bic/oizclabs_n2, "max build
      END OF tree.

DATA: t_tree LIKE  STANDARD TABLE OF tree WITH KEY node parent.

DATA: lt_tree LIKE TABLE OF tree WITH KEY node parent,
          wa_tree LIKE LINE OF lt_tree.
*&---------------------------------------------------------------------*
*&      Form  cal_leaf_build
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->leafnode       text
*      -->r_mb           text
*----------------------------------------------------------------------*
FORM cal_leaf_maxbuild USING leafnode LIKE tree
                       CHANGING r_mb TYPE i.
  IF leafnode-qty NE 0.
    r_mb = leafnode-stock /  leafnode-qty.
  ENDIF.

ENDFORM.                    "cal_leaf_maxbuild

*&---------------------------------------------------------------------*
*&      Form  cal_child_maxbuild
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->I_NODE     text
*      -->TREE       text
*      -->MB         text
*----------------------------------------------------------------------*
FORM cal_child_maxbuild USING i_node TYPE /bi0/oimaterial
                      
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值