Automate

 View Only

Preloading log messages in linked script scenarios

  • 1.  Preloading log messages in linked script scenarios

    Posted 01-04-2020 16:33
    This is just a small life hack that some may find fun or useful.

    I work a lot with linked scripts. Sometimes these chains of linked scripts can contain scripts that I only want to run if certain conditions have been met. This is easy enough using an IF statement. The thing is, that if a script is intentionally skipped, then I just get a blank log cell, and that is something I'm not in favor of. A blank log field to me is inconclusive. I would much rather have a log text saying "Skipped" or "N/A (Not Applicable).

    So I decided to see if I could find a way to preload log texts so I can see if a script should run or not. Here is an example of what I did in a script with cell based mapping where I always have to create a BOM and sometimes, but not always, create a second BOM.

    I start my chain of scripts with a MM02 script changing a dummy material I have created for the purpose. All that is needed is the basic 1 view for the material, because I'm using the material description as a source for my preloading of log texts.

    In the first screen I'm uploading a text I would like to preload as a log text. In the second screen I read the uploaded text to the log cell.

    This is repeated once for each script in the chain. The end result is that all the log cells have a preloaded text telling me what to expect. In the example above I will either have a log message saying "BOM 2 loaded successfully" or it will have the preloaded text "BOM 2 not loaded" after the "create BOM 2" script has been run.

    Maybe there is a smarter way of doing this, in which case I would like to know. Maybe Winshuttle will add a feature so that preloading log texts can be done in all scripts.

    Have fun.





    ------------------------------
    Karsten Salin | SAP Business analyst II
    MAT Holdings Inc. | 4540340776
    ------------------------------