Ulrich Scholz
Ulrich Scholz

Reputation: 2111

List of ABAP protected type names

Out of curiosity, I tried to create an ABAP interface with name object. The compiler gives the error message "OBJECT" is a protected type name and therefore cannot be used for a user's own type definitions.

While this check is certainly a good idea, I could not find a reference to protected type name in the ABAP Keyword documentation. Are there others?

Upvotes: 2

Views: 266

Answers (3)

MrSamael
MrSamael

Reputation: 5

The best way to create all of your object or program or table ect.. is to put the Z or the Y before the name you want to give:

Object have to been Zobject or Yobject or ZY-YZobject

Often, we use the Z and then the module wich it refers: ZSD_OBJECT

Upvotes: 0

József Szikszai
József Szikszai

Reputation: 5071

The generic data types, which cannot be used for naming:

https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenbuilt_in_types_generic.htm

Upvotes: 3

Sandra Rossi
Sandra Rossi

Reputation: 13639

The naming conventions indicate the possible names additionally to the mandatory naming "convention":

  • The names of predefined ABAP types or predefined data objects must not be used for data types or data objects.
    • NB: I tried names of predefined data objects, they are allowed for data types, so I guess "respectively" is to be understood implicitly.
  • Self-defined data types must not have the name of a built-in ABAP type. This applies to type definitions in the ABAP language and in the ABAP Dictionary.

Concerning the generic types, only those made of one word are forbidden, i.e. HASHED, INDEX, SORTED, and STANDARD are allowed (and also REF):

  • ANY, C, CLIKE, CSEQUENCE, DATA, DECFLOAT, N, NUMERIC, OBJECT, P, SIMPLE, TABLE, X, XSEQUENCE

Other types are protected like the built-in concrete (i.e. not generic) types (error <XXXX> is a protected type name and therefore cannot be used for a user's own type definitions):

  • D, DECFLOAT16, DECFLOAT34, F, I, STRING, T, XSTRING
  • CURSOR
  • Obsolete types 1 and 2 (their names are also forbidden inside classes and interfaces because the name must start with A-Z, underscore).

Other types may be forbidden (error Type <XXXX> is reserved for future further developments of the ABAP language. Choose another name.) like:

  • INT, INT1, INT2, INT4, INT8

The list is not exhaustive. I didn't find an official list in the ABAP documentation nor in the SAP support Web site.

NB: tests done in a 7.52 system

Upvotes: 4

Related Questions