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

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

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

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

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

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

matt
Active Contributor

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.