
Error Desciption:
After SAP upgrade / migration or fresh SAP system installation, transactions take longer time to execute.
Many programs stuck at popup like below example:

Cause:
After the upgrade or migration, ABAP sources are changed and these uncompiled ABAP sources take longer time to execute.
What is SGEN?
SAP SGEN also called as SAP System Load Generator is a transaction in SAP which is used to compile ABAP repository objects and generates ABAP load for programs, function modules, BSP applications (Business Server Page), web dynpros, functions, function groups, classes, methods, interfaces etc.
These ABAP objects are stored on their source code in table REPOSRC and used objects i.e. during runtime state they are stored in the table REPOLOAD.
In the fresh installation, none of these objects are compiled before until they are called for the first time.
For the upgraded/migrated SAP systems,SGEN should be run because these objects are modified during the activity.
Prerequisites :
- The process of regenerating the ABAP loads generates lots of Archive/transactional logs which consumes lot of space on database. We need to monitor the space utilization accordingly.
- Run this activity during low user load & avoid peak time otherwise it would create performance issue.
Ways To Run SAP System Load Generator (SGEN) :
There are multiple ways to execute SGEN:
- Using standard t-code SGEN
- SGEN called by SAP tools like System update manager (SUM).
For SGEN via SUM, we get the option we get multiple options in Advanced preconfiguration mode:
1) Do not start ABAP load generation during the update:
If we have high number of changes during update, select this option and execute it after update is finished.
2) Generate ABAP loads on shadow system during up-time.
If we choose this option, upgrade tool SUM will generate ABAP load on shadow instance in the update phase called SUBMOD_SHD2_RUN/RUN_RSGEN.
3) Generate ABAP loads on shadow system during uptime and start asynchronously in post downtime
The transaction SGEN automatically starts again after the downtime during the Post processing road map step to regenerate the ABAP loads that were invalidated during the downtime in the phase MAIN_POSTP/RUN_RSREGENLOD
Procedure for SAP System Load Generator (SGEN):
- Run t-code: SGEN and select relevant option: (here in our case we have used option ‘Regenerate After an SAP System Update as we have performed SAP SPS upgrade).

- Select the required software components and continue:

- Click on continue

We can monitor the progress via Job Monitor screen: