码迷,mamicode.com
首页 > 其他好文 > 详细

顺查BOM(展开BOM清单、CS12)与逆查BOM(查上层物料、CS15)

时间:2015-08-05 10:45:55      阅读:1481      评论:0      收藏:0      [点我收藏+]

标签:sap cs12   sap cs15   cs_bom_expl_mat_v2   cs_where_used_mat   abap cs12 cs15   

1.顺查BOM

CALL FUNCTION ‘CS_BOM_EXPL_MAT_V2‘
    EXPORTING
       capid = pm_capid “应用程序一般为PP01
       datuv = pm_datuv “通常为系统的当前日期
       mtnrv = pm_mtnrv “要展开BOM的物料
       mehrs = ‘X‘ “ x表示多层展开﹐space表示只展开第一层
       werks = pm_werks “通常为1000
    IMPORTING
       topmat = selpool
       dstst = dstst_flg
    TABLES
       stb = stb “展开的BOM存放在该内表
       matcat = matcat “下面含有元件的物料存放在该内表

2.逆查BOM

DATA: IT_WULTB LIKE STPOV OCCURS 0 WITH HEADER LINE,
        IT_EQUICAT LIKE CSCEQUI OCCURS 0 WITH HEADER LINE,
        IT_KNDCAT LIKE CSCKND OCCURS 0 WITH HEADER LINE,
        IT_MATCAT LIKE CSCMAT OCCURS 0 WITH HEADER LINE,
        IT_STDCAT LIKE CSCSTD OCCURS 0 WITH HEADER LINE,
        IT_TPLCAT LIKE CSCTPL OCCURS 0 WITH HEADER LINE,
        IT_PRJCAT LIKE CSCPRJ OCCURS 0 WITH HEADER LINE.

  CLEAR:IT_WULTB,IT_WULTB[].
  CALL  FUNCTION  ‘CS_WHERE_USED_MAT‘
     EXPORTING
      DATUB              = SY-DATUM
      DATUV              = SY-DATUM
      MATNR              = P_C_MATNR
*     POSTP               = ‘ ‘
*     RETCODE_ONLY        = ‘ ‘
*     STLAN               = ‘ ‘
      MCLMT              = ‘00000000‘
      WERKS              = S2_WERKS
*    IMPORTING
*    TOPMAT              =
     TABLES
          WULTB           = IT_WULTB
          EQUICAT         = IT_EQUICAT
          KNDCAT          = IT_KNDCAT
          MATCAT          = IT_MATCAT
          STDCAT          = IT_STDCAT
          TPLCAT          = IT_TPLCAT
     EXCEPTIONS
          CALL_INVALID        = 1
          MATERIAL_NOT_FOUND          = 2
          NO_WHERE_USED_REC_FOUND     = 3
          NO_WHERE_USED_REC_SELECTED = 4
          NO_WHERE_USED_REC_VALID     = 5
          OTHERS              = 6.

版权声明:本文为博主原创文章,未经博主允许不得转载。

顺查BOM(展开BOM清单、CS12)与逆查BOM(查上层物料、CS15)

标签:sap cs12   sap cs15   cs_bom_expl_mat_v2   cs_where_used_mat   abap cs12 cs15   

原文地址:http://blog.csdn.net/champaignwolf/article/details/47291231

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!