Supply Chain Management Blogs by SAP
Expand your SAP SCM knowledge and stay informed about supply chain management technology and solutions with blog posts by SAP. Follow and stay connected.
cancel
Showing results for 
Search instead for 
Did you mean: 
gheorghe_ceres
Product and Topic Expert
Product and Topic Expert
7,554
With the SAP S/4HANA 2021 release, we introduced a new “EWM_MOBGUI” service in the transaction SICF via which users can display ABAP Dynpro in RF Framework as SAP GUI for HTML. To further personalize the RF screens, SAP also introduced a new feature called Screen Personas.  Screen Personas offers powerful means to adapt UIs to individual needs. More details can be found in the guide “SAP Screen Personas for Mobile RF Devices in Extended Warehouse Management in SAP S/4HANA”.

If simple screen adaptation is not sufficient, you could evaluate Screen Personas Scripting to gain even more flexibility.

You can use scripting to automate or manipulate screen actions, for example:

  • Screens can be skipped assuming mandatory fields can be filled automatically by the script

  • Fields can be prefilled

  • Additional data can be retrieved and displayed


Scripts created as part of the Adapt UI features are small pieces of JavaScript. You can attach these scripts to individual UI elements with script events or entire screens with screen events. For more details, see Script Editor.

Note that the use of scripting can have negative side effects, for example:

  • Depending on what you do in JavaScript performance can be harmed significantly. Thus, every script shall be evaluated carefully before productive usage. Keep in mind that for processing on RF devices usually every millisecond counts. If you want to do complex steps via scripting the added runtime has to be accepted by the end users. Accordingly, you should evaluate the expected costs (runtime) and compare it with the benefit for the end users.
    If you for example change the color of a button via scripting, there is a visible delay in the button changing its color at runtime.

  • Added complexity due to the usage of scripts. As a matter of fact, usage of scripts makes a flavor more complex.

  • Your script can depend on the screen definition, i.e. the objects/elements on the screen. If the screen would get changed, this might have negative impact on your script. Depending on what is done the script might need to be revised.

  • If you use object related content in your script e.g. the text/label of a button for a query, the corresponding coding might become language dependent. That is, if the script checks for the label text, you must consider different languages used in your warehouses.


The scripting examples below are added for illustration purposes only. They do not claim to be perfect JavaScript code. Additionally, they focus on a certain aspect and do not cover screen processing in a holistic way (e.g. complete error handling).

  • Example 1 – Dynamically Hide Verification Field on Destination Screen

  • Example 2 – Add ODO Number to Picking Source Screen

  • Example 3 – Query HU by Alternative Identification


Please watch this page as we plan to add more examples depending on feedback.

Example 1 – Dynamically Hide Verification Field on Destination Screen


This example describes how to use a script to dynamically hide the quantity fields on the destination screen of a product warehouse task in RF picking. Besides hiding the fields, the script also automatically verifies the quantity on the destination screen. This is based on the assumption that the quantity was already verified on the source screen.

1.Start the script editor from the flavor manager by choosing Scripts > Edit:


2. Choose Create New Script:


3. Add the following coding:


4. Save the implementation.

5. Assign the script to the screen event by editing the flavor, choosing the Insert tab, and choosing Script Events:


6. Add the created script to the onAfterRefresh screen event:


When the script runs, the quantity fields won't be visible on the destination screen for product warehouse tasks in RF picking:



Example 2 – Add ODO Number to Picking Source Screen


With this example you can see how to create a script to add the outbound delivery order number to the RF picking source data screen. This can be done although the ODO number is not available in standard on the source data screen.

Please note that a custom field and label has to be added to the screen (see txtPersonas_168726056454688 below). For your script you will have to correct the ID / use the ID of your custom field.

1.Start the script editor from the flavor manager by choosing Scripts > Edit:


2. Choose Create New Script:


3. Name the script and create the following implementation in the coding window:


4. Save the implementation.

5. Assign the script to the screen event by editing the flavor, choosing the Insert tab, and choosing Script Events:


6. Add the created script to the onAfterRefresh screen event:


The flavor containing the script in the background uses RF functionality to execute a WT query in RF to get the ODO number linked to the warehouse task and displays it on the RF picking source screen:


Please note that the flavor / script executes several steps in background. This consumes time that has to be accepted by the business users. Do not add too many steps.

If the information you need is not provided on an existing RF screen that you can reach out of the current logical transaction (e.g. picking), alternatively you could use APIs. See SAP Business Accelerator Hub for more information.

Example 3 – Query HU by Alternative Identification


The steps below describe how to create a script to select HU information by entering the alternative HU identification instead of the EWM HU number.

1. Start the script editor from the flavor manager by choosing Scripts > Edit:


2. Choose Create New Script:


3. Name the script and create the following implementation in the coding window:


4. Save the implementation.

5. Assign the script to the screen event by editing the flavor, choosing the Insert tab, and choosing Script Events:


6. Add the created script to the onEnter screen event:


7. Create a second script with the following implementation:


Please note that the Personas text element IDs (here txtPersonas_168387506699773) have to fit to your flavor.

8. Add the second script to the onAfterRefresh screen event:


The flavor containing the scripts changes the selection screen of RF transaction HU Query:


The flavor hides the original field label and input field of the HU number and instead uses the field label and input field for the alternative HU identifier. You have to add these custom fields to the screen as part of your flavor (see above).

The second script which runs for event onAfterRefresh sets the focus to the new input field.

The first script which runs for event onEnter uses an oData service to read the HU data based on the entered alternative HU identifier. See SAP Business Accelerator Hub for more information.

FIND OUT MORE!

If you are interested in more information in this area, I recommend you check out the following consulting notes:

For more information about SAP Extended Warehouse Management, please follow us on social media, our YouTube channel or our community pages:

SAP EWM Community

SAP YouTube Channel

EWM LinkedIn Community

For a complete list of Q&A from the EWM community, please access this link:
https://answers.sap.com/tags/01200615320800000705

In case you do not find your specific question there, feel free to post your question via the following form:
https://answers.sap.com/questions/ask.html?primaryTagId=01200615320800000705
11 Comments