Skip to Content
Technical Articles

Automating SAP GUI screens with low hierachies

Introduction & Problem Description

In this blog post, we will address the problem of automating SAP GUI screens with low hierarchies. Sometimes, when we automate applications like SAP ERP, we will face tables that look like the one in the picture below (transaction SM37):

Table with low hierarchy

At the first glance, this looks like a table that is easily automated with SAP Intelligent Robotic Process Automation like a GUI Table Control or a GUI Ctrl Grid View. However, when we capture the page, we can already spot part of the problem.

Capture of the page in the Cloud Studio

Capture of the page in the Desktop Studio

As visible in the screenshots, we have a huge amount of GuiLabel elements. The table you can see on the screen consists of these elements. When we want to read one of the columns and capture the element with occurs, we can see that we require a lot of tests to recognize the elements.

Huge amount of tests when capturing columns of the table

This huge amount of tests (222 tests for 8 lines) can lead to a bad performance during the bot execution, especially when the table has more entries.

Solution

To avoid this, we can use a different technique that does not require to read the table in SAP. Instead, we will read the table in Excel. To export the table in Excel, we have to press Shift+F4 and click through two pop ups.

To automate the process, we first capture the two pop ups. For the second pop up, it is important to know that depending on whether the user or a script is accessing a page, the pop up differs. To capture the pop up that is called when the script is executing, just start a script recording on SAP GUI before opening it.

The%20first%20pop%20up%20for%20the%20export

The first pop up for the export

The%20second%20pop%20up%20for%20the%20export

The second pop up for the export

Automation in the Desktop Studio

The automation in the Desktop Studio looks like this:

The%20overall%20flow%20in%20the%20Desktop%20Studio

The overall flow in the Desktop Studio

In the first step, we execute the keystroke on the page Job Overview.

Implementation of the keystroke in the Desktop Studio

Then, the first pop up opens and we click on “Continue”.

Click%20on%20Continue%20in%20the%20first%20pop%20up

Click on Continue in the first pop up in the Desktop Studio

Next, we wait until the next pop up is accessible and then we click on “Replace”.

Click%20on%20Replace%20in%20the%20second%20pop%20up%20in%20the%20Desktop%20Studio

Click on Replace in the second pop up in the Desktop Studio

As a result, the table is opened and saved in a Excel File.

The result in Excel

 

Automation in the Cloud Studio

The automation in the Cloud Studio looks similar to the one in the Desktop Studio.

The%20whole%20flow%20in%20the%20Cloud%20Studio

The whole flow in the Cloud Studio

In the first step, we execute the keystroke on the page Job Overview.

The%20keytroke%20in%20the%20Cloud%20Studio

The keystroke in the Cloud Studio

Then, the first pop up opens and we click on “Continue”.

Click%20on%20Continue%20in%20the%20first%20pop%20up

Click on Continue in the first pop up

Next, we wait until the next pop up is accessible and then we click on “Replace”.

Wait%20for%20Replace%20and%20click%20on%20it

Wait for Replace and click on it

As a result, the table is opened and saved in a Excel File.

 

Conclusion

Automating SAP GUI screens with low hierarchies can be quite challenging when it comes to performance optimization. Usually, to optimize the performance, the recognition of the elements has to be improved. Unfortunately, with the structure of the table, this is not possible in the capturing process. In this blog post, we showed that it is possible in both the Desktop and the Cloud Studio when we use a small workaround with Excel.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.