Application Development and Automation 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: 
Read only

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

SimonOne
Explorer
0 Kudos
1,365

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
Read only

Sandra_Rossi
Active Contributor
1,283

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
Read only

Sandra_Rossi
Active Contributor
1,284

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

Read only

matt
Active Contributor
1,283

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.

Read only

0 Kudos
1,283

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

Read only

matt
Active Contributor
1,283

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.