Automate

 View Only
  • 1.  BAPI - MM01 - Multi Sheet Loops (with 75 countries tax data)

    Posted 11-06-2019 11:50
      |   view attached
    Friends,

    Am using BAPI (BAPI_MATERIAL_SAVEDATA) for creating materials with 75 tax data classifications. The script runs good and its creating materials successfully. The script is becoming very tedious to understand for the users and input the source data fields since 75 countries data exists (approx for one material# 77 rows) and getting laborious work to provide the source file with field columns data (74 columns).

    Please let me know if there is any alternative method like macros or breaking the script into two sheets for tax data classifications or multi loop with BAPI, so users can do it by their own easily by entering the other material master data in the excel.

    Thanks



    ------------------------------
    Naveen
    ------------------------------


  • 2.  RE: BAPI - MM01 - Multi Sheet Loops (with 75 countries tax data)

    Employee
    Posted 11-07-2019 12:21
    Hey Naveen,

    Thanks for reaching out! I was actually working on a similar concept yesterday that might be able to help. A few questions just to see if it would be relevant. 

    First off, which version of Winshuttle are you using? The method I was using would require being on Studio 11.x or higher.

    Also, how many of the tax classifications do you think could be defaulted or determined based on some logic, rather than being a field an end user should have to fill out?

    The general concept would be flattening your BAPI structure by deleting the pre-built loops, and it might be a good idea to split off the Tax Classification parts as a linked script if you're SAP system will allow you to create the material without it.

    - James

    ------------------------------
    James Lofgren | Solutions Engineer
    Winshuttle North America | [City] |
    ------------------------------



  • 3.  RE: BAPI - MM01 - Multi Sheet Loops (with 75 countries tax data)

    Employee
    Posted 11-07-2019 13:28
    Hi Naveen

    Thanks James, you  beat me to it. :)  

    In newer releases of Studio, you can copy tables/fields in Direct scripts.

    I created 3 versions - one in a loop, one flattened out (v1) and uploads 2 sets of the 3 input fields, one flattened out (v2) that hard codes the country and category and only passes up the tax class fields
    Loop

    Flattened V1

    Flattened V2

    You can expand it out for as many tax classes as you like.

    The trick to copying is right clicking on the green (turns blue when you click on it) row that has the table name and clicking copy 

    then paste before or after the other set of tax class fields

    I had to ask James to remind me how to do that, because I was also selecting the fields - but you shouldn't do that.  Just click on the table name row to copy and paste.
    Hope that helps!
    Sigrid

    ------------------------------
    Sigrid Kok
    pse | Winshuttle North America
    ------------------------------