CS_BOM_EXPL_MAT_V2

HI,
I would like get the BOM list for an materialnumber. At the import parameters , when I don´t set the parameter DATUV, I get an error. I don´t understand why. I want dont´t set this parameter, because then I get just the components of the BOM at this date and not valid from this date. Is there other Function Modules?
regards

Hi MurugeshRajeev,
I developed the following program. I dont wrote here the DATA deklaration. You can do it with your own parameter that you need. I select as optional the positions of the bomlist if the user need it in this function. I got the right bomlist with the function. I hope it helps you.
I have a Function with  parameter:
*"  IMPORTING
*"     VALUE(MATERIALNUMMER) TYPE  MAST-MATNR
*"     VALUE(STLAN) TYPE  MAST-STLAN
*"     VALUE(STLAL) TYPE  MAST-STLAL
*"     VALUE(POSID) TYPE  STPO-STLKN OPTIONAL
*"     VALUE(STLNR) TYPE  STPO-STLNR OPTIONAL
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRET2-MESSAGE
*"  TABLES
*"      STB STRUCTURE  STPO
*"      STBP STRUCTURE  STPO
this is the code:
SELECT  STLNR
FROM MAST
Into p_stlnr
WHERE MATNR EQ MATERIALNUMMER AND
      STLAN EQ STLAN AND
      STLAL EQ STLAL.
if posid is initial.
     call function 'CS_BOM_EXPL_MAT_V2'
       exporting
  FTREL                       = ' '
  ALEKZ                       = ' '
  ALTVO                       = ' '
  AUFSW                       = ' '
  AUMGB                       = ' '
  AUMNG                       = 0
  AUSKZ                       = ' '
  AMIND                       = ' '
  BAGRP                       = ' '
  BEIKZ                       = ' '
  BESSL                       = ' '
  BGIXO                       = ' '
  BREMS                       = ' '
         capid                       = 'BEST'
  CHLST                       = ' '
  COSPR                       = ' '
  CUOBJ                       = 000000000000000
  CUOVS                       = 0
  CUOLS                       = ' '
         datuv                       = sy-datum
  DELNL                       = ' '
  DRLDT                       = ' '
  EHNDL                       = ' '
        emeng                       = pemeng
  ERSKZ                       = ' '
  ERSSL                       = ' '
  FBSTP                       = ' '
  KNFBA                       = ' '
  KSBVO                       = ' '
  MBWLS                       = ' '
  MKTLS                       = 'X'
  MDMPS                       = ' '
      mehrs                       = 'X'
  MKMAT                       = 'X'
  MMAPS                       = ' '
  SALWW                       = ' '
  SPLWW                       = ' '
  MMORY                       = ' '
      mtnrv                       = materialnummer
  NLINK                       = ' '
  POSTP                       = ' '
  RNDKZ                       = ' '
  RVREL                       = ' '
  SANFR                       = ' '
  SANIN                       = ' '
  SANKA                       = ' '
  SANKO                       = ' '
  SANVS                       = ' '
  SCHGT                       = ' '
  STKKZ                       = ' '
   stlal                       = '01'
   STLAN                       = '3'
   STPST                       = '1'
  SVWVO                       = 'X'
      werks                       = '0001'
  NORVL                       = ' '
  MDNOT                       = ' '
  PANOT                       = ' '
  QVERW                       = ' '
   verid                       = pverid
  VRSVO                       = 'X'
IMPORTING
  TOPMAT                      =
  DSTST                       =
      tables
       stb                         = istb
  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.
     RETURN = No partlist.
      endif.
LOOP AT istb.
    SELECT SINGLE * FROM stpo INTO stb
    WHERE stlnr = p_stlnr AND
          stlkn = istb-stlkn AND
          stpoz = istb-stpoz AND
          stvkn = istb-stvkn.
          append stb.
endloop.
else.
SELECT *
from stpo
into wa_bkpff
where stlnr EQ stlnr AND
      stlkn EQ posid.
append wa_bkpff to stbp.
endselect.
endif.
ENDFUNCTION.
ENDSELECT.
regards
Sabine

Similar Messages

  • What are minimum passing parameters for function module CS_BOM_EXPL_MAT_V2

    Hi
    Im going to use FM: CS_BOM_EXPL_MAT_V2 and I want to only pass WERKS, but when I execute FM is gives exception as CALL_INVALID.
    I saw all the Import parameters are Optional, but I think I need to pass more inputs to FM.
    Please let me know what are MINIMUM input parameters required to run this FM
    Thanks

    Hi
    In my requirement, there are range of WERKS and MATNR which has to be given from selection screen, where as In CS_BOM_EXPL_MAT_V2 function module I can only give single value for WERKS and MATNR.
    Can any one guide me how can I implement this?

  • Short dump using CS_BOM_EXPL_MAT_V2 with different user ids

    Hi
    We are getting a short dump in our program when using FM'CS_BOM_EXPL_MAT_V2' and this is happening only for super user roles but not with regular user ids in production. We are not able to identify the solution yet, and it needs to be resolved as quickly as possible. Anyhelp, really appreciated.
    Thanks
    Anil
    Here is our code:
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          aumgb                 = 'X'
          capid                 = 'PP01'
          datuv                 = p_valfrm
          ehndl                 = '1'
          emeng                 = 1
          mbwls                 = ' '
          mehrs                 = 'X'
          mmory                 = '1'
          mtnrv                 = p_matnr
          stlal                 = p_stlal
          stlan                 = p_stlan
          werks                 = p_werks
        TABLES
          stb                   = i_stb
          matcat                = i_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.

    Hi senthil,
    1. I suppose u want to explode the BOM.
    2. CS_BOM_EXPLOSION
       use the above FM
       in the below mentioned fashion.
    3.
      CALL FUNCTION 'CS_BOM_EXPLOSION'
       EXPORTING
       capid                       = 'PP01'
       emeng                       = bmeng
       datuv                       = sy-datum
       mtnrv                       = matnr
       stlan                       = '1'
         werks                       =  werks
         mehrs = 'X'
    IMPORTING
      TOPEQUI                     =
      TOPMAT                      =
      TOPTPL                      =
      DSTST                       =
        TABLES
          stbd                        = stbd
          stbe                        = stbe
          stbk                        = stbk
          stbm                        = stbm
          stbp                        = stbp
          stbt                        = stbt
    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
    regards,
    amit m.

  • How to use CS_BOM_EXPL_MAT_V2  to include bom under Phantom

    Hi every1,
    How can I get documentation for this function module CS_BOM_EXPL_MAT_V2 
    We want to explode BOM on single level ,including Material which is coming under Phantom assembly too.
    eg. I have one material 1xxxxx.
    after exploding single level bom suppose I'll get these material
    1xxxx1
    1xxxx2
    1xxxx3 and if 1xxxx3 is Phantaom assembly and under this item again I may have 1xxxx1 as bom item.
    that means for my parent material 1xxxxx, I want 1xxxx1 should come 2 times !
    Is there any simpliest way to get or for this item again I need to use this FM again ?
    Pl. do help me.
    Thanks in Advance.

    Hi,
    THE FM 'CS_BOM_EXPLOSION_MAT' mentioned above holds true if u dont hv any alternatives for the BOM.
    eg: If ur component in turn has BOM with 3 alternatives namely 01,02,03
    then ideally FM should pick all the items uder these 3 components but this FM picks by default the 1st
    alternative & ignores the rest.
    So there are changes dat the list which u hv gpt is not 100%.          
      Through Tcode CS12 u can see the level wise components for a BOM.
    U can gather the component details with this Tcode if u hv very few BOMs to explore.
    But if the count is higher u hv to select acoding way for it....
    Attaching a part of code to explore multilevel BOM.....hope dis ll help u......
    1 ST LEVEL
      SELECT MATNR  WERKS  STLNR  IDNRK  STLAL
            FROM ZMAT_PLANT
           INTO TABLE IT_BOM
           FOR ALL ENTRIES IN IT_INPUT    **maintain materials to be explored in IT_INPUT
           WHERE WERKS = IT_INPUT-WERKS AND
                 MATNR = IT_INPUT-MATNR.
      CONCATENATE DOWNLOAD
                  '1_FILE'
                  '.TXT'
                  INTO DOWNLOAD1.
      LOOP AT IT_BOM ASSIGNING <FS_BOM>.
        MOVE <FS_BOM>-MATNR TO IT_CHECK_MAT-MATNR.
        MOVE <FS_BOM>-WERKS TO IT_CHECK_MAT-WERKS.
        APPEND IT_CHECK_MAT.
        COUNT = COUNT + 1.
      ENDLOOP.
      SORT IT_CHECK_MAT BY MATNR WERKS.
      DELETE ADJACENT DUPLICATES FROM IT_CHECK_MAT COMPARING MATNR WERKS.
    2 ND LEVEL
      IF NOT IT_BOM[] IS INITIAL.
        SELECT *
             FROM ZCOMPONENTS
             INTO TABLE IT_STPO
                   FOR ALL ENTRIES IN IT_BOM
                   WHERE MATNR = IT_BOM-IDNRK AND
                         WERKS = IT_BOM-WERKS.
      ENDIF.
      SORT IT_STPO BY MATNR WERKS.
      CONCATENATE DOWNLOAD
                  '2_FILE'
                  '.TXT'
                  INTO DOWNLOAD1.
      LOOP AT IT_STPO ASSIGNING <FS_STPO>.
       MOVE <FS_STPO>-MATNR TO IT_CHECK_MAT-MATNR.
        MOVE <FS_STPO>-WERKS TO IT_CHECK_MAT-WERKS.
        APPEND IT_CHECK_MAT.
        COUNT = COUNT + 1.
      ENDLOOP.
      UNASSIGN <FS_STPO>.
      SORT IT_CHECK_MAT BY MATNR WERKS.
      DELETE ADJACENT DUPLICATES FROM IT_CHECK_MAT COMPARING MATNR WERKS.
      SORT IT_STPO BY IDNRK WERKS.
      LOOP AT IT_STPO.
        READ TABLE IT_CHECK_MAT WITH KEY MATNR = IT_STPO-IDNRK
                                         WERKS = IT_STPO-WERKS
                                              BINARY SEARCH.
        IF SY-SUBRC <> 0.
          MOVE IT_STPO-IDNRK TO IT_STPO1-MATNR.
          MOVE IT_STPO-WERKS TO IT_STPO1-WERKS.
          APPEND IT_STPO1.
        ENDIF.
        COUNT = COUNT + 1.
      ENDLOOP.
    REGARDS ,
    AJIT.
    Edited by: AJIT THAKUR on Apr 16, 2009 10:51 AM
    Edited by: AJIT THAKUR on Apr 16, 2009 10:54 AM

  • Using CS_BOM_EXPL_MAT_V2 how to find last children of material in the bom.

    Hi,
    I want to find last children of a material.I am using FM CS_BOM_EXPL_MAT_V2. Although STPOX internal table as STUFE for level but we can't get all the last child of material directly.
    For example material A as child A1 and A2 this sub divided into A1- A11, A12 and A2 - A21 , A22 and again A21 -A211,A212 and A22 - A221,A222
    so the last children are A11,A12,A211,A212,A221,A222. So if we use max of STUFE it will omit A11 and A12.Do i need to program a custom logic to get last child using Stufe and WEGXX or is there any other method available to get Last Children of the Material or is there any other Function module to get the Last child of the material.
    Thanks in Advance.

    You will have to write your own custom logic after calling the function module.  In my case, it is easy, because the lowest level materials will always be raw materials(material type ZROH) as opposed to a semi-finished material(material type HALB).  Your's may be different.
    REgards,
    Rich Heilman

  • Function module CS_BOM_EXPL_MAT_V2 Documentation

    I cannot find any documentation for function module CS_BOM_EXPL_MAT_V2.  It is a very powerful function module, however, it is not useful without documentation.  I know that it can do single level boms as well as multi level and a host of other things, but I can only guess without documentation.  Do you know where I can get documentation for this function module. 
                        thank you in advance, Leonard Getz, Dy4 Systems Inc. Ottawa, Ontario, Canada.

    This is what I found:
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2' "BOM explosion for material
    EXPORTING
      ftrel = SPACE               " csdata-xfeld  Limited multi-level - stop explosion at items not relevant to production
      aufsw = SPACE               " csdata-xfeld  Determine and enter order level and channel
      aumgb = SPACE               " csdata-xfeld  Calculate scrap quantity
      aumng = 0                   " stko-bmeng    Scrap quantity
      auskz = SPACE               " csdata-xfeld  Scrap
      bagrp = SPACE               " mara-matnr    Assembly restriction
      beikz = SPACE               " stpo-beikz    Material provision indicator
      bessl = SPACE               " csdata-xfeld  Material provision selection indicator
      bgixo = SPACE               " csdata-xfeld  Load assembly information for exploded assemblies only
      brems = SPACE               " csdata-xfeld  Limited explosion
      capid = 'STD1'              " tc04-capid    Application ID
      cospr = SPACE               " csdata-xfeld  Internal: (CO) order-spec. MatPreRead
      cuobj = 000000000000000     " marc-cuobj    Configuration
      datuv = 00000000            " stko-datuv    Validity date
      delnl = SPACE               " csdata-xfeld  Delete items not kept in stock from list
      emeng = 0                   " stko-bmeng    Required quantity
      erskz = SPACE               " stpo-erskz    Spare part indicator
      erssl = SPACE               " csdata-xfeld  Spare part selection indicator
      fbstp = SPACE               " csdata-xfeld  Limited multi-level - stop explosion at externally procured item
      mbwls = SPACE               " csdata-xfeld  Read material valuation
      mdmps = SPACE               " csdata-xfeld  Limited multi-level - explode phantom assemblies at least
      mehrs = SPACE               " csdata-xfeld  Multi-level explosion
      mkmat = SPACE               " csdata-xfeld  Limited multi-level; explode KMAT
      mmaps = SPACE               " csdata-xfeld  Limited multi-level - explode at least M assembly (M order)
      mmory = SPACE               " csdata-xfeld  Memory use ('1'=on;'0'=off;' '=no reaction)
      mtnrv = SPACE               " mara-matnr    Material
      postp = SPACE               " stpo-postp    Item category
      rndkz = SPACE               " csdata-xfeld  Round off: ' '=always, '1'=never, '2'=only levels > 1
      rvrel = SPACE               " stpo-rvrel    Relevant to sales
      sanfr = SPACE               " stpo-sanfe    Production
      sanin = SPACE               " stpo-sanin    Maintenance
      sanka = SPACE               " stpo-sanka    Costing
      sanko = SPACE               " stpo-sanko    Engineering/design
      sanvs = SPACE               " stpo-sanvs    Shipping
      schgt = SPACE               " stpo-schgt    Bulk material
      stkkz = SPACE               " stpo-stkkz    PM assembly
      stlal = SPACE               " stko-stlal    Alternative BOM
      stlan = SPACE               " stzu-stlan    BOM usage
      werks = SPACE               " marc-werks    Plant
      mdnot = SPACE               " csdata-xfeld  Restriction on MDMPS: do not explode M phantom
      panot = SPACE               " csdata-xfeld  Restriction on MDMPS: no parallel discontinue
      IMPORTING
        topmat =                    " cstmat        Data for start material
        dstst =                     " csdata-xfeld  Structure destroyed by filter
      TABLES
        stb =                       " stpox         Collective item data table
      matcat =                    " cscmat        Material catalog (sub-assemblies)
      EXCEPTIONS
        ALT_NOT_FOUND = 1           "               Alternative not found
        CALL_INVALID = 2            "               Incorrect parameter combination
        MATERIAL_NOT_FOUND = 3      "               Material not found
        MISSING_AUTHORIZATION = 4   "               No authorization (bill of material)
        NO_BOM_FOUND = 5            "               No BOM for this material
        NO_PLANT_DATA = 6           "               Material not maintained in plant
        NO_SUITABLE_BOM_FOUND = 7   "               BOM does not exist
        .  "  CS_BOM_EXPL_MAT_V2

  • Refresh using CS_BOM_EXPL_MAT_V2 2 times

    Hi,
    my problem is:
    1. use fm CS_BOM_EXPL_MAT_V2 to get BOM data.
    2. I modify the BOM using a Batch Input
    3. use fm CS_BOM_EXPL_MAT_V2 to get the BOM updated.
    the FM in the 3th step load the old data and not the updated BOM.
    Any suggest?
    Can i clear the program cache?

    Hello,
    I'm answering to this threat even though it's 5 years old just in case somebody is looking out for the solution like I was a couple of weeks ago.
    The FM CS_BOM_EXPL_MAT_V2 calls internally another FM called GET_STPO.  Inside GET_STPO you will find structure STPOCTL which will contain material's information for the previous run of CS_BOM_EXPL_MAT_V2. Also, FM GET_STPO calls FM GET_STATS which will contain the structure STASCTL; both these structures need to be cleared in order for the Function Module to retrieve fresh data from the database, instead of just returning the same data that was returned in the first run.
    In the Function Group CSIO, which contains all these Function Modules, there's a Function Module in charge of clearing these structures plus another internal tables which will contain the material's information, you need to call this FM right after your 1st iteration in order to clear the buffer. The Function Module is CSIO_REFRESH_BUFFER or CS_IO_BOM_BUFFER_SMASH, depending on your SAP implementation.
    Hope this helps anyone
    Message was edited by: Matthew Billingham - changed formatting to make more readable

  • Issue with CS_BOM_EXPL_MAT_V2

    Hi All,
    We are trying to fetch BOM data by calling the above function module i.e. CS_BOM_EXPL_MAT_V2.
    The function module is called as shown below
        CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
             EXPORTING
                  capid                 = 'PP01'
                  datuv                 = sy-datum
                  mktls                 = 'X'
    *              mehrs                 = 'X'
                  mmory                 = '1'
                  mtnrv                 = gs_bom-matnr
                  stlal                 = gs_bom-stlal
                  werks                 = p_werks
             TABLES
                  stb                   = gt_stb[]
             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.
    Inspite of passing the plant......the function module seems to be checking other plants as well.....i.e. for one of the material it gives an exception saying that 'Material XXX not maintained in plant ABCL'
    However the plant passed to FM is ABCM (p_werks)....then why is it checking in other plant?
    Any idea?

    Hi,
    Run report RCS12001 and check if the report is throwing a similar report with the parameters passed in the program.
    If yes, Check for SAP notes.
    If not, you may be missing some input fields.
    Sujay

  • Use CS_BOM_EXPL_MAT_V2

    Since to make a report in form of tree to list the materials with its materials semielborados until arriving at all the components of this material. I am using BAPI “CS_BOM_EXPL_MAT_V2” and not since I can do?

    Check these links
    Help reqd in CS_BOM_EXPL_MAT_V2
    Thanks
    mahesh

  • CS13  &  CS_BOM_EXPL_MAT_V2

    Hello Everyone,
    I am using CS13 and Functional Module CS_BOM_EXPL_MAT_V2  for multi level BOM explosion for final assembly.
    But the number of components vary from both the results.
    I mean if CS13  is giving me 100  entires , then  Functional Module CS_BOM_EXPL_MAT_V2  is  giving me 30 entries.
    Why is this so if , both are performing the same function.
    Regards,
    Vishal

    Vishal,
    Please go through this Post, i think this should solve your problem.
    [BOM explosion parameters Posted by Mr. Prabhu|http://www.erpgenie.com/forum/viewtopic.php?f=1&t=11280]
    Regards,
    Prasobh

  • Regarding CS_BOM_EXPL_MAT_V2 and table returned STB

    Hi Gurus ,
    I am facing one diffulty.
    I am calling following FM
          CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
               EXPORTING
                    capid                 = ' '
                    datuv                 = pa_datga
                    mdmps                 = lv_dummy
                    mehrs                 = lv_mehr
                    mtnrv                 = ls_mast-matnr
                    stlal                 = ls_mast-stlal
                    stlan                 = ls_mast-stlan
                    svwvo                 = gc_x
                    werks                 = pa_werks
                    vrsvo                 = gc_x
               IMPORTING
                    topmat                = ls_bom_header
               TABLES
                    stb                   = lt_pos
               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.
    I am doing multilevel & dummy Bom explosion .
    One internal table is returned  " stb                   = lt_pos"
    But i am not able to relate which is assmbly & its sub components .
    Also Dummy Bom assembly & components from the table returned .
    May be stufe field is making some sence as level , But still couldnt find the realtion between all IDNRK .
    Please help me to solve this puzzle .

    hi flavio,
    this report is used for total raw material estimation for the fiascal year for particular material.
    my exact requirement is on the selection screen i have  material,year,target qty.
    when user pressess  execute i need to display all the raw materials (to lower bom level) required for the material
    proportional to the target qty.
    for this i have used functiuon module CS_BOM_EXPL_MAT_V2 and able to retrieve the lower bom
    level raw materials and their quantities  into ltab and root material and its subcomponents into mtab
    in this raw materials used for sub comp[onents and for the root material may overlap  but the recipe for the raw materials
    depends on the bom of base quantity of root material,
    here my problem is how to differentiate the raw materials belongs to root material and its subcomponents ,( to perform
    calculations against the target quantity) which we r getting in ltab of fm after bom explosion.
    anybody pls suggest me .

  • Reg: Exception (ALT NOT FOUND) in the fun.module CS_BOM_EXPL_MAT_V2

    Hi Experts,
    I called the fun. module CS_BOM_EXPL_MAT_V2 in SE38.
    While executing the function module, it is giving output for some types of material like (TP0331-).
    But it is raising the exception ALT NOT FOUND for some types of material like 'TB1000-'
    But for all types of material, it is giving correct output in SE37.
    I gave the input parameter's,
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
       CAPID                       = 'PP01'
       DATUV                       = sy-datum
       EMENG                       = '1'
       MKTLS                       = 'X'
       MEHRS                       = 'X'
       MTNRV                       = 'TB1000-'
       STLAL                       = '1'
       STLAN                       = '1'
       SVWVO                       = 'X'
       WERKS                       = '0010'
       VRSVO                       = '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
    Can you please suggest me, why for the particular types of material, these function module is executing correctly in SE37 not in SE38.
    Whether i need to give some more inputs in SE38.
    Please guide me,
    Thanks in advance,
    Vijay.R

    hi,
    i have done the code like this,
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
    CAPID = 'PP01'
    DATUV = sy-datum
    EMENG = '1'
    MKTLS = 'X'
    MEHRS = 'X'
    MTNRV = 'TB1000-'
    STLAL = '01'  """" i have changed the value as 01 instead of 1.
    STLAN = '1'
    SVWVO = 'X'
    WERKS = '0010'
    VRSVO = '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
    it is a small problem..
    whether u need any more information..
    please let me know.. still it is not working means,
    paste your code.. i will check
    regards
    vijay

  • Use of CS_BOM_EXPL_MAT_V2 fro BOM explosion on plant basis

    hello ,
       I dont have any documentation for this FM and need to use it for BOM explosion on plant basis plz let me knw how to use it?

    Try something like this :
    *     Tables  "call CS_BOM_EXPL_MAT_V2 "
    DATA: BEGIN OF t_stb OCCURS 0.
            INCLUDE STRUCTURE stpox.
    DATA: END OF t_stb.
    DATA: BEGIN OF matcat OCCURS 50.
            INCLUDE STRUCTURE cscmat.
    DATA: END OF matcat.
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          auskz                 = ' '
          capid                 = 'PP01'
          datuv                 = sy-datum
          emeng                 = '1.000'
          stlan                 = '1'
          stlal                 = mast-stlal
          mtnrv                 = matnr
          mehrs                 = 'X'
          mmory                 = '1'
          stpst                 = '0'
          werks                 = werks
        IMPORTING
          topmat                = selpool
          dstst                 = dstst_flg
        TABLES
          stb                   = stb
          matcat                = matcat
        EXCEPTIONS
          material_not_found    = 4
          no_plant_data         = 8
          no_bom_found          = 12
          no_suitable_bom_found = 16.
    Hope this helps,
    Erwan

  • Multi-level BOM explosion using CS_BOM_EXPL_MAT_V2

    Hi All,
    I would like to know, if anyone has used the function module 'CS_BOM_EXPL_MAT_V2' to prepare a report to read multi-level BOM just like CS12. If anyone has, can you please let me know how we can read the individual materials in the BOM from this FM.
    Hope my question is clear, await inputs.
    Vivek

    Hi vivek,
    We use this code to restrict the BOM line item for particular movements. C if that can help u out.
    CALL FUNCTION 'CS_BOM_EXPL_KND_V1'
        EXPORTING
          capid                       = ''
          datuv                       = sy-datum
          emeng                       = 1
         mehrs                       = 'X'
          mtnrv                       = i_mseg-matnr
          stlal                       = '1'
          stlan                       = '1'
          stpst                       = 0
          svwvo                       = 'X'
          werks                       = i_mseg-werks
          vbeln                       = aufk-kdauf
          vbpos                       = aufk-kdpos
            VERID                       = ' '
          vrsvo                       = 'X'
          IMPORTING
            TOPMAT                      =
            DSTST                       =
         TABLES
           stb                         = ZStb
            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.
      SORT zstb BY mtart.
      LOOP AT zstb.
        IF zstb-mtart = 'Material type ' OR zstb-mtart = 'Material type ' .
        ELSE.
          DELETE zstb .
        ENDIF.
      ENDLOOP.
      CLEAR: v_menge, v_matnr, v_bwart, vv_menge, vvv_menge, zstb.
      LOOP AT zstb.
        SELECT menge matnr bwart
        INTO   (v_menge,v_matnr,v_bwart)
        FROM   aufm
        WHERE  aufnr = i_mseg-aufnr
        AND    werks = i_mseg-werks
        AND    matnr = zstb-idnrk
        AND    ( bwart = '261' OR bwart = '262' ).
              and    meins = 'FT2'.
         LOOP AT zstb.
          SELECT SINGLE matnr INTO vv_matnr FROM mara  WHERE  matnr = v_matnr
                                       AND mtart = zstb-mtart.
          IF sy-subrc = 0.
            CASE v_bwart.
              WHEN '261' .
                vv_menge = vv_menge + v_menge.
              WHEN '262' .
                vvv_menge = vvv_menge + v_menge.
            ENDCASE.
          ENDIF.
             ENDLOOP.
        ENDSELECT.
        CLEAR vf_menge.
        vf_menge = vv_menge - vvv_menge.
        CLEAR vv_menge.
        CLEAR vvv_menge.
    Regards,
    Vishal

  • BOMs not retrieved correctly from FM CS_BOM_EXPL_MAT_V2

    Hi All,
    I am using the FM CS_BOM_EXPL_MAT_V2 passing the following parameters.
    We are able to fetch most of the BOMs from this FM except for the records with valid to date <  sy-datum.
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
       EXPORTING
         aumgb                       = 'X'
         capid                      = 'ZP01'
         datuv                      = p_date
         ehndl                       = '1'
         mbwls                       = 'X'
         mehrs                       = 'X'
         mmory                       = '1'
         mtnrv                        = p_matnr
         werks                        = p_werks
         vrsvo                      = 'X'
    IMPORTING
       topmat                      = ls_cstmat
      DSTST                       =
        TABLES
          stb                       = gt_stb
          matcat                    = gt_cscmat
    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
    Please guide me if I am going wrong anywhere or if there is anyother FM to achieve this.

    Hi,
    I guess the parameter datuv = p_date is sy-datum in ur program. It is actually valid from date so you will get all BOM greater than sy-datum.
    Try not giving the date paramter. If still it does not work u can also use the FM CSAP_MAT_BOM_READ but FM CS_BOM_EXPL_MAT_V2 is more commonly used.
    Regards,
    Vasanth

  • Quantity not fetched properly from FM CS_BOM_EXPL_MAT_V2

    HI,
    I am using the FM CS_BOM_EXPL_MAT_V2 to get the BOM components at multiple levels. The problem that i am facing is that for some components if the quantity is 0.100 or 0.10 the function module is returning 10.000 and 1.000 respectively. But in CS12 we are getting the correct values for quantity 0.100 and 0.10 for the same components. I am using the function module like this.
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
          EXPORTING
            capid                 = c_zeng
            datuv                 = l_datum
            emeng                 = '1'
            mehrs                 = c_x
            mtnrv                 = wa_outline-matnr
            werks                 = wa_outline-werks
          TABLES
            stb                   = t_stpo
          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.
    So let me know how to get the correct values for quantities from this FM. Is there any other Fm which gives the correct values for quantity without any conversion.
    Regards,
    Sowmya.

    I tried that also but still it shows the same value. Another thing that i found was in CS11 or CS12 that component is displayed as 0.100 or 0.010 but in CS03 that component is having a value of 1 and 1 only. I am not able to understand the reason.
    Regards,
    Sowmya.

Maybe you are looking for

  • Two iPhones, same Apple ID

    My husband and I just purchased two iPhone 5.  We are using the same Apple ID, but contacts and apps are popping up on one device when it was originally downloaded on the other.  Is there any way to stop this from happening?

  • Display SP2010 list items on a non-SP site

    I want to display items from a SharePoint list on an internal non-SP site. This would be read-only access, and the other site doesn't use Windows authentication. For security reasons, I would prefer not to allow anonymous access for anything on the S

  • Case in insert  statement

    I am trying to use an case staemnet in oracle create table test1 (Status varchar2(10); declare Status varchar2(02); begin Status := '1' insert into test1 values (case Status when '1' then 'CREATE' when '2' then 'UPDATE' when '3' then 'DELETE else 'IN

  • Bdc for table control in abap -hr

    Dear all, how can we read if infotype is having table control 0008 how to record 0008 infotype please suggest me Regards. bose,

  • Send form. data from standalone pdf to LC Forms

    Hello, I am new in Adobe LC ES platform and would like to ask for advice with following. I need to provide user with a standalone pdf form, user should then be able to fill the form and send it to LiveCycle Forms server. I originally thought that eas