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: 

CS_BOM_EXPL_MAT_V2

Former Member
0 Kudos

Dear All,

I am using CS_BOM_EXPL_MAT_V2 to get BOM details.

See sample code below.

It's not working.

Please tell me how can I get group BOM detail.

Regards,

Nikhil Gupta

*****************************************************

sample code:

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

capid = 'PP01'

datuv = sy-datum

mehrs = 'X'

mtnrv = ls_matnr

postp = ' '

TABLES

stb = int_components2

matcat = int_components

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 REPLIES 4

Former Member
0 Kudos

Hi take a look at the code might help you.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
      EXPORTING
        capid                 = pa_capid
        datuv                 = sy-datum
        mbwls                 = ' '
        mehrs                 = 'X'
*        mmory                 = mem_mngmt
        mtnrv                 = <fs_header>-matnr
        werks                 = <fs_header>-werks
        stlal                = <fs_header>-stlal
      aumgb                   = 'X'
      TABLES
        stb                   = it_stpox
      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.

Regards

Nilesh

Former Member
0 Kudos

Hi,

Actually I want all BOM detail irrespective of plant of material ; It's called group BOM.

how to get Group BOM detail for a material.

Regards,

Nikhil

Former Member
0 Kudos

Create a group BOM with transaction CS07 (without plant). Then it should work with function:


CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
   EXPORTING
*   FTREL                       = ' '
*   ALEKZ                       = ' '
*   ALTVO                       = ' '
*   AUFSW                       = ' '
*   AUMGB                       = ' '
*    AUMNG                       = 0,000
*   AUSKZ                       = ' '
*   AMIND                       = ' '
*   BAGRP                       = ' '
*   BEIKZ                       = ' '
*   BESSL                       = ' '
*   BGIXO                       = ' '
*   BREMS                       = ' '
     capid                       = 'PP01'
*   CHLST                       = ' '
*   COSPR                       = ' '
*   CUOBJ                       = 000000000000000
*   CUOVS                       = 0
*   CUOLS                       = ' '
     datuv                       = datuv  
*   DELNL                       = ' '
*   DRLDT                       = ' '
*   EHNDL                       = ' '
*   EMENG                       = 0
*   ERSKZ                       = ' '
*   ERSSL                       = ' '
*   FBSTP                       = ' '
*   KNFBA                       = ' '
*   KSBVO                       = ' '
*   MBWLS                       = ' '
*   MKTLS                       = 'X'
*   MDMPS                       = ' '
     mehrs                       = mehrs
*   MKMAT                       = ' '
*   MMAPS                       = ' '
*   SALWW                       = ' '
*   SPLWW                       = ' '
*   MMORY                       = ' '
      mtnrv                       = material
*   NLINK                       = ' '
*   POSTP                       = ' '
*   RNDKZ                       = ' '
*   RVREL                       = ' '
*   SANFR                       = ' '
*   SANIN                       = ' '
*   SANKA                       = ' '
*   SANKO                       = ' '
*   SANVS                       = ' '
*   SCHGT                       = ' '
*   STKKZ                       = ' '
*   STLAL                       = ' '
     stlan                       = bom_usage
    STPST                       = 0
*   SVWVO                       = 'X'
     werks                       = plant
*   NORVL                       = ' '
*   MDNOT                       = ' '
*   PANOT                       = ' '
*   QVERW                       = ' '
*   VERID                       = ' '
*   VRSVO                       = 'X'
   IMPORTING
     topmat                      = topmat
*   DSTST                       =
    TABLES
     stb                         = stb
     matcat                      = 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
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Former Member
0 Kudos

Nikil,

Try using the below code. I have used this in one of my program and is working.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

FTREL = ' '

AUFSW = ' '

BREMS = ' '

CAPID = 'PP01' "App ID

DATUV = SY-DATUM

EHNDL = '1'

MBWLS = ' '

MKTLS = 'X'

MEHRS = 'X'" Multi-level

MTNRV = MARA-MATNR

STLAL = STKO-STLAL

STLAN = '1'

WERKS = MARC-WERKS

TABLES

STB = LTAB

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

OTHERS = 8.

Thanks,

Prathap