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
*$*$ 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