Automate

 View Only
Expand all | Collapse all

CS12 BOM Explosion report

  • 1.  CS12 BOM Explosion report

    Posted 05-07-2019 11:38
    Hi,

    I have a requirement to create BOM Explosion report for multiple material code.  SAP standard CS12 only allows to run one material at time.

    As a alternative I am wondering if I can create transaction script to run CS12 then download EXCEL for multiple material code?

    I've tried below and wondering if it is even possible, or I am doing something wrong. 
    • CS12 - Export to EXCEL - stopped 
    • CS12 - List > Save  - Error "Function code cannot be selected"
    • CS12 - Send to SAP office - Error "Function code cannot be selected"

    Thanks!

    ------------------------------
    Akiko
    ------------------------------


  • 2.  RE: CS12 BOM Explosion report

    Posted 05-08-2019 03:59
    Hi Akiko,

    You can use Query to download into excel ,even you can give your criteria while extracting it.


    ------------------------------
    Venkata Sreekanth Madhurapantula | IT lead
    Ernst & Young | 8885051987
    ------------------------------



  • 3.  RE: CS12 BOM Explosion report

    Employee
    Posted 05-14-2019 14:38
    Hi Akiko - if you want to go the route of saving an SAP report to your desktop, you'll very likely need to use GUI scripting.  The window that opens asking for a target file location and file name won't work with other recording modes.

    As an alternative if that isn't what you want to do and you don't want to go through query, there is at least one BAPI that will work for BOM explosions.  I don't have the name handy, but it was in another thread on the Community site.  Please let me know if you can't find it, and I'll look for it again.

    Best Regards,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle North America
    ------------------------------



  • 4.  RE: CS12 BOM Explosion report

    Posted 05-17-2019 16:52
    Hi Sigrid,

    Thank you very much for your information!  I tried with GUI Script, not quite successful yet, but did see different behavior.  I will keep trying and will get back result on here. 

    Regards,

    ------------------------------
    Akiko
    ------------------------------



  • 5.  RE: CS12 BOM Explosion report
    Best Answer

    Employee
    Posted 05-17-2019 17:26
    Hi Akiko

    Here's an example attached. 
    • Passes up the input fields
    • picks to save to file 
    • then pass in the directory and file name.  In my case I chose a spreadsheet with a file name ending with ".xls"
    • the new files are created in the directory you passed in with the filename you picked  (you could also choose replace if you want to re-use file locations/names)
    Example output file

    based on this BOM


    The script example is attached - GUI scripting mode built in v12.

    Hope this helps,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle North America
    ------------------------------



  • 6.  RE: CS12 BOM Explosion report

    Posted 05-22-2019 11:41
    Hi Sigrid,

    I tried to create another script by referring your sample and was successful!  Thank you very much for your help!

    ------------------------------
    Akiko
    ------------------------------



  • 7.  RE: CS12 BOM Explosion report

    Employee
    Posted 05-24-2019 09:56
    I'm glad to hear that, Akiko! :)

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle North America
    ------------------------------



  • 8.  RE: CS12 BOM Explosion report

    Posted 12-09-2020 01:52
    HI Sigrid,

    I have a question, In your attached script you are downloading it to different excel sheet. Is there a possibility of saving the multiple lines of multiple boM in a single excel file .?

    For example, i input 5 different BoM(material number) in the input file.So instead of extracting the data in 5 different file, I want a single excel . Is that possible .?

    Regards
    Aakansha
    SAP Data Migration Consultant​

    ------------------------------
    Aaksnha Gupta | SAP data migration
    Moog GmbH | +918130780074
    ------------------------------



  • 9.  RE: CS12 BOM Explosion report

    Employee
    Posted 12-09-2020 08:39
    HI Aaksnha 

    This example is leveraging a tcode that runs one BOM at a time and exports the output.  Thus we're saving the output to different files. 

    Best Regards,
    Sigrid


    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 10.  RE: CS12 BOM Explosion report

    Posted 05-14-2019 18:43
    Sigrid,
    I am also interested in a full BOM extract using Winshuttle.
    How do we search the community to find that BAPI?

    Thanks
    Ben Kielas

    ------------------------------
    Benjamin Kielas | SAP Master Data Team Lead
    Generac Power Systems, Inc. | (262) 544-4811
    ------------------------------



  • 11.  RE: CS12 BOM Explosion report

    Posted 05-22-2019 10:55
    Hi Ben,

    FM CS_BOM_EXPL_MAT_V2 with following parameters seems work.  I only tried one material on SE37 test mode, but it exploded 7 levels.   I am not finding BAPI yet.

    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
    capid = 'BEST'
    datuv = sy-datum
    ehndl = '1'
    mktls = 'X'
    mehrs = 'X'
    mmory = '1'
    mtnrv = <MATERIAL>
    stpst = 0
    werks = <PLANT CODE>
    vrsvo = 'X'
    IMPORTING
    topmat = h_stt
    TABLES
    stb = h_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.

    Akiko

    ------------------------------
    Akiko
    ------------------------------