Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Annotations →  ABAP CDS - Specifying Annotations →  ABAP CDS - Annotation Syntax 

ABAP CDS - Annotation Syntax, subannos

Other versions: 7.31 | 7.40 | 7.54

Syntax

... subAnno1[:   value  ]
           |[: { subannos } ]
           |[: [ arrelem ] ]
           |[.subAnno[ ... ]],
    subAnno2[:   value  ]
           |[: { subannos } ]
           |[: [ arrelem ] ]
           |[.subAnno[ ... ]],
    ...

Effect

Comma-separated list of subannotations subAnno1, subAnno2, ... in the curly brackets of an annotation. The name of a subannotation can contain letters, numbers, and underscores only and must start with a letter. The same information can be specified after the name as specified after the main annotation:

  • A colon (:) followed by the following:
  • Further subannotations subannos specified in curly brackets { ... }.
  • The chaining of the subannotations subAnno1, subAnno2, ... with a further subannotation subAnno using a period (.).

Only those subannotations should be specified that are supported by the associated annotation definition.


Note

As well as by using a comma-separated list in curly brackets, individual subannotations can also be specified using individual structured annotation names.


Example

The following annotation definition is applied.

@Scope:[#VIEW, #EXTEND_VIEW]  
define annotation  
  DemoSubAnnos: {  
    subAnno1: Boolean;  
    subAnno2: { subAnno1: Integer;  
                subAnno2: { subAnno1: Integer;  
                            subAnno2: Integer; } } };

The annotation can then, for example, be specified as follows:

@DemoSubAnnos: {subAnno1: true,
                subAnno2: { subAnno1: 1,
                            subAnno2: { subAnno1: 1,
                                        subAnno2: 2 } } }

This example has the same semantics as the example using structured names.