Documente Academic
Documente Profesional
Documente Cultură
Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner
About
About
Ask a Question Write a Blog Post Login
Tobias Trapp
more by this author
Retagging required
tobias trapp s views on sap technology
share
0 share tweet share
Follow
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 1/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
concept was – besides object orientation and ICF – the most important
innovation of the ABAP application server. The reason is simple: the package
concept allows to develop software so that is “soft” which is necessary for
evolution of any software system.
In my opinion too many custom development projects don’t care about this
and most developers don’t know about the ABAP package concept. I can only
guess the reason: At the beginning of a development project the aspects of
software logistics and naming conventions (Z or a customer namespace) are
first challenges. Usually packages and namespace prefixes for development
objects are defined to group some objects according some obvious properties:
there is one package for FI development, another one for HCM and so on.
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 2/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
I give you some example: When I wrote my last blog about a Operations
Research & ABAP within SAP standard I learned how to use it by studying unit
tests and package interface:
The ABAP package concept allows you to create stable APIs of a package.
This means that you can distinguish between public and private parts
(implementation details) that can be changed.
But package concept has many other use cases – we can define
dependencies to other packages of SAP standard as well to your own
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 3/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
packages:
You can define dependencies to SAP standard. This can help you in
SAP software updates because you use stable API and control the
dependencies which is very help in impact analysis of SAP Switches &
Business Functions of EhPs.
In a larger development project you can structure your application. You
can define your own stable APIs to tell the developers who to use APIs
and to protect some parts you would like to change in the future. This is
most important if you want to decouple applications for an independent
release cycle.
If you are delivering software components using the Add On Assembly
Kit the control of dependencies to guarantee the installability of custom
made SCs.
To come to the conclusion: ABAP package concept is the most important tool
for software architecture. You can use package checks as part of extended
syntax checks and Code Inspector to check violations of package interfaces.
I’ll discuss these and even more aspects of the ABAP package concepts here
and will even go deeper into pesky details. If you like at SE80 you will find
different options for package checks – “as client” and “as server”.
And last but not least there are two different package check modes:
RESTRICTED and R3ENTERPRISE. You may ask why the concept is so
difficult. In my opinion SAP had no other chance: the software structure of R/3
was too complex and there have been too much unwanted dependencies. On
the way to ECC 6.0 SAP had to solve many problems – the most urgent
comes from the introduction of EhPs that allows to define packages which are
activated after switching in a business function on the customer system.
Therefore you have to control dependencies because no object of a non-
switchable package is allowed to use an object that is switchable. In my
opinion the package concept is a necessary step for development of
switchable units. But therefore SAP had to deal with R/3 code with many
unwanted dependencies – so the definition of a strict and Java-like package
concept was not possible – SAP had to define check modes that allow
violations of package interfaces.
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 4/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
SAP and ISVs delivers the software as software components. You can find the
list of installed software components in transparent table CVERS. You can
think of Software components (in short SCs) as special transports containing
metadata. Those transports are installed using transaction SAINT. Let me ask
some simple questions:
There are some differences between SCs (or SWCVs – software component
versions) in both worlds – but one is very important: An SC in Java defines a
persistence unit in terms of JEE. In fact there is no such concept in ABAP –
we have concepts like internal modus and LUW. In Java SCs contain DCs and
so called top level DCs define the “visible” objects of an SC.
What about packages and SCs? These are completely different concepts. An
SC is an artifact from software logistics and can contain complete packages
(in an installation package – AOI). Packages can be assigned to software
components but in contrast to packages they have no representation in ABAP
Workbench.
In Java there is a concept of visibility – you can protect develop objects from
being accessed. In Sap NetWeaver CE there is an additional concept of
accessability. In ABAP there is none of such concepts. Event circular
dependencies are possible which will lead to compilation errors in Java.
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 5/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
If you use the data model of an SAP standard application, you should
exactly the data elements of the application.
But misusing them will bring you into trouble. In most cases short texts
and documentation is not correct. The definition of own data elements
will allow you to define proper texts and documentation. Another
consequence of misuse of data elements is that your software is not
merger ready with SAP standard tools like Landscape Transformation:
Basic Operations.
I think I have to clarify the last aspect. When you want to merge and split
systems or change the SAP data (think of organizational management) or
customizing in a disruptive way with tools like SAP LT you have to ensure that
your custom developed application is merger ready. Landscape
Transformation: Basic Operations works on the level of ABAP domains and
will change the value if domains whether they are in transparent tables or in
intransparent data containers. So merger readiness means exactly that that
you develop the way it is described above.
Use SAP domains only if you have a good reason. Merger readiness of
an ABAP application is such a reason. Consider the case that you want
to define a role of the SAP Business Partner application. Therefore you
should create a new data element to have be able to define short texts,
F1-help and search-helps. In this case you should reuse the
BU_PARTNER domain of SAP Standard so that landscape
transformation tools can analyze that this is an proper extension.
If you are using domains like CHARxyz please check whether they are
exposed in package interfaces. And please check to which application it
belongs to avoid unwanted dependencies to SAP applications you don’t
use. Otherwise package checks against package interface are not
useful because they’ll produce too much error messages.
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 6/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Alert Moderator
21 Comments
You must be Logged on to comment or reply to a post.
Peter Langner
Hi Tobias,
thank you for that great blog. I also have the experience, that many ABAP developers
still think in development classes and only have a poor knowledge of the packadge
concept. There is still a lot of work to tell the story…
Peter
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 7/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Hi Peter,
glad you liked the blog. I think in the next part I’ll explain how to look for
package interface and how to create them.
Cheers,
Tobias
Krishnendu Laha
Former Member
Hi Julius,
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 8/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
you are absolutely right: when you use package checks SAP developers
are forced to use proper APIs containing autority checks – I think I already
mentioned it. But I will get in detail when I will discuss best practices for the
content of package interface: put classes and functions modules into an
interface but not the table structure. Is that what you have in mind?
Cheers,
Tobias
Hi Julius,
you are absolutely right: when you use package checks SAP developers
are forced to use proper APIs containing autority checks – I think I already
mentioned it. But I will get in detail when I will discuss best practices for the
content of package interface: put classes and functions modules into an
interface but not the table structure. Is that what you have in mind?
Cheers,
Tobias
Former Member
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 9/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Hi Tobias,
AFAIK the package check is not only limited to SE80.
Cheers,
Julius
Peter Inotai
Hi Tobias,
Nice topic. I’m looking forward for the next one
We use package check with R3ENTERPRISE on SAP R/3 4.70/Basis 6.20. Unfortunately it’s
really time-consuming to set up and maintain, but it works
I already had a chance to look at the NW 7.10 version, which looks much more convenient.
Keep blogging,
Peter
Hi Peter,
Best Regards,
Tobias
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 10/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Hi Peter,
Best Regards,
Tobias
Peter Inotai
Peter
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 11/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Best Regards,
Tobias
Best Regards,
Tobias
Peter Inotai
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 12/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Peter
Peter Inotai
Thanks,
Peter
Best Regards,
Tobias
Peter Inotai
Peter
Kumud Singh
Hello,
I read twice to get into the feeling of it.Thanks for writing it this ways. When you move into
practical, can I please request you to show an example wherein we can combine standard
SAP into our customized application development.
Just my thought,at your wish certainly.
I am yet to read the book though which yourself and thorsten suggested. (Development from
Scratch)
Regards,
Kumud
Former Member
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 14/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
This is an important and timely topic for many projects. As the ABAP development landscape
continues to evolve, best practices for software logistics need to evolve as well. Hopefully
more and more projects will embrace this concept as a result of your blog series.
Paul Hardy
I have been thinking about this ever since I heard you give a talk on this subject in SAP
Inside Track in Bonn in 2010.
I have to confess I still don;t understand 100%, but have a gut feeling this is really
important, even for programmers who do not develop third party add-ons for SAP
systems.
Say I have a special class to handle the really complex logic regarding monster special
properties (do they have seven heads, are they a hundred foot tall, do they breathe fire
etc).
Many applications use this class, and I gather the idea is to have the calling classes only
know a bout the interface the special class implements, and not the real class itself.
In Java, as I understand it, you do this to reduce compilation time, as when you change
a class all the concrete classes the changed class reference have to recompile as well,
but not if you use references to interfaces as opposed to references to concrete classes.
Naturally we do not have the problem in ABAP of programs taking a very long time to
compile, but we still use interfaces in order to favour composition over inheritance.
Anyway, is the desired architecture that the calling applications are all in their own
packages, the special class is in it’s own package, and the interface is in yet another
package? That seems to be the design Martin Fowler uses in his book on refactoring,
when he introduces interfaces to reduce the compilation time of classes.
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 15/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
What about custom DDIC elements? Do they live in their own package? Or do you have
more than one identical DDIC object with different names in different packages?
Cheersy Cheers
Paul
Hi Paul,
Cheers,
Tobias
P.S.: Let’s talk about monsters. If I remember right NW 7.30 had a slightly
different package concept but luckily (at least I think this way) this was
discontinued in SAP NetWeaver 7.40, 7.5 and will hopefully vanish forever
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 16/17
10/3/2018 ABAP Package Concept Part 1 The Basics | SAP Blogs
Trademark Sitemap
Newsletter
https://blogs.sap.com/2011/12/04/abap-package-concept-part-1-the-basics/ 17/17