Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the significance of u0093UNPACK COMMANDu0094?

Former Member
0 Kudos

What is the significance of “UNPACK COMMAND”?

Cheers,

Reethu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Source: ABAPDOCU

This statement converts the content of the data object 'FROM' according to a specific rule and assigns the converted content to data object 'TO'.

It is used for Type Conversion.

1. If the data type of 'FROM' is not of the type p with length 16 and without decimal places, then the content of 'FROM' is converted to this data type. Any decimal separator in source is completely ignored.

2. Value will be transferred to 'TO' with right alignment and having + or - sign any additional places filled with leading ZEROS. If the 'TO' variable is not sufficient then it is truncated from the left.

4 REPLIES 4

Former Member
0 Kudos

Hi,

UNPACK

Converts type P variables to type C.

Syntax

UNPACK <f> TO <g>.

Unpacks the packed field <f> and places it in the string <g> with leading zeros. This can be reversed with the PACK statement.

Reward if useful

Regards

Former Member
0 Kudos

Hi Reethu,

UNPACK Converts variables from type P to type C.

Syntax

UNPACK TO .

Unpacks the packed field and places it in the string with leading zeros. The opposite of

PACK.

Reward points if helpful..

Regards,

Goutham.

Former Member
0 Kudos

Hi Reethu,

UNPACK TO .Unpacks the packed field field1 and places it in the field field2 with leading zeros. If field2 is too short, it is truncated on the left.

The UNPACK command converts the content of the data object 'FROM' according to a specific rule and assigns the converted content to data object 'TO'.

It is used for Type Conversion.

1. If the data type of 'FROM' is not of the type p with length 16 and without decimal places, then the content of 'FROM' is converted to this data type. Any decimal separator in source is completely ignored.

2. Value will be transfered to 'TO' with right allignment and having + or - sign any additional places filled with leading ZEROS. If the 'TO' variable is not sufficient then it is truncated from the left.

eg : -

data: v_matnr like mara-matnr,

c_test(10) value '1234'.

unpack c_test to v_matnr.

v_matnr now contains 000000000000001234

Reward if useful.

Regards,

Chandru

Former Member
0 Kudos

Source: ABAPDOCU

This statement converts the content of the data object 'FROM' according to a specific rule and assigns the converted content to data object 'TO'.

It is used for Type Conversion.

1. If the data type of 'FROM' is not of the type p with length 16 and without decimal places, then the content of 'FROM' is converted to this data type. Any decimal separator in source is completely ignored.

2. Value will be transferred to 'TO' with right alignment and having + or - sign any additional places filled with leading ZEROS. If the 'TO' variable is not sufficient then it is truncated from the left.