ABAPDATA_STRUC - DATA STRUC

rdisp/max_wprun_time - Maximum work process run time   CPI1466 during Backup  
This documentation is copyright by SAP AG.

DATA - BEGIN OF

Short Reference



Syntax

DATA BEGIN OF struc [READ-ONLY].
  ...
   INCLUDE TYPE|STRUCTURE ...
  ...
DATA END OF struc.

Effect

The declaration of a new struc structure.It is initiated using a DATA statement with the BEGIN OF addition and must be ended using a DATA statement with the END OF addition.

These two DATA statements can include any

The meaning of these statements is the same as in the definition of structured data types in sectionTYPES - BEGINOF. Here, however, it is used to generate a bound structured data type. A structure cannot be created without at least one component.

A component of type struc cannot itself be declared by means of reference to struc. Ifthe name struc is specified after LIKE when a component is declared, the system searches for the next object of this name in a higher visibilitysection and uses it if found. If no more global objects exist with this name, then a syntax error occurs.

Notes

  • The READ-ONLY addition is only possible for the whole structure and not for individual structure components (comp).

  • A structure cannot have the name text since this is reserved for addressing text symbols.

  • The BOXEDaddition cannot be specified between DATA BEGIN OF and DATA END OF when components aredeclared. Static boxes in structures can only be defined with TYPES.

  • In an obsoletevariant, you can also specify text field literals or the space constant as anonymous components between BEGIN OF and END OF.

  • The use of the OCCURS addition to define standard tables with structured row types is obsolete.


Example

In this example, a structure (spfli_struc) is declared with an elementary component(index) and a substructure ( spfli_wa). The SELECT loop shows a possible use of the nested structure.

DATA: BEGIN OF spfli_struc,
         index    TYPE i,
         spfli_wa TYPE spfli,
      END OF spfli_struc.

SELECT *
       FROM spfli
       INTO spfli_struc-spfli_wa.
  spfli_struc-index = spfli_struc-index + 1.
  WRITE: / spfli_struc-index,
           spfli_struc-spfli_wa-carrid,
           spfli_struc-spfli_wa-carrid.
ENDSELECT.




ABAP Short Reference   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.


Length: 4897 Date: 20120522 Time: 044940     triton ( 183 ms )