SAP NAMES REPOS OBJ - Guide
Get Example source ABAP code based on a different SAP table
GUIDELINE 4.7
Names of Repository Objects
ABAP_BACKGROUND
Repository objects are development objects that you edit using the tools of the ABAP Workbench. Each repository object is assigned to a package. Packages encapsulate the repository objects contained and use package interfaces to make objects available that should be usable outside the package. This complies with the
From a semantic point of view, packages represent a context for declarations, which is one level above the contexts of an ABAP program. Unlike the contexts of an ABAP program (programs, classes, procedures), a package does not generate a separate namespace.
The namespace for repository objects is defined as follows:
Development organizations (SAP departments, SAP partners, and SAP customers) can request a prefix namespace for their own development systems. A prefix namespace has a name with at least 5 and a maximum of 10 digits, and the first digit and last digit must be slashes (/.../). After the namespace has been assigned, repository objects only can be created in systems, where the namespace is enabled by prefixing the namespace name /.../. If a package is created in this type of prefix namespace, it can only contain repository objects belonging to the same namespace. However, you can create multiple packages within a prefix namespace. The available length for the actual name is reduced by the length of the namespace prefix, including the slashes.
If no prefix namespace is available, the names of repository objects created in customer systems or non-SAP development systems must have Y or Z as the first character. This means they are located in the customer namespace. Repository objects whose names start with Z can also be located within packages whose names start with Y and the other way round.
If no prefix namespace is available, there are no real restrictions for the names of repository objects that are created in SAP#s own development systems. The SAP namespace comprises the entire
ABAP_RULE
Use common naming conventions for repository objects. The predefined name prefixes, CL_, IF_, and CX_, apply to objects of the class library. If possible, create all repository objects in the prefix namespaces only. In addition, use a naming convention to clearly indicate which package or component the objects belong to.
ABAP_DETAILS
Classes and interfaces are the most important entities for
In addition, the names of all repository objects should clearly identify the package or component they belong to. Technically speaking, a package does not generate its own namespace and therefore naming requires strict discipline. Using prefix namespaces is very helpful in itself. However, they are not intended for the package level but for bigger development projects, which usually comprise numerous packages.
Therefore, the names of the repository objects contained in a package should be labeled with a shared name component, which indicates the affiliation to a package or at least to an application component. The length of names is restricted to 30 characters or less, and the namespace prefix is included. Therefore, you should use an abbreviation for this name component and not the complete package name.
You should never assign a universal name for a package-specific or component- specific repository object. This would render the name useless for further general use. For example, general names of the SAP namespace (such as CHAR60 for a data element or
If developers find a repository object with a universal name, they naturally assume that they can freely use the object in the way i ndicated by the name. Before the introduction of the operational package concept, there were no strict checks for package limits. As a result, repository objects with overly universal names (particularly in the SAP namespace and also in the customer namespace) are now used throughout all
Note
The above rule supplements the universal rule regarding
All development organizations are free to create own naming conventions on the basis of the above rule regarding
Exception
Not all repository objects can be created in prefix namespaces. Authorization objects and type groups are typical examples. In these cases, you should create an additional package that includes all of these objects. The object names and package names should, if possible, contain a relevant, normal prefix instead of the real namespace prefix /.../.
A similar guideline applies if further development is performed in areas that are traditionally located in the SAP namespace or the customer namespace. Instead of using a real namespace prefix, you can simulate this by using uniform prefixes when you create new packages and development objects.
If the ABAP Workbench itself allocates
Example
Refer to the repository objects of the sample application in the package
The subpackages of the SABAP_DEMOS_CAR_RENTAL package start with the same name as the superpackage (as