SGEN – An Overview
What is SGEN?
You can use transaction SGEN to generate the ABAP loads of a number of programs, function groups, classes, and so on, as well as Business Server Page applications (BSP applications).
Before the generation is started, consecutive screens give you options regarding:
- Task of the generation
- Selection of generation set (= number of objects to be generated)
- Use of servers for parallel generation
IMPORTANT: If you want to regenerate loads, make sure that there is enough space available in the database. The space required can be several hundred MB. Generation over all components requires around 5 GB of free space.
SAP Uses Report RSPARAGENLOD to generate SGEN.
1. Select the generation task.
On the initial screen of transaction SGEN you can select the task that suits the purpose of the generation:
Generate all Objects of Selected Software Components
Choose this strategy if you want to generate the loads of all objects of certain software components. This may be the case, for example, if your system has been reinstalled. Here, the loads that are required for operation are not yet available and must be regenerated.
When you choose this task, you see the screen
Selection by Software Components of Generation Set
Here you are able to restrict the amount of objects to be generated by selecting software components. Use the pushbuttons to select the software components you require.
Regenerate After an SAP System Upgrade
After an upgrade, you have to regenerate the load of the ABAP objects in the system. Here, the following are required:
- The runtime of the generation process in transaction SGEN must be as short as possible.
- The storage space required by the ABAP loads in the database must not be too large.
- The generation effort on the part of the user must be as small as possible.
The following generation set takes the above requirements into account. It consists of all objects with loads, which were available in your system before the upgrade (that is, objects that you already used before the upgrade), and all objects that were redelivered in the release interval between start release and target release of your upgrade. The names of the objects that were generated before the upgrade were stored in the REPLIST file in the current directory of your system during the upgrade (profile parameter DIR_HOME).
When you choose this task, you see the screen(Same as mentioned above)
In the standard setting, all software components are processed. On this screen, you can restrict the generation set further by selecting software components. Use the pushbuttons to select the software components you require.
Regenerate the Objects of the Last Run
This task is suitable, for example, in the following cases:
- The generation of objects of the generation set that was used in the previous run was terminated and you want to regenerate the remaining objects.
- You want to regenerate all objects of the generation set that was used in the previous run.
After selecting this task, the following two options are available to you:
The generation set that was used in the previous run of transaction SGEN is used. Only those objects that were not generated in the previous run or whose generation was terminated due to a system error, are generated.
All objects of the generation set used in the previous run of transaction SGEN are generated.
Regenerate Existing Loads
This task allows you to regenerate all ABAP loads and invalidated loads that exist in your system, and to generate loads for objects of a Support Package queue. The following options are available to you:
- Generate all Objects with Existing Load
- Only Generate Objects with Invalidated Load
The load of an object is invalidated if, since the time the load was generated, activated changes were made to the object or to objects used by this object, such as includes or tables. This may occur by importing a Support Package (SPAM) or a kernel patch.If you want to generate loads for objects of a Support Package queue, start the task after importing the queue. The task determines the generation set using the invalidated loads in the system. In contrast with the Generate objects of a transport request task, this task also takes into account ABAP loads that were invalidated by modified Dictionary objects.
You also have the option of regenerating invalidated loads periodically (for example, every night or at times when system load is low) and automatically. To do this, schedule the report RSGENINVLASM in the background with the required execution time and period. This report determines the invalidated loads for each machine type in your system for the relevant time and regenerates them.
Generate the Objects of a Transport Request
This generation taks regenerates the ABAP load for all objects that can be generated in a transport request. It ignores, however, any ABAP loads invalid by modified dictionary objects. For these, use the task
Regenerate Existing Loads -> Only Generate Objects with Invalidated Load
After selecting this task, you can find and specify the transport request name directly by using the selection button on the next screen.
Generation of BSP Applications
This tasks enables you to generate the BSP applications of selected software components.
Each Business Server Page is realized technically by an ABAP Objects class. When BSP applications are generated, these classes and their ABAP loads are created. BSP applications are not included in the generation sets of the tasks
Generate All Objects of Selected Software Components, Regenerate After an SAP System Upgrade, and Regenerate Existing Loads, since they are only optional. They can be handled as part of this task.When you choose this task, you see the screen
Selection by Software Components of Generation Set
Here, you can restrict the set of BSP applications to be generated by selecting software components. Use the pushbuttons to select the software components you require.
If you want to interrupt the generation of the BSP applications, or if the system cancels the generation, you can use the task :
- Regenerate the objects of the last run
- to resume the generation.
2. Select the server to be used for parallel generation.
The generation is based on a parallelized procedure. It splits the generation set into smaller subsets which are handled by parallel processes. Depending on the resources available, the existing servers are incorporated into the parallel processing jobs, with multiple parallel processes running on a single server.
The screen Selection of Servers for Parallel Generation can be used to select those servers to be used for parallel processing. Note the loads are dependent on the machine type (MT) of a host computer. This means that the generation set is defined for each selected machine type in the table GENSETM.
The default selection is dependent on the server where you are logged on. It is the same as your logon server and all servers in your system with the same machine type. If you want to use the default selection, choose Continue.
If you want to exclude specific servers from the genreation or if you want to generate the load for a machine type other than the machine type of your logon server, then use the checkboxes to select the servers in questions and choose Continue.
Important: The parallel servers are organized using the logon groups in transaction RZ12. For each machine type, transaction SGEN creates a logon group with the name of the machine type. Do not use these groups for your own purposes, since transaction SGEN redefines them continuously.
Once you have selected the servers, the system starts to define the generation set automatically and save it to the database (DB table GENSETM). This can take some minutes.