Ansicht
Dokumentation

ABAPTYPES_INDICATORS - TYPES INDICATORS

ABAPTYPES_INDICATORS - TYPES INDICATORS

ABAP Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

TYPES, INDICATORS

Short Reference



TYPES dtype TYPE struct WITH INDICATORS ind
                       $[TYPE type$|AS BITFIELD$].


Additions

1. ... TYPE type

2. ... AS BITFIELD

Effect

Derivation of a structured data type with an indicator structure with the name ind. For struct, an existing local or global structured type must be specified. For ind, a name must be specified that follows the naming conventions.

This variant of the statement TYPES defines a structured data type that has the same components as the structured type struct specified behind TYPE, as well as an additional last component named ind as an indicator structure. The last component ind is a substructure that contains the same number of first-level components as struct, in the same order as in struct and with the same names as in struct. The standard data type of each component is x of length 1 and can be defined explicitly with the optional addition TYPE.

Notes

  • The main purpose of an indicator structure is to serve as an ABAP SQL indicator. The addition WITH INDICATORS facilitates the definition of null indicators or set indicators for ABAP SQL statements. This is especially important for the UPDATE statement with the addition INDICATORS, since no inline declarations can be used there.
  • The indicator structure is created equally for each data type of a first-level component of struct. This means that, for example, each substructure or each reference variable is mirrored in the same way as an indicator component is mirrored as an elementary component of struct.

Example

An internal table that has a line structure with an indicator structure is partly filled with today's flight data for a given flight connection from the DDIC database table SFLIGHT. In the internal table, the price is reduced by 80 %. The modified table is used to update the respective date in the database table. While the lines that are to be updated are selected by the content of key fields in the internal table, the column to be updated is indicated by marking the column PRICE of the indicator structure. Without using the INDICATORS addition of the UPDATE statement, all other non-key columns of the database table would be initialized since their values are initial in the internal table.

Addition 1

... TYPE type

Effect

Definition of the data type of each component of the indicator structure ind. The same applies to type as to TYPES ... TYPE abap_type and TYPES ... TYPE. Each non-generic local or global data type that is visible at the current position can be specified. The generic built-in ABAP types c, n, p, and x can also be specified and their standard length is defined implicitly.

Note

For ABAP SQL indicators, only the types c and x of length 1 are relevant.

Example

See examples for UPDATE ... FROM ... INDICATORS.

Addition 2

... AS BITFIELD

Effect

Defines ind as bit field which is part of the structured data type dtype. The use case is the same as with the indicator structure. In this case, using a bit field saves space.

Example

The third column of the result set of the SELECT statement contains the null value because the WHEN condition of the CASE expression is false and no ELSE is specified. Accordingly, the position of the component z in the bit field wa-null_ind_bit contains the value hexadecimal 1. The example includes multiple GET BIT statements.






BAL_S_LOG - Application Log: Log header data   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 6131 Date: 20240425 Time: 193751     sap01-206 ( 106 ms )