ABAPFIELD-SYMBOLS_OBSOLETE_TYPING - FIELD-SYMBOLS OBSOLETE TYPING

CPI1466 during Backup   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

FIELD-SYMBOLS - obsolete_typing

Short Reference



Obsolete Syntax

... { } | STRUCTURE struc DEFAULT dobj ...

Additions

1. ... { }

2. ... STRUCTURE struc DEFAULT dobj

Effect

These additions for the FIELD-SYMBOLSstatement make the typing of the field symbol obsolete and is not allowed in classes.

Addition 1

... { }

Effect

If an explicit type is not declared after the FIELD-SYMBOLS statement, the field symbol is implicitlytyped with the full generic type any. Furthermore, the predefined constant space is implicitlyassigned to the field symbol when the context is loaded. This means that the field symbol is not initialdirectly after its declaration and is true when checked with IS ASSIGNED.

Addition 2

... STRUCTURE struc DEFAULT dobj

Effect

If the STRUCTURE addition, which is forbidden within classes, is specified for a field symbolinstead of typing, whereby struc is a local program structure (a data object, not a data type) or aflatstructure from the ABAP Dictionary, this structure is applied to the <fs> field symbol. dobj must be used to declare a data object that is assigned to the initial field symbol.

The field symbol has the technical properties of the struc structure, as with complete typing. When a data object is assigned using the DEFAULT addition or later with ASSIGN, its full data type is not checked in non- Unicode programs; the check carried out only determines whether it has the minimum length of the structure and itsalignment.

In Unicode programs, structured and elementary data objects are distinguished. In the case of a structured data object dobj, itsUnicodefragment view must match that of struc. For an elementary data object, this must be character-typeand flat, and struc must only be character-type. The same applies when data objects are assignedto field symbols typed with STRUCTURE by means of the ASSIGN statement.

Note

Field symbols declared with the STRUCTURE addition are a combination of typed field symbols and a utility forcastingto structured data types. For typing field symbols, the TYPE and LIKE additions of theFIELD-SYMBOLS statement should be used, whereas the CASTING addition of the ASSIGN statement is used for casting.

Example

The first example shows the obsolete use of the STRUCTURE addition.

DATA wa1 TYPE c LENGTH 512.
FIELD-SYMBOLS <scarr1> STRUCTURE scarr DEFAULT wa1.
<scarr1>-carrid = '...'.

The second example shows how STRUCTURE is replaced by the TYPE and CASTING additions.

DATA wa2 TYPE c LENGTH 512.
FIELD-SYMBOLS <scarr2> TYPE scarr.
ASSIGN wa2 TO <scarr2> CASTING.
<scarr2>-carrid = '...'.

See also field symbols, particular structures.


Vendor Master (General Section)   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.


Length: 4764 Date: 20120522 Time: 055231     triton ( 190 ms )