Home » Posts tagged 'sgen'
Tag Archives: sgen
understanding sgen and pxa buffer
There are n number of ABAP program in the system used for various functionalities/purposes, all these ABAP programs are stored in REPOSRC, for example below are the total number of programs in a S4HANA system.
Some are kind of must programs that needs to be compiled instantly when a user logs into the system or executes a transaction code. These compiled codes are placed in a table REPOLOAD, for example below are the total entries in a S4HANA system.
This table REPOLOAD is tightly integrated with PXA buffer, the PXA buffer is controlled by below parameters
- abap/buffersize
- abap/pxa_cache
- abap/pxa_preload
- abap/buffer_fragments
we can see the utilization of PXA or program buffer in ST02
Now,
- When we start the AS ABAP Server, pxastat and pxanew in work directory is created, first wp-1 loads pxauserload, then pxanew, then pxastat, then will rename pxanew to pxastat, this deletes old pxastat, the pxa buffer is filled up to the percentage specified in abap/pxa_preload, once it is reached the preload is stopped. Once wp shutsdown it writes its pxa to pxanew.
- if we run the ABAP program (or tcode) first time, it compiles and stores in REPOLOAD then stores in PXA buffer.
- If we run another time the same ABAP program (or tcode), and the compiled program in REPOLOAD is changed then it will relook in REPOSRC compile it, place the compiled program in REPOLOAD, whenever a program is compiled it is placed in PXA buffer.
Now as I mentioned above parameters, there can be situations where the program might be dropped, then it will be again picked up from REPOLOAD into PXA, now if DB version is different we will get dump LOAD_PROGRAM_LOST.
Now if we activate a program from SE80 or SE38 then the activation timestamp is changed and PXA marks it as old, this information is sent to all abap servers asynchronously. Then all the reactivation process mentioned above is carried out.
With S4HANA we have a new job introduced with 1909, “SAP_SGEN_REGENERATE_LOADS”. The purpose of this is to minimize waiting times for users or developers by regenerating invalidated loads.
This job is periodic job which runs every hour, and run sgen for invalidated loads.
References
- 2849402 – Jobs in the Technical Job Repository (SJOBREPO) in SAP S/4HANA 1909
- 2190119 – Background information about SAP S/4HANA technical job repository
- 2849337 – Jobs in the Technical Job Repository (SJOBREPO) in SAP S/4HANA 1809
- 2581518 – Jobs in the Technical Job Repository (SJOBREPO)
- 672268 – Runtime error LOAD_VERSION_LOST
- 1259546 – Short dump LOAD_VERSION_LOST as of Release 7.0
- 438038 – Automatic regeneration of invalidated loads
- 1989778 – FAQ: SGEN
- 2905158 – SGEN is triggered frequently in the system higher than S/4HANA 1909
- 23642 – Description of pxanew and pxastat
- https://wiki.scn.sap.com/wiki/display/ABAP/PXA+%28Program+eXecution+Area%29+-+ABAP+Program+Buffer
- https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=464696199
You must be logged in to post a comment.