PACK

Basic form

PACK f TO g.

This statement is not allowed in an ABAP Objects context. See Cannot Use PACK.

Effect

Places the character field f in packed format in the field g. Reverse of the UNPACK statement.

Example

DATA C_FIELD(4) TYPE C VALUE '0103',
     P_FIELD(2) TYPE P.
PACK C_FIELD TO P_FIELD.

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

Note

The field f can contain up to 16 characters.

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