SAP® Documentation

Single view

ABAPASSIGN_TYPE - ASSIGN TYPE

BAL Application Log Documentation   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

ASSIGN

Addition 2

... TYPE type
See No Obsolete Casting Allowed With ASSIGN.

Effect

With an untyped field symbol, this addition allows you to change the current type of the field symbol to type. The displayed length of the field symbol is adjusted to that of the new type.
With typed field symbols, you should only use this addition if the type of the field f is not compatible with that of the field symbol <fs>. The specified type type must then be compatible with the type of the field symbol. Since there is no conversion (unlike in a MOVE statement), the system must be able to interpret the contents of f with the type type.

You specify the type as a literal or a field. You can currently only specify a system type (C, D, T, P, X, N, F, I or W), as well as type 's' for a 2-byte integer with plus or minus sign, and 'b' for a single-byte integer without plus or minus sign (see also DESCRIBE FIELD).

Note

This type of statement causes a runtime error if the system cannot recognize the specified type or it is incompatible with the field you want to assign (wrong alignment or length). Länge).

Example

DATA LETTER TYPE C.
FIELD-SYMBOLS <F> TYPE ANY.
ASSIGN LETTER TO <F>.

The field symbol has the type C and output length 1.

ASSIGN LETTER TO <F> TYPE 'X'.

The field symbol has the type X and output length 2.






BAL_S_LOG - Application Log: Log header data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 2144 Date: 20200126 Time: 040319     sap01-206 ( 23 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.