ABAP

The ** load-of-program keyword in the ABAP help file is described as follows:

This event keyword defines the program constructor of an executable program, a module pool, a function group, or a subroutine pool. The program constructor is an event block whose event is raised by the ABAP-runtime environment when one of the executable programs mentioned above is loaded into the internal session.

Take Function Group as an example. Whenever any Function module in a Function group is called for the first time, the corresponding ABAP program is loaded into the internal Session. At the same time, the ABAP runtime throws load-of-Program, executing the event-handling logic written by the application programmer.

Now I have a function group called ZTOMCAT. Its load-of-program is responsible for popping up the debugger.

I have two reports. Source code for Report 2:

REPORT ZJERRY_RE2.

call FUNCTION 'ZTEST_FM_1'.
Copy the code

Report 1:

CALL FUNCTION 'ZTEST_FM_1'.

SUBMIT zjerry_re2 AND RETURN.
Copy the code

So if I do report1, will the breakpoint fire once or twice?

The answer is twice.

The behavior OF load-of-program in this scenario has been made clear by ABAP Help:

When a program is called using SUBMIT or using a transaction code, a new internal session is opened in every call and the event block is executed once in every call.

Each time program is called by way OF SUBMIT or transaction code, a new internal session will be started, in which load-of-program will be triggered once.

An Internal Session is created each time SUBMIT(Calling Programs) is called.

Duplicate loading of Tomcat library files is a problem

My POm. XML defines a Gson dependency that ABAPer can compare to calling the Gson API provided by Google in my Java code.

Question: Does Tomcat load only one copy of the contents of gson.jar into memory at runtime?

The answer is no. According to the official Documentation of Tomcat, Tomcat creates a unique ClassLoader instance for each Web application. The resources in the Web-INF \lib of each application are not visible to other applications and are isolated from each other.

discuss

For more of Jerry’s original technical articles, please follow the public account “Wang Zixi” or scan the following QR code: