‎2006 Dec 12 4:51 AM
‎2006 Dec 12 4:52 AM
Hi,
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.
WRITE: / C_FIELD.
Thanks,
Naren
‎2006 Dec 12 4:52 AM
Hi,
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.
WRITE: / C_FIELD.
Thanks,
Naren
‎2006 Dec 12 5:00 AM
Hi,
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.
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'
Regards,
Ferry Lianto
‎2006 Dec 12 5:04 AM
hi,
execute this code, u will get the exact idea
REPORT ZTEST_UNPACK.
DATA : VAR(5) VALUE '123'.
WRITE : / VAR.
UNPACK VAR TO VAR.
WRITE : / VAR.Rgds
Anver
‎2006 Dec 12 5:13 AM
Hi Harika ,
Unpack command is used to add leading zeros .
This is usefull because when using many functions / in select statements the value is required in its full length.
An example of this is the function module 'CO2H_PROD_ORDER_READ' in this if u give the value of a valid production order of length 10 , it will execute and give u the result , but when u do the same from a program it will not give u the result the reasonf being that the FM starts to search for a the PO whose lenght is 10.
Now if you use the unpack command the 2 spaces which are blank are added as zeros in the front.
You can also try the same with material number.
Regards
Arun