基于每个组件检查BOM递归

来源:互联网 发布:电脑定时开关机软件 编辑:程序博客网 时间:2024/05/16 19:26

PARAMETERSp_matnr type matnr MODIF ID Z1,
            p_idnrk type idnrk MODIF ID Z2.



*---- Struktur zum Beschaffen der Dispostufe aus Materialstamm
databegin of tma29v occurs 0.
         include structure ma29v.
dataend of tma29v.

*---- Dispostufenvergabe
databegin of tmc29u occurs 0.
         include structure mc29u.
dataend of tmc29u.


*---- Struktur zum Beschaffen der Dispostufe von Materialien ( INPUT )
databegin of tpre03 occurs 0.
         include structure pre03.
dataend of tpre03.

   clear tma29v,
           tmc29u,
           tpre03.

   refresh tma29v,
             tmc29u,
             tpre03.

tpre03-MATNR p_matnr.
append tpre03.

 call function 'MATERIAL_READ_DISST'
        tables ima29v tma29v
               ipre03 tpre03.

   loop at tma29v.
      move-corresponding tma29v to tmc29u.
      append tmc29u.
   endloop.

   call function 'CS_RC_RECURSIVITY_CHECK'
        exporting  eidnrk            p_idnrk
                   emode             '1'
        tables     headertab         tmc29u
        exceptions recursivity_found 1.

   if sy-subrc <> 0.
      message i000(26with 'BOM递归错误!'.
   endif.         
0 0