Automate

 View Only
  • 1.  mm01 Select correct view based on material type, Studio 12.0

    Posted 08-05-2019 09:47
    When making a script based on transaction MM01, it's sometimes difficult to select the correct view: the other day I had to make a script that will only change profit center ( Gen Plant Data / Storage -view). Depending on the material type, we have more or less views available in MM01. (see attached screenshot create material. png).
    There is a way in Studio to change the view Studio selects : after recording the script the view selection can, as a whole, be selected and duplicated. After duplicating the number of the menu-item can manually be changed in the script itself. With a if-loop the choice for the correct screen can be assured. (see attached screenshot MM01 Winshuttle Studio.png).
    Enjoy !


    ------------------------------
    Jan Ketele | Sr engineer release management
    Xeikon Manufacturing NV | +3234431875
    ------------------------------


  • 2.  RE: mm01 Select correct view based on material type, Studio 12.0

    Posted 08-06-2019 10:51
    Hi Jan,

    I'dd rather use the code for the correct tab.
    First always select only Basic data 1 and then use the correct BDC_OKCODE for the corresponding tab.
    f.e. BDC_OKCODE =SP19 activates tab General Plant data/Storage1.
    You can find find these codes by using the selection button besides the tabs to select the correct tab when you record a script.

    Good luck,
    Jan van Asseldonk

    ------------------------------
    Jan van Asseldonk | Consultant
    CTAC | +31629078169
    ------------------------------



  • 3.  RE: mm01 Select correct view based on material type, Studio 12.0

    Posted 08-06-2019 11:03
    Hi Jan,

    Many thanks for your reaction.
    The issue with MM01 is: if a view already exists, you can't select it for  creation. So starting of with basic data 1 and afterwards selecting Gen plant data / storage is impossible if basic data exists. That's why I was looking for an alternative solution in these cases.

    best regards, Jan

    ------------------------------
    Jan Ketele | Sr engineer release management
    Xeikon Manufacturing NV | +3234431875
    ------------------------------



  • 4.  RE: mm01 Select correct view based on material type, Studio 12.0

    Employee
    Posted 08-09-2019 11:19
    Hi Jan,

    My vote for this would be to use a BAPI:  BAPI_MATERIAL_SAVEDATA  is one that works.  Why?

    • It will remove the variability that you encouter with the number of views
    • It will do an "upsert", i.e. update if it exists or add the view if it doesn't exist.
    The only downside - it's a bit "geeky" at first to use a BAPI, and if you have custom fields, they will not be in the BAPI.

    Best Regards,
    Sigrid

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