SAP UI

SAP UI node is used to automate SAP applications.

  1. Pre-condition:
  2. Before designing a task using SAP UI node, it is necessary to do the following:
    1. Enable GUI scripting in the SAP Logon application.
    2. Create modules and familiarize the SAP Logon application using UI Learn.
    3. Define the SAP Execution Execution Configuration in Jiffy.

    1.1 Enabling GUI scripting:

    In order to use the GUI scripting feature of SAP for SAP automation, the user must make sure that scripting enabled at 2 places:
    1. Client
    2. Server

    1.1.1 Client Side:

    To enable GUI scripting on the Client side,
    1. Open the SAP Logon application.
    2. In the Connections folder, double click on the connection required.

    3. Click on the highlighted icon and choose Options.



    4. In the Accessibility and Scripting drop-down, select Scripting.

    5. In the User Settings section, check the Enable Scripting checkbox.


      Note: Make sure that the rest of the checkboxes are unchecked to avoid prompts when Jiffy connects to SAP.
    6. Click on the OK button to save.

    1.1.2 Server Side:

    To enable the Profile parameter, sapgui/user_scripting_set_readonly,
    1. Log in to the SAP server.
    2. In the Connections folder, double click on the connection required and type the client, username and password..

    3. In the T_CODE bar, enter the transaction code RZ11 and press the Enter key on the keyboard.


      Note: Contact the administrator in case there is no authorization to do this.
    4. Specify the Parametername as sapgui/user_scripting.


    5. Click on the Display button.

    6. In the Current Value of Parameter sapgui/user_scripting section, if the value of the Current Value field is FALSE, change it to TRUE.

    7. Click on the Save button.
    8. Specify the Parametername as sapgui/user_scripting.


    9. Click on the Display button.

    10. In the Current Value of Parameter sapgui/user_scripting section, if the value of the Current Value field is FALSE, change it to TRUE.

    11. Click on the Save button.
    12. Specify the Parametername as sapgui/user_scripting_set_readonly.


    13. Click on the Display button.

    14. In the Current Value of Parameter sapgui/user_scripting_set_readonly section, if the value of the Current Value field is FALSE, change it to TRUE.

    15. Click on the Save button.
    16. Specify the Parametername as sapgui/user_scripting_disable_recording.


    17. Click on the Display button.

    18. In the Current Value of Parameter sapgui/user_scripting_disable_recording section, if the value of the Current Value field is FALSE, change it to TRUE.

    19. Click on the Save button.
    20. Specify the Parametername as sapgui/user_scripting_force_notification.


    21. Click on the Display button.

    22. In the Current Value of Parameter sapgui/user_scripting_force_notification section, if the value of the Current Value field is FALSE, change it to TRUE.

    23. Click on the Save button.
    24. Restart the SAP Logon application to apply the changes.

    1.2 Creating modules and familiarizing the SAP Logon application using UI Learn:

    Next, familiarize the SAP Logon application using UI Learn. Click here for more information.

    1.3 Defining SAP Configuration:

    Note: When the user saves a new App in UI learn, then a configuration is created automatically in Jiffy. The newly created configuration is of the format Appname_sap. If the application name is already existing, then it will be of the format Appname_1_sap.

    The user can view the configuration created for the application in the Task Design: Configurations -> SAP Execution Configuration section as shown below.


    If the task is for a different release or using/re-using the controls, then the user must create new configuration or can use existing configuration by following the below steps:
    1. Login to Jiffy.
    2. Navigate to Task Design -> Configurations -> SAP Execution Configuration.
    3. Click on the Add button to define the configuration.
      The following drop-down is displayed with two options:

      • Create New: Use this option to create a new SAP configuration.
        Do the following to add new configuration:
        • Click on the Create New button to display the display the Add SAPUI Configuration window.

          Specify the details for the following fields:
          • Configuration Name: Name to be provided for the configuration and the specified name is used in the Properties section of the node.
          • Clusters: Select the required cluster from this drop-down.
          • App: Select the SAPUI related application from this drop-down. The SAPUI:1 application can be used as a default application.
          • Application Path: Path where the SAP application exists.
          • Connection String: URL of the application to be automated. This can later be changed accroding to the requirement of the app.
          • Click on the Save button.
        • Copy Existing: Use this option to copy from the existing configurations that are defined earlier.
          • Click on the Copy Existing button to display the Copy Configuration window.

          • Type the details of the required configuration in the above Search fields.
          • Select the required configuration from the filtered list.
          • Click on the Copy button.
    Note: All the defined SAP Execution configurations are available in the SAP Configuration drop-down in the Properties tab of the Task Design screen.

  3. Designing a Task Using an SAP Node:
  4. Do the following to use an SAP UI node in a task:
    1. Use an existing task or create a new task based on the requirement.
      Note: Refer Create A Task for more details on how to create a task and how to open an existing task.
    2. Drag and drop the SAP UI node from the Objects -> UI section and connect the nodes.

    3. Click on the SAP UI node and specify the properties:

      Add the following details:
      • Name: Name of the node. A default name is displayed in this field, which the user can edit according to the task and the intent of using the node.
      • Description: A short note on the purpose of the node.
      • Mark run Failure on Node Fail: When the Mark run Failure on Node Fail field is ON, if the node execution fails then the complete task execution is marked as fail.
      • Run with User Config?: This functionality is now currently deprecated.
      • Continue on Failure: When the Continue on Failure field is ON, even if the node fails, the execution will continue to the next node. When the Continue on Failure field is OFF, if the node fails, the execution will not continue to the next node.
      • SAP App Configuration: Select the required configuration from the SAP App configuration drop-down. For more details click here.
      • Run Mode: The user can select any one of the following options from the Run Mode drop-down:
        • Run if locked: The task runs even if the machine is locked.
        • Unlock and run: Unlocks the machine and runs the task.
      • Lock After Run: Locks the machine after the node execution.
      • Variables: Click on the Variables button to select the input variables and to create an output variable to assign the output of the UI event values.
        • To create an output variable, go to Output Variables tab.

        • Type the required name of the output variable in the first text box and then select the type of the output variable from the drop-down. The output variable type can be either List or Table.
          Note:If the Table option is selected, define the table structure by clicking on the Table Def button on the right-hand side of the screen. For more details, click here.
          To get the table data and store it in a Variable, the user must create a variable as Table with multiple column options (As of now in the task that is provided as an example, there is only one column, so select the SingleColTable).

        • Click on the Save button.
      • Take Screen Shots: The user can select either Always or On Error option.
        If the user selects Always, then the user can see the screenshot of every UI event step output in the form of images (SAP application) after a run.
        If the user selects On Error, the user can see the screenshot of the step which is failed. In case of any popup messages or any crash on the application, the user can identify it from the screenshot. These images can be passed to next node for further process, for example, to send an email by attaching the screenshot of failure.
      • Close Application: After completion of SAPUI run, then it will close the SAP application that is launched during the execution of the task when the Close Application toggle button is in ON position. When the user wants to retain a SAP application to perform actions on it, then select the Close Application toggle button must be in OFF position.
      • Close Application On Error: If it is ON, then the application or SAPsite which is launched during execution will close in case of any error in the flow of execution.
    4. Double click on the SAP UI node to display the Edit UI dialogue box.
    5. The Edit UI dialogue is now displayed with default UI Event option in the first drop-down. This drop-down allows the user to select any of the following options:
      • Set Screen: Select the required module from this drop-down. All the controls of a SAPpage are grouped together as a module during familiarization, for example, all the login SAP page controls are grouped in login module.
      • UI Event: All the familiarized UI controls are displayed in this drop-down.
      • UI Component: Click here for details on UI components.
      • Set Variable: There is an option to set a variable inside the UI node. The value to be set can either be a new variable or an existing variable (output variable created in the Properties tab).
      • Custom Expression: Jiffy provides a feature to allow users to create custom Python expressions and use them in the UI nodes steps. The Custom Expressions need to be uploaded to Jiffy Repository (Repository -> Custom Expressions). Once it is uploaded, it is available in the drop down of Custom Expressions option.
        Note: The expressions must be written in IronPython script.
      • Default Expression: These are Jiffy provided python expressions for the commonly used functions. For example: Concat, Capitalize, Add days etc. Click here, for information on SAP UI related expressions.
    6. Select the Set Screen option in the Edit UI window.
    7. Based on the configuration selected in the Properties of SAP UI node, all the modules that are familiarized under that application type (application is added while configuration is defined) appears in the drop-down. For more details on the SAP UI controls and familiarization, click here.
    8. Select the required module.
      Note: The user must create the steps according to the manual flow of work so that the automation will run as expected.

    9. Select the UI Event option and then select the required UI control for the specific module. The drop-down corresponding to UI control contains the following options:
      • Clear: Clears the existing content in the field.
      • Click: When the required UI action to be performed is a “click on the UI control” then select this option.
      • DoubleClick: When the required UI action to be performed is a “double-click on the UI control” then select this option.
      • Exists: Used to check whether the UI event exists or not.
      • GetText: Used to get the text value of any UI event.
      • Input: Used for providing inputs to an UI event, for example: Username
      • InputPassword: Used for for inputting password to an UI event.
      • Keyboard: Use this option when any key has to be pressed from the keyboard, for example: Enter key.
    10. Click on the Save button in the Edit UI dialog after designing all the steps.
    11. Click on the Trail Run icon.
    12. Select the SAP UI node and click on the Book icon to view the Result of execution screen.

  5. Using various data structures in tasks with SAP node after familiarization
  6. Parameters are passed differently for each data structure during task design in SAP.
    • 3.1 Tree:
    • Example:


      After familiarizing an element of the Tree type in UI Learn, the following details can be seen in the UI Control repository.



      To the UI Event of Tree type in SAP node, 3 parameters are passed.
      1. param1: The tree node name appearing in SAP.
      2. param2: This function is currently depricated.
      3. lookup_type: This defines what the input parameters are given to identify the element.
        Syntax: lookuptype,comparisontype,ignorecase
        Example: nodekey,startswith,false OR nodetext,startswith,false

      Following UI Actions can be performed for an UI Event of Tree type:
      1. Click
      2. DoubleClick
      3. Exists
      4. GetText

    • 3.2 Table:

    • After familiarizing an element of the Table type in UI Learn, the following details can be seen in the UI Control repository.

      To the UI Event of Table type in SAP node, 3 parameters are passed.
      1. param1: The row number.
      2. param2: The column name.
      3. lookup_type: This always will be rowindexcolumnname,startswith,false

      Following UI Actions can be performed for an UI Event of Table type:
      1. Click
      2. DoubleClick
      3. Exists
      4. GetText
      5. Focus
      6. SelectRow
      7. Input

    • 3.3 Data Grid:

    • Grid Table looks like a table having a certain number of rows and columns. This can be familiarized in the same way as the normal SAP tables.
      Example:


      After familiarizing an element of the Data Grid type in UI Learn, the following details can be seen in the UI Control repository.



      To the UI Event of Data Grid type in SAP node, 3 parameters are passed.
      1. param1: The row index.
      2. param2: The column index.
      3. lookup_type: This always will be rowindexcolumnname,startswith,false

      Following UI Actions can be performed for an UI Event of Data Grid type:
      1. Click
      2. DoubleClick
      3. Exists
      4. GetText
      5. Hover
      6. Input
      7. InputPassword
      8. RightClick
      9. SelectRow

    • 3.4 Label:

    • Example:


      After familiarizing an element of the Label type in UI Learn, the following details can be seen in the UI Control repository.



      To the UI Event of Label type in SAP node, 2 parameters are passed.
      1. label_text: The text of the label.
      2. index: The number of times the label is repeated.

      Following UI Actions can be performed for an UI Event of Label type:
      1. Exists
      2. GetText
      3. Focus

Did you find what you were looking for?

Automation Analytics and AI in a box

Contact Us

HfS Hot Vendor

Option3's Automation capabilities featured in HfS Research's Hot Vendors List for Q3, 2018

Access your copy here