UNPACK

Short Reference

Syntax

UNPACK source TO destination.

Effect

This statement converts the content of the data object source according to a specific rule and assigns the converted content to data object destination. For source, the data type p of length 16 without decimal places is expected. The data type of destination must be character-type and flat.

The conversion is performed according to the following rules:

Notes

Example

After the assignments,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.

MOVE   pack TO char1.
UNPACK pack TO char2.

Exceptions

Catchable Exceptions

CX_SY_CONVERSION_NO_NUMBER

CX_SY_CONVERSION_OVERFLOW

Non-Catchable Exceptions