Automate

 View Only

Tip of the Week - Transaction Message Transformations

  • 1.  Tip of the Week - Transaction Message Transformations

    Employee
    Posted 13 days ago
    Edited by Sigrid Kok 6 days ago

    Tip of the Week – Transaction Message Transformations

    Sometimes, it will make sense to modify the default SAP message that comes back from a Transaction script. Some of the reasons to do this include:

    •  Improving message clarity
    • Extracting just the object number(s) created, like material/customer number or journal entry document number, which might be used in subsequent scripts.  For example:

    o   Extend a material/customer

    o   Create supporting objects like PIRs and Source lists, or CMIR and customer-specific pricing

    o   Attach supporting information to a journal entry document

    • Standardizing messages for runners

    In order to transform the message(s), you will need to:

    • Have a Transaction script already created
    • Have a set of data that will trigger the message(s) you want to transform

    To get started, open your script and go to the Map tab and view the Script properties to capture the message code, aka the Technical log information +EM via the Checkbox, and then go to the Run tab and run your test data for each scenario that triggers a message you would like to change – whether a success or error message:


    Then we will leverage the Transform messages Launch Dialog button to adjust the message for each combination of message identifier, which has an ID and number.

    MM01 example:

    Here is the default SAP message in English when you successfully create a material. The message is pretty clear and the material number is a variable, as it changes for each material created.


    If you want to adjust the message, check the Technical log information checkbox in the Script Properties on the Map tab and run the script to capture the message ID and number:


    Here you will see M3-800 is the message identifier, with M3 the ID and 800 the number, for a successful material creation, which has the new material number as part of the message.

    Now you will want to return to the Map tab and Script properties, and then click on the Transform messages Launch Dialog button:


    You will see a window to enter the message ID and number and new message text. Click Add.


    Enter the message ID & number in two parts like below and the new message – Message ID is M3 and Message Number is 800


    The Message Text can be as simple as new text, or you can leverage variable(s) for messages that have object numbers in them, like creation of a Material with a new material number or a Journal Entry document number and company, etc.

    The format of the variable is &#, examples:

    ·         &1 for the first variable, such as the material master creation, which will give you the material number

    o   Note if there is just one variable, you can simply enter &

    ·         &2 for the second variable

    ·         Etc.

    You may have to try different variable numbers to get just the combination you are interested in.

    Enter text with a variable, like below:


    This will change the message like below:


    Or simply enter the variable and you will just get the object number:



    Once you have the message you want, please be sure to uncheck the Technical log information checkbox, so that you no longer see the message code. Now you only see the new material number as the message of a successful material creation run of MM01.


    You can add as many message transformations to a script, as needed.

    FB50 Journal Entry example:

    Let's start with an error:

    This error is stating that the GL Account does not exist in company code 1000 in a backend SAP Table SKB1, so it could use better wording for the runner trying to use this automation.


    Check the Technical log information Checkbox in the script properties and re-run the script to see the message identifier, with ID "00" and number "058"


    Let's swap the wording like below – with the 2nd variable the GL Account and 1st variable the company code


    Now the error looks like this and is more understandable for a runner:


    If we uncheck the checkbox to return the Technical log information, and we have the below error message.


    Now let's look at the standard successful posting message for a Journal Entry in FB50 in English, which is understandable, but you may want to change it.


    Check the Technical log information Checkbox in the script properties on the Map tab and re-run the script to see the message ID and number.


    Leverage message identifier, with id  "F5" & number "312", to transform the message, and optionally use variable &1 for the Document Number and &2 the Company Code based on the order in which they appear in the default message above.


    And now see this as the output message of a successful Journal Entry post


    Or simply output the document-company like &1-&2 below:


    To get this output:


    Removing the technical log information checkbox, you get:


    Notes:

    ·         There is a support article on this topic here:  https://customer.precisely.com/s/article/How-to-Change-the-Log-Message-360023695631?language=en_US

    ·         Some error ids/numbers are a "catch all", like "00-344", so please ensure you do thorough testing to give the business users the message(s) they need to correct any errors and have both clarity in what is wrong and successful corrections.

    ·         If you only output the new object number(s), like material number or document number, you might want to put a note in your Excel template explaining to the business user that they will see the object number(s) if it is successful, or the document "-" company code for a Journal posting. A simple explanation is often enough.

    Happy Transforming!

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------