SAP DDICDDL DEFINE STRUCT COMPS



Get Example source ABAP code based on a different SAP table
  


• KEY ABAP_DDIC_DEFINE_STRUC
• REFERENCE TO ABAP_DDIC_DEFINE_STRUC
• BOXED ABAP_DDIC_DEFINE_STRUC
• NOT NULL ABAP_DDIC_DEFINE_STRUC

ABAP_DDIC_DDL - DEFINE STRUCTURE, component

ABAP_SYNTAX
$[component_annos$]
$[foreign_key_annos$]
$[geo_annos$]
$[KEY$] comp : ${ ${data_element $[ value_help$]
$[ foreign_key$]$}
$|abap.type $[(n)$|(n,m)$] $}
$| ${ REFERENCE TO any_type $}
$| ${ struct $[BOXED$] $}
$| ${ table_type $}
$[NOT NULL$];

What does it do?
Defines a single component in the definition of a DDIC structure using the statement DEFINE STRUCTURE in Dictionary DDL.
Optional component properties can be specified using annotations component_annos.
foreign_key_annos can be used to specify the properties of a foreign key dependency defined with foreign_key .
geo_annos specify properties of a component with the geodata type GEOM_EWKB.
comp indicates the name of the component.
data_element or abap.type is used to define an elementary component or a component with a reference type:
data_element can be used to specify an existing DDIC data element. If the data element has an elementary data type, an elementary component is defined. If the data element has a reference type, the component is defined with this reference type.
abap.type$[(n)$|(n,m)$] can be used to specify a built-in data type from the ABAP Dictionary and an elementary component of this type is defined. The prefix abap is mandatory and type indicates the type. n and m specify the length and number of decimal places, if required.
REFERENCE TO any_type is used to define a reference type. For any_type, the syntax abap.type$[(n)$|(n,m)$] can be used to specify any existing data types from the ABAP Dictionary, classes or interfaces from the class library, the generic types DATA or OBJECT, or built-in types.
struct $[BOXED$] is used to define a substructure. DDIC structures, DDIC database tables, or DDIC views can all be specified for struct. BOXED can be used to define the substructure as a static box.
table_type is used to define a tabular component. Table types from the ABAP Dictionary can be specified for table_type.
The additions KEY and NOT NULL can be used to define the component as a key field and to set a flag for initial values. The addition KEY has no effect when the structure is included in DDIC database tables.
BEGIN_SECTION VERSION 5 OUT It must be used for structure components that are used as lock parameters of lock objects.
END_SECTION VERSION 5 OUT The addition NOT NULL can be respected for structures that are included in DDIC database tables.
The addition value_help can be used to assign a search help to a structure component whose data type is defined using a data element with elementary data type.
The addition foreign_key can be used to define a foreign key dependency for a structure component whose data type is defined using a data element with elementary data type. This addition only makes sense for structures that are included in DDIC database tables.
BEGIN_SECTION SAP_INTERNAL_HINT
Setting the output style of decimal floating point numbers is missing.
END_SECTION SAP_INTERNAL_HINT



Latest notes:

The activation type (relevant only for DDIC database tables) cannot be modified using DEFINE STRUCTURE.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Definition of elementary components of the structure DEMO_DAY with reference to built-in dictionary types. In the example for include structures, the structure is included more than once in another structure. @EndUserText.label : 'Demo for include structure'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
define structure demo_day {
work : abap.char(8);
free : abap.char(16); }
ABAP_EXAMPLE_END