Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What's the difference between Include and Subroutine-pools?

SimonOne
Explorer
0 Kudos
822

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?

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
740

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).

4 REPLIES 4

Sandra_Rossi
Active Contributor
741

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).

matt
Active Contributor
740

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.

0 Kudos
740

So "Sub-routine pool" is a proper subset of "Include" ?

matt
Active Contributor
740

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.