3

我的程序有问题。我正在使用功能模块CS_BOM_EXPL_MAT_V2来获取材料的 BOM。例如,我有一个MAT1具有 ff 的材料。BOM 爆炸。

MAT1
- COMP1 with Qty 2
- COMP2 with Qty 1
- COMP3 with Qty 1

然后,对于 component COMP1,它也有子组件:

COMP1
- SUBCOMP1 with Qty 1
- SUBCOMP2 with Qty 1

所以我期望在我的程序中使用CS_BOM_EXPL_MAT_V2,是让报告的数量为SUBCOMP1= 2 和SUBCOMP2= 2(因为MAT1使用 2 个数量COMP1)。但是我得到的是SUBCOMP1= 1 qty 和SUBCOMP2= 1 qty,因为我认为它只考虑了 BOM并且没有考虑COMP1数量。COMP1

运行 transactionCS12时,material 的输出是正确的 ( SUBCOMP1= 2, SUBCOMP2= 2) MAT1

那么,我如何进行CS_BOM_EXPL_MAT_V2工作以使其尊重组件的计数,在这种情况下COMP1为 Qty 2,并将值级联到子组件,在这种情况下为SUBCOMP1and SUBCOMP2,并将其相乘,以便返回正确的数量,在这种情况下,两个子组件都应该有数量 2,就像在交易中一样CS12

如果 FM 无法做到这一点CS_BOM_EXPL_MAT_V2,请提出其他方法来实现这一点。

这是我的 FM 目前的样子:

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
  EXPORTING
    aumgb                 = 'X'
    capid                 = 'PP01'
    datuv                 = v_datuv "date input in selection screen
    endhl                 = '1'
    mehrs                 = 'X'
    mmory                 = '1'
    mtnrv                 = v_matnr "material input in selection screen
    stlal                 = v_stlal "alternative BOM input in selection screen
    stpst                 = 0 "Level in multi-bom expl.
    svwvo                 = 'X'
    werks                 = v_werks "plant input in selection screen
    vrvso                 = 'X'
  IMPORTING
    topmat                = gs_top
  TABLES
    stb                   = gt_stb
    matcat                = gt_matca
  EXCEPTIONS
    alt_not_found         = 1
    call_invalid          = 2
    material_not_found    = 3
    missing_authorization = 4
    no_bom_found          = 5
    no_plant_data         = 6
    no_suitable_bom_found = 7
    conversion_error      = 8
    OTHERS                = 9.
4

2 回答 2

1

这是 Laurent Fournier 在 snc.sap.com 上给出的答案。这对我很有帮助,因此我想把它保存在这里。

I think that you must set multilevel indicator. Take a look at the following code and see if this can help you.

FORM EXPLODE_BOM  USING U_DATE
                        U_MATNR
                        U_MENGE
                        U_WERKS
                        U_MULTI
                CHANGING   C_SUCCESS.

  CLEAR : C_SUCCESS.

  CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
*   FTREL                       = ' '
*   ALEKZ                       = ' '
*   ALTVO                       = ' '
*   AUFSW                       = ' '
    AUMGB                       = 'X'
*   AUMNG                       = 0
    AUSKZ                       = ' '
*   AMIND                       = ' '
*   BAGRP                       = ' '
*   BEIKZ                       = ' '
*   BESSL                       = ' '
*   BGIXO                       = ' '
*   BREMS                       = ' '
    CAPID                       = 'PP01'
*   CHLST                       = ' '
*   COSPR                       = ' '
*   CUOBJ                       = 000000000000000
*   CUOVS                       = 0
*   CUOLS                       = ' '
    DATUV                       = U_DATE
*   DELNL                       = ' '
*   DRLDT                       = ' '
*   EHNDL                       = ' '
*   EMENG                       = 0
*   ERSKZ                       = ' '
*   ERSSL                       = ' '
*   FBSTP                       = ' '
*   KNFBA                       = ' '
*   KSBVO                       = ' '
*   MBWLS                       = ' '
*   MKTLS                       = 'X'
*   MDMPS                       = ' '
    MEHRS                       = U_MULTI
*   MKMAT                       = ' '
*   MMAPS                       = ' '
*   SALWW                       = ' '
*   SPLWW                       = ' '
*   MMORY                       = ' '
    MTNRV                       = U_MATNR
*   NLINK                       = ' '
*   POSTP                       = ' '
*   RNDKZ                       = ' '
*   RVREL                       = ' '
*   SANFR                       = ' '
*   SANIN                       = ' '
*   SANKA                       = ' '
*   SANKO                       = ' '
*   SANVS                       = ' '
*   SCHGT                       = ' '
*   STKKZ                       = ' '
*   STLAL                       = '1'
*   STLAN                       = '1'
    STPST                       = 0
*   SVWVO                       = 'X'
    WERKS                       = U_WERKS
*   NORVL                       = ' '
*   MDNOT                       = ' '
*   PANOT                       = ' '
*   QVERW                       = ' '
*   VERID                       = ' '
*   VRSVO                       = 'X'

*  IMPORTING
*   TOPMAT                      =
*   DSTST                       =
    TABLES
    STB                         = BOM_EXPL
*   MATCAT                      =

   EXCEPTIONS
    ALT_NOT_FOUND               = 1
    CALL_INVALID                = 2
    MATERIAL_NOT_FOUND          = 3
    MISSING_AUTHORIZATION       = 4
    NO_BOM_FOUND                = 5
    NO_PLANT_DATA               = 6
    NO_SUITABLE_BOM_FOUND       = 7
    CONVERSION_ERROR            = 8
    OTHERS                      = 9
于 2018-09-18T14:31:10.867 回答
0

我认为如果你用 X 标记 AUMGB ( Ausschussmenge berechnen ) 字段,你应该在结果中得到计算的数量。检查名为 STB 的表(表类型 STPOX [为列表显示扩展的 BOM 项目])字段 MNGLG(以基本计量单位计算的组件数量)。场门格应携带基础数量。

于 2019-07-04T08:35:34.593 回答