Download the SAP Load Testing Methodology
Go back to all articles

SAP Load and Performance Testing Using LoadRunner

Mar 15, 2022
5 min read

SAP ERP (Enterprise Resource Planning) is an enterprise resource management software that covers the work of an entire company. SAP is the market leader in enterprise application software, helping companies of all sizes and industries run at their best: SAP customers generate 87% of total global commerce. If this is the case in your company, you might have asked yourself how to test your SAP’s performance and which tools to choose. In this article, we will share the basics of testing SAP ERP with LoadRunner.

Key Takeaways:

  • LoadRunner is one of the most widely used enterprise tools for SAP performance testing.
  • It supports SAP GUI, SAP Web, and SAP Fiori, allowing simulation of end-to-end business processes.
  • Correlation and parameterization are essential for creating reusable test scripts in dynamic SAP environments.
  • Performance bottlenecks often appear in transaction-heavy modules like FI, MM, and SD.
  • Monitoring server resources (CPU, memory, database queries) during load is critical for root-cause analysis.
  • Proper workload modeling ensures realistic user behavior and helps validate system scalability before go-live.

Why Do You Need to Test Your SAP Performance?

Like any ERP system, SAP has to provide its users with up-to-date, reliable data about the current state of affairs for decision-making. Besides, this kind of information must be reliably protected. With the development of your company, the ERP system must be updated and rebuilt according to new business goals, which leads to the need for testing. But which tools should you use to test the performance of your SAP? Selecting the right tool for application performance testing is crucial for achieving reliable results. While this article focuses on LoadRunner, understanding the NeoLoad and LoadRunner differences can help you make a more informed decision for your specific needs.

Is LoadRunner a Good Tool for SAP Performance Testing?

LoadRunner is the perfect tool for executing SAP performance testing. It understands the protocol used by the SAP GUI interface and can record or reproduce it, so it can build a robot and generate thousands of copies of it almost instantly to execute the performance test.

There are two main types of SAP scripts: SAP-GUI and SAP-WEB. Before you start recording the script, check if you have two basic prerequisites:

  • get access to all the necessary roles, including the scripting role;
  • study the business process, and go through it manually, without recording, to identify any possible issues and to check the availability of all roles.

Recording Scripts with SAP GUI

To test the SAP application, choose SAP GUI:

Recording scripts with SAP GUI 1

Choose SAP Logon in the Application menu, then choose the location of your application (although it is usually chosen automatically). Click Start Recording to start recording the script.

Recording scripts with SAP GUI 2

The application starts running. At this stage, select a system to be tested by double-clicking it.

Recording scripts with SAP GUI 3

In the User/Password fields, the password field will not show characters, so be careful when entering the password. For instance, it was possible to make a mistake only twice in our project. After the third attempt, the account was blocked.

Recording scripts with SAP GUI 4

After entering your login and password, you will be transferred to the system’s main page you chose to test. There, act according to the script.

Recording scripts with SAP GUI 5

If you need to, switch to another tab using the command mentioned in the testing script.

Recording scripts with SAP GUI 6

Need Help with SAP Load Testing?

Debugging SAP-GUI Scripts

After recording the script, the next steps are parameterization and correlation.

Debugging SAP GUI Scripts 1

Snapshots displayed graphically will help you to do so: click a cell, a button, or any other element, and add the function you need. For example, add a row that will fill the cell with other data or, on the contrary, pull out the data for further work.

Debugging SAP GUI Scripts 2

Sometimes, you will have to use spy applications, such as Object Spy, to view certain arguments, paths, or an ID of a particular object (e.g., a button), since Snapshot is not always enough.

Debugging SAP GUI Scripts 3

After recording the scripts, you will see that some parameters in the table were parameterized automatically. You’d better edit them since problems may arise later. However, don’t forget that there are different types of parameters, and some cells accept only the tabular ones.

For example, we filled in two ExpTy fields with the value “AIR” and two Amount fields with the value 1000.

Debugging SAP GUI Scripts 4

As you can see, two values were written into one variable, “{data}.”

Debugging SAP GUI Scripts 5

The value of the first row of the column was recorded in the variable, too. So, it’s better to edit the code and separate the variables.

Debugging SAP GUI Scripts 6

After you change sapgui_table_fill_data into sapgui_set_text, the link will also specify the session number and the window number, which will need to be removed (ses[0]/wnd[0]/). Otherwise, they will cause an error if multiple test runs are used.

Debugging SAP GUI Scripts 7

If errors occur when running the script, you can run the script with the display. To do so, go to Runtime Settings→General→Performance, and check all fields. You will need to arrange lr_think_time() in order to see the location of the error or run the script in step-by-step mode.

Debugging SAP GUI Scripts 8

Problems and Solutions in Performance Testing of SAP GUI with LoadRunner

Check for a pop-up window

Sometimes, the same action can bring different results. For example, an additional window may be displayed, and ignoring it is impossible. For this case, we have a ready-made solution.

if (sapgui_is_object_available("wnd[1]")){             

            sapgui_select_active_window("wnd[1]");    

            sapgui_press_button("exit", 

                "ses[0]/wnd[1]/tbar[0]/btn[0]", 

                LAST);

            sapgui_select_active_window("wnd[0]");

        }

Check for an empty string

If you need the resulting number to use it in the future after saving or executing the script, run a check. This is necessary so that if, for some reason, the number does not appear, the script cannot continue its work.

Checking for an empty string should be run before Action.

void failIfEmpty(char * parname) {

lr_save_string(parname,"par");

if(lr_eval_string(lr_eval_string("{{par}}"))[0]==0)

lr_exit(LR_EXIT_VUSER,LR_FAIL);

}

Action{

//the function is called internally after correlation

//failIfEmpty(parameter); example :

sapgui_status_bar_get_param("1","ram_contract", LAST);

 // correlation, you’re pulling  out the created contract

failIfEmpty("ram_contract");

// check what you pulled out. If it is empty, the script will be completed with an error.

}

A detailed description of LoadRunner functions is available on the website https://admhelp.microfocus.com.

Recording Performance Testing Scripts for SAP WEB with LoadRunner

It turns out that recording and debugging SAP WEB scripts is not much different from recording and debugging Web-HTTP/HTML scripts. When you create a new script, select SAP – Web protocol.

Recording performance testing scripts for SAP WEB with LoadRunner 1

The snapshot shows RequestBody and ResponseBody, whilst web_url, web_submit_data, and web_add_header are written in the code.

Recording performance testing scripts for SAP WEB with LoadRunner 2

Conclusions

You can use the LoadRunner performance testing tool to do the performance testing for SAP GUI or SAP WEB Applications. You will need to understand concepts like SAP GUI protocol, Control IDs, Grids, Object IDs, Verification Points, etc., but trust us, it is absolutely doable.

If your plate is full right now, never do tomorrow what you can let us do today. PFLB is a specialized performance testing company with 450+ engineers on staff who have completed 300+ major projects. Rest assured, they can help with yours, too.

💡 Read Our Case Studies:
– SAP ERP Load Testing for a Retail Company ->
– SAP BW Comparative Load Testing (Oracle vs SAP HANA vs EXADATA) ->
– SAP ERP Load Testing for a Major Meat Producer ->

Related insights in blog articles

Explore what we’ve learned from these experiences
15 min read

Top 10 Load Testing Tools for 2025: The Deep Dive

best load testing tools preview
Sep 9, 2025

Effective testing is all about choosing the best load testing tool, which is just right for you. Top performance testing tools help simulate virtual users and execute test scripts. As the software market is full of various options ranging from open-source to premium, it’s difficult to find the best load testing tool for your business. In this article, we will share our list of top software load testing tools and take a closer look at their pros and cons.

4 min read

Website Load Testing Tutorial for QA Engineers

website load testing with pflb preview
Sep 8, 2025

Performance testing is no longer reserved for specialized engineers. In the AI era, QA professionals can extend their functional testing skills to include load testing because new tools automate the most challenging aspects. PFLB offers an AI‑powered load testing platform that eliminates manual scripting and data analysis, letting you build realistic tests and receive detailed […]

9 min read

Why Your Software Needs a Performance Testing Strategy?

why your software needs a performance testing strategy preview
Sep 5, 2025

Building software is one thing. Making sure it performs well when real people depend on it is another. An app might look great in development, pass internal reviews, and even impress beta testers, but the real test comes when it faces unpredictable traffic, poor connections, or heavy workloads. A well-planned performance testing strategy removes the […]

9 min read

PageSpeed Insights A Complete Guide

pagespeed insights preview
Sep 2, 2025

When a page loads too slowly, people leave before they’ve even seen your content. For businesses, that means missed opportunities and lower visibility in search results. PageSpeed Insights, the tool from Google, was built to highlight exactly why a site is slow and what can be done about it. Instead of guessing, you get a […]

  • Be the first one to know

    We’ll send you a monthly e-mail with all the useful insights that we will have found and analyzed