In addition to associating super procedures with a specific object procedure, you can also add them to the entire OpenEdge session so that every procedure that executes in the session can take advantage of them. You do this by executing the ADD-SUPER-PROCEDURE() method from the SESSION handle:
SESSION:ADD-SUPER-PROCEDURE( hSuper ).
The search order the interpreter uses to locate internal procedures and functions becomes this:
  1. The procedure file the routine is run in (that is, either the procedure that actually contains the RUN statement or function reference or, if you use the RUN IN syntax or the DYNAMIC-FUNCTION . . . IN syntax, the procedure handle following the IN keyword).
  2. Super procedures added to that procedure handle, starting with the last one added.
  3. Super procedures added to the SESSION handle, starting with the last one added.

In addition, in the case of a RUN statement, if an internal procedure of that name is not located anywhere, the final step of the search is for a compiled external procedure (.r file) of that name.

You should exercise caution when adding super procedures to the session, precisely because their contents become available to absolutely every procedure run in the session. Nevertheless, this technique can be effective in some cases, especially for extending the behavior of existing application procedures without having to edit them to put in ADD-SUPER-PROCEDURE() methods. If the existing procedure was originally intended to run a compiled external procedure (.r file) and does not explicitly include the .p or .r extension on the filename reference in the RUN statement, then the external .r file can be replaced by a session super procedure that contains an internal procedure of the same name. This changes the behavior of the application without making any changes whatsoever to the existing application files (not even recompiling them).

Super procedures might seem like a complicated mechanism, but consider that they are intended to allow you to provide standard behavior for many procedure objects. This means that you can carefully craft the super procedure code for a type of behavior, and then every other procedure that uses that super procedure inherits the behavior automatically and transparently. This is the power of super procedures.