Automate

 View Only
Expand all | Collapse all

Material Master - update if view is at different place

  • 1.  Material Master - update if view is at different place

    Posted 12-04-2023 06:01

    Dear all,

    I'm operating Automate (Winshuttle 12.1) having plenty of scripts updating Material Master which are working fine. However, it occurs that view to be update is at a different position because more views activated as expected. Like we usually don't activate the Purchase text view but sometime people are doing so. 

    Trying to update lot sizes on MRP1 would fail as =SP12 will in such cases land on Purchase text instead of MRP1. 

    Is there any idea how to overcome?

    Thanks and kind regards

    Hans Georg



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------


  • 2.  RE: Material Master - update if view is at different place

    Posted 12-05-2023 02:33

    hi Hans, I don't like to use direct command, you can try to open mm02 always by selecting basic 1 view and then choose MRP1 view from drop down list in right corner

    Rado



    ------------------------------
    Radoslav Magal
    baa
    PPG Industries International, Inc. – Hong Kong Branch
    ------------------------------



  • 3.  RE: Material Master - update if view is at different place

    Posted 12-05-2023 02:52

    Good morning Rado,

    This is what all my MM02/03 scripts are doing. But unfortunately I'm landing not always at desired view. As a workaround I have added conditions into my scripts to prevent SAP error messages during loading so, managing two columns. One if I could foresee that MM views are different like if different material types are updated and another one reacting to SAP error occurring during load. Like adding another "/00", "=Enter" with "=CANC" and with Skip screen if not present.

    But unfortunately I'm still getting plenty of SAP errors which are causing inconvenience to SAP basis team due to created short dumps and much more annoying it created inefficiencies.

    Thought there would be a way identifying SAP screen name but there is no such possibility and condition on SAP fields are not working either.

    Anyhow, thanks for your reply as I was afraid getting none.

    Wish you a nice day  



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------



  • 4.  RE: Material Master - update if view is at different place

    Posted 12-05-2023 05:39

    You have two options:

    1. Create always all views (even the ones you don;t use) that is an approach I used back in my Philips days, which I personally like as also extension scripts are always working fine
    2. Switch to a direct script BAPI_MATERIAL_SAVEDATA which is much faster but can give you a headache if you have a lot of custom fields.


    ------------------------------
    Rick Compen
    Data Engineer
    Lumileds Netherlands B.V.
    Eindhoven
    ------------------------------



  • 5.  RE: Material Master - update if view is at different place

    Posted 12-05-2023 07:37

    Hello Rick,

    Thanks for your reply, indeed, creating always all views would be a solution.

    Regarding your option 2 using Direct. I never was working with this, because I'm autodidact learned everything on my own with a little support from Winshuttle helpdesk. Would you be so kind and sharing an example script for BAPI_MATERIAL_SAVEDATA with me? Many thanks in advance.



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------



  • 6.  RE: Material Master - update if view is at different place

    Posted 12-05-2023 08:06

    Please find attached an example.

    Some insights:

    1. Views are more or less matching the input structure names to make it a bit easy
    2. With the exception of headerdata you see all names twice e.g. clientdata and clientdatax
      1. clientdata: here you map against your excel in same way as you always do for a transaction script
      2. clientdatax: this is what is called the structure table, here you need to mark all fields that you want to update with an X (same fields as in clientdata)
    3. The trick for the Z field is that you need to include extensionin and extensioninx. In case of multiple Z fields, I do recall that that you need to provide the input in a specific concatenated way, where " " represent a blank input. (actually quite similar to LSWM if you have experience with that) 
    4. Commit flag is required. The commit is the "save" functionality



    ------------------------------
    Rick Compen
    Data Engineer
    Lumileds Netherlands B.V.
    Eindhoven
    ------------------------------

    Attachment(s)



  • 7.  RE: Material Master - update if view is at different place

    Posted 12-07-2023 06:18

    Hello Rick,

    Many thanks for your files. Based upon them I created my first Transaction script and it was working. But when running it for 175 records it didn't update them, only two had been executed successfully, however every line hat SAP success message "Material xxxx created or extended".

    May I kindly ask you having a look what is wrong?

    Kind regards

    Hans Georg



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------



  • 8.  RE: Material Master - update if view is at different place

    Posted 12-07-2023 06:34

    Hi Hans,

    I see you miss to set the commit required flag in the workspace. (strange enough 2 materials still updated as you stated)

    What further can help you is to map additionally TYPE and MESSAGE from RETURNMESSAGES table. (the loop can be deleted) This shows you e.g. warnings and errors that SAP normally shows you.

    Regards,

    Rick



    ------------------------------
    Rick Compen
    Data Engineer
    Lumileds Netherlands B.V.
    Eindhoven
    ------------------------------



  • 9.  RE: Material Master - update if view is at different place

    Posted 12-07-2023 06:58

    Hello Rick,

    Regarding missing Commit, sorry read this in the documentation but was such excited that it was working that I forgot to activate it.

    Now it's working fine. However columns TYPE and MESSAGE didn't get any entry during loading it into our test environment.

    Again many thanks, learned a lot.

    Hans Georg



    ------------------------------
    Hans Georg Loef
    Supply Chain and Production Master Data specialist
    Trivium Packaging BV
    Weißenthurm
    ------------------------------



  • 10.  RE: Material Master - update if view is at different place

    Posted 12-17-2023 07:50

    Hello Rick,

    I have been in the same situation as Hans where different views have been activated for materials and my original script was not working. Thank you for sharing the BAPI scripts. I am trying to use your script BAPI_MATERIAL_SAVEDATA_TestUS.Txr and it definitely has been helpful. 

    My requirement is to only change material master, not create. When I try to pass an existing material with a basic data view field to update it errors out every time because of some required field being missing although those fields are not set as required in SAP or in the script. For example, unit of weight and material group. I disabled unit of weight (not required to change) but I will need material group in my script. Not sure why some fields show up as required.  

    Should I be doing something different if it is only change material? Any insights will be really helpful! 

    Thank you,

    Anshu Rathi



    ------------------------------
    Anshu Rathi
    SAP MM Functional Analyst
    Vari
    NJ
    ------------------------------



  • 11.  RE: Material Master - update if view is at different place

    Posted 12-18-2023 07:41

    Both fields you mention unit of weight and material group are always mandatory fields

    For a change you need at least to provide

    • material number
    • material type 
    • plant (if applicable)
    • sales org (if applicable)
    • view (note sometimes twice)
    • field (note always twice)



    ------------------------------
    Rick Compen
    Data Engineer
    Lumileds Netherlands B.V.
    Eindhoven
    ------------------------------



  • 12.  RE: Material Master - update if view is at different place

    Posted 12-18-2023 12:06

    Hi Rick,

    I was testing the script for Change and since material group and unit of weight were already maintained I was not expecting it to error out.

    I figured the issue was with the CLIENTDATAX fields that are set as fixed value upload 'X'. I created an IF condition that if the CLIENTDATA field is empty then skip corresponding CLIENTDATAX field and that has fixed the issue. 

    Thank you! 



    ------------------------------
    Anshu Rathi
    SAP MM Functional Analyst
    Vari
    NJ
    ------------------------------