UNPACK

Basic form

UNPACK f TO g.

Effect

Unpacks the packed field f and places it in the field g with leading zeros. If g is too short, it is truncated on the left.

Example

DATA: P_FIELD(2) TYPE P VALUE 103,
      C_FIELD(4) TYPE C.
UNPACK P_FIELD TO C_FIELD.

P_FIELD: P'103C' --> C_FIELD: C'0103'

Notes

  1. If f is not type P, it is converted to type P (see MOVE).

  2. g should always be type C. Otherwise, unwanted side effects may occur.

  3. The sign in the packed number is ignored.


Exceptions

Catchable Exceptions

CX_SY_ASSIGN_OUT_OF_RANGE

CX_SY_CODEPAGE_CONVERTER_INIT

CX_SY_CONVERSION_NO_NUMBER

CX_SY_CONVERSION_OVERFLOW

Non-Catchable Exceptions