UNPACK is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.
UNPACK f TO g.
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.
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′
If f is not type P , it is converted to type P (see MOVE ).
g should always be type C . Otherwise, unwanted side effects may occur.
The sign in the packed number is ignored.