2023 Feb 09 7:13 AM
I usually create Include to include some external subroutines.
But today I saw another type of program called Subroutine-pools.
Is there any difference between Include and Subroutine-pools?
2023 Feb 09 9:03 AM
Subroutines are obsolete since 7.02 (for 20 years). Consequently, subroutine pools too.
Subroutine pools are independent programs dedicated to contain subroutines.
Includes can contain anything and are part of other programs. They should be considered as obsolete too.
You should use ABAP Objects only (and possibly function modules when strictly necessary).
2023 Feb 09 9:03 AM
Subroutines are obsolete since 7.02 (for 20 years). Consequently, subroutine pools too.
Subroutine pools are independent programs dedicated to contain subroutines.
Includes can contain anything and are part of other programs. They should be considered as obsolete too.
You should use ABAP Objects only (and possibly function modules when strictly necessary).
2023 Feb 09 9:43 AM
The correct use of includes was to organise large programs. Unfortunately, they have often been used to include common code in many different programs. This is an abomination unto the clean code paradigm.
They're also a bit of a pain in Eclipse/ADT.
2023 Feb 10 1:54 AM
2023 Feb 10 7:38 AM
No. A subroutine pool is not a proper subset of a include because it isn't an include. To the contrary, a subroutine pool may contain includes.
But as Sandra says, they've been obsolete for a very long time.
The only proper use nowadays (excluding legacy pools) is dynamically generated subroutine pools, containing a single initial subroutine that calls a method of a local class and not containing any other functional code.