Programs within an internal session form program groups. There is always a main program group and the opportunity of several additional program groups. Each program group contains a main programm and possibly further programs.
When an internal session is created by calling an ABAP program the main program group is created and the called program forms its main program. The entire session lives as long as the main program of the main program group is executed. This can be an executable program, a module pool, or a function group.
Every time a new function group or a new class pool is loaded, an additonal program group is created and the function group resp. the class pool is the main program of the additional program group. An additional program group is preserved for the entire lifecycle of the internal session.
Program groups are exclusively expanded with further programs via external subroutine calls (an exception to this rule is the statement SET PF-STATUS OF PROGRAM prog if the set GUI status contains dynamc function texts. In this case, the program prog is also loaded to the current program group). If in a program of a program group, a subroutine of another executable program (not loaded yet), module-pools or subroutine pools are called, its framework program is loaded and included in the program group. Calling an unloaded subroutine of a function group, in contrast, opens an own program group.
A program group works exclusively with screens, selection screens, lists and GUI status of the main program. For example, the statement CALL SCREEN does not call a screen of its own framework program in an externally called subroutine, but a screen of the main program. The reaction to user actions also takes place in the main program.
Interface work areas, that are declared with TABLES, NODES or DATA BEGIN OF COMMON PART, are only created once per program group and used together. Each main program shares the interface work areas with the framwork programs of the external subroutines.