Home » SAP » Basis » understanding sgen and pxa buffer

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

Leave a Reply

Categories

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3 other subscribers

%d bloggers like this: