ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Assignments →  Special Assignments → 

UNPACK  Syntax Diagram

Short Reference

Syntax

UNPACK source TO destination.

Effect

This statement converts the content of the data object source in accordance with special rules and assigns the converted content to the data object destination. source expects the data type p of length 16 without decimal places. Operands of data type decfloat16 or decfloat34 cannot be used. The data type of destination must be character-like and flat.

The conversion is performed according to the following rules:

Notes

Example

After the assignments are made, char1 and char2 contain the values "123,456" and "0000123456".

DATA: pack  TYPE p LENGTH 8 DECIMALS 3 VALUE '123.456',
      char1 TYPE c LENGTH 10,
      char2 TYPE c LENGTH 10.

char1 = pack.
UNPACK pack TO char2.

Exceptions

Catchable Exceptions

CX_SY_CONVERSION_NO_NUMBER

CX_SY_CONVERSION_OVERFLOW

Non-Catchable Exceptions