When starting to learn the SAP ABAP programming, I’ve found that there are extremely lacks of real life example of ABAP program that’s can be used as a perfect starting point of how the ABAP application works.
At the start of any session, when the SAP GUI client tries to connect to the R/3 System, the server always presented the very familiar login screen to get and validates user’s authentication information.
So, I think the most perfect sample ABAP program to be learned should be this authenticaton or login screen, because every elements of the programming aspects should be represented by this program.
The importance of understanding this program is more emphasized because it will link to another modules that constructs the building blocks to accomplish many tasks after the login phase is successfully carried out, i.e. what kind of modules that gets activated after each successful login, how to perform compilation and loading customized programs etc.
By understanding the inner working of this program, I believe I will have the robust foundation to move on to another aspects of ABAP programming.
By examining the DIAG stream and the extensive trace log information at R/3 side of the application, I came to know, that when the user connects to R/3 server for the first time, the server will load and submits the SAPMSYST ABAP program to the client.
It is by the virtue of this program that the user will be represented by all too familiar SAP Logon Screen :

After knowing the program name, it’s time to log-on to the ABAP Editor and view this module. But when I try to display the source of ‘SAPMSYST’ :

The editor fails to show it, instead, it shows “Operation terminated” :

Whereas I can view any other elements such as the screen, etc, except the program that is the starting point information. Without the program, I will only get an incomplete picture of how the login mechanism works.
So, I am sifting through the trace log files and eventually found that the ABAP source code repository is located in D010S table and I can view for any program except SAPMSYST.
So, it would be nice if I can replace the view-able program, for example the existing S_AUTHORITY_CHECK with the SAPMSYST program. Then I should be able to view the SAPMSYST programs using S_AUTHORITY_CHECK as its surrogate.
After performing the tedious task of replacing the source code in the BLOCK binary data field of D010S as described above, I am ready to start again.
The plot thickens because, the editor still shows the “Operation terminated” message.
So, I decided to examine the R/3′s disp_work.exe that performs the source code access. And by the help of trace file, before long, I found that after accessing the BLOCK field, the server calls CsDecompr routine to perform decompression of the source code.
By performing the break point just after decompression is done, I’ve noticed the curious string of decompressed SAPMSYST program :

Whereas any other program do not have one. So, using the memory write, after the decompression process, I try to replace the this string with series of spaces (0×20) and this time no “Operation terminated” and I can now view the SAPMSYST program :
