Automate

 View Only
  • 1.  ONE MOTHER SCRIPT USING MULTIPLE TEMPLATES

    Posted 01-20-2022 14:37
    Hello,

    I'm looking to overhaul / streamline my scripts for updating master data.
    The issue that prompted this was that a change to my default MM02 settings created a cascading failure on my scripts.
    Of course one option would have been to simply revert.
    Regardless, I've successfully created a new script for MRP master data that toggles through all relevant fields that I would consider updating (MRP / PLANNING PARAMETERS)
    The master data review reviews elements of these in isolation and generates an update file in MS ACCESS.
    Previous state was that these were all independent scripts and data sources.
    My ideal state would be to have one mother script with multiple templates called (determined in scheduled task) and the non-relevant fields skipped 
    Alternatively, I will simply reference the mother script and create copies.  The scripts would be identical and the data sets would have the same format (or disable the unnecessary fields)
    I'm struggling a bit to faithfully represent the strategy but I think those fairly well versed in the tool will catch the drift.
    I'm confident I can ultimately achieve my goal, just curious as to what the most efficient option might be here.

    ------------------------------
    Remo Ferrone | Sr. Business Analyst
    Medline Industries, Inc. | 800-268-2848
    ------------------------------


  • 2.  RE: ONE MOTHER SCRIPT USING MULTIPLE TEMPLATES

    Employee
    Posted 01-20-2022 19:30
    Hi Remo

    That's a big question.  

    Overall, there are some best practices to Transaction recordings, such as clearing default views as part of the recording, so that it doesn't affect the execution of the script, creating separate scripts for repeating data (like alternate units of measure, multiple descriptions), and also handling long text with an update script..

    If I was trying to do something like you want, I would suggest using a Material BAPI: BAPI_MATERIAL_SAVEDATA with Studio Direct.  That way, you wouldn't have to worry about how to navigate to between different view numbers as you include or clear the fields you want to maintain. 

    Instead, you would select general groups of fields, i.e. basic data, sales data, etc

    then select which fields in each you want to maintain.  It has a dual structure, i.e. one set of fields to upload data, and another structure to choose which of those fields to update with an "X".  That limits the number of fields you are going to add/update.


    The other nice thing is that the BAPI does an UPSERT, i.e. update if it exists or insert if it doesn't.

    I would use a Transaction script, however, to handle long text - both upload and download, leveraging our built in functionality:  https://docs.winshuttle.com/studio-en-12-1-x-online-help-studio-w-connect/12/Record-long-text.htm

    Hope this information is helpful.

    Best Regards,
    Sigrid

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