Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Level BOM Explosion - Superior Mat.

Former Member
0 Kudos

Hello Experts,

I am trying to find superior material of a component in a given Multilevel BOM.

For this, I have extracted the multilevel BOM using FM CS_BOM_EXPLOSION (for SO and Material BOMs).

Now I have to find out the superior material of a given component in the extracted BOM. Can any one suggest how to achieve this?

My logic and challenges:

FM executes with following parameters -

CALL FUNCTION 'CS_BOM_EXPLOSION'

     EXPORTING

       aufsw                       = 'X'

       capid                       = 'PP01'

       cuobj                       = " Int. Obj Number of config

       datuv                       = sy-datum

       emeng                       = 1

       mehrs                       = 'X'

       mtnrv                       = "Heade Material

       werks                       = "Plant

       vbeln                       = "SO Number

       vbpos                       = "SO Item

IMPORTING

   topequi                     = y_topequi_imp

   topmat                      = y_topmat_imp

   toptpl                      = y_toptpl_imp

   dstst                       = y_dstst_imp

      TABLES

        stbd                       = y_stbd_imp

        stbe                       = y_stbe_imp

        stbk                       = y_stbk_imp

        stbm                       = y_stbm_imp

        stbp                       = y_stbp_imp

        stbt                       = y_stbt_imp

     EXCEPTIONS

       alt_not_found               = 1

       call_invalid                = 2

       missing_authorization       = 3

       no_bom_found                = 4

       no_plant_data               = 5

       no_suitable_bom_found       = 6

       object_not_found            = 7

       conversion_error            = 8

       OTHERS                      = 9.

Issue I am facing: BOM component data in table 'stbp = y_stbp_imp' is getting filled with this function module.

But the 'Addition to the item collective table (STBM = y_stbm_imp, which contains the material list)' is not gettng filled.

Can anyone help me with export patameters to have data in STBM table?

Best Regards

Kranthi

1 REPLY 1

pavanm592
Contributor
0 Kudos

Hi Kranthi,

You Can Try this FM For multi level BOM Explosion

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

     EXPORTING

*     aumgb                 = 'X'

       capid                 = p_capid

       datuv                 = sy-datum "lv_date

       ehndl                 = '1'

       emeng                 = p_emeng

       mehrs                 = 'X'

       mmory                 = '1'

       mtnrv                 = gs_mara-matnr

       svwvo                 = ' '

       stpst                 = '0'

       stlan                 = p_stlan

       werks                 = p_werks

       vrsvo                 = ' '

     IMPORTING

       topmat                = ls_topmat

       dstst                 = ls_dstst

     TABLES

       stb                   = gt_stb

*     MATCAT                =

     EXCEPTIONS                                              "#EC FB_RC

       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.

Regards,

Pavan