Reputation: 2111
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
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
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
Reputation: 13639
The naming conventions indicate the possible names additionally to the mandatory naming "convention":
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
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