2007 Mar 09 8:54 AM
Hi,
i'm reading a char value from a db table and assigning it to packed value . while storing the value back to db im just copying this packed value to a workarea where its defined as char and updating db. i'm using align while doing so.
it the correct way or do i need to use any function modules.
regards,
kumar.
Hi,
i'm reading a char value from a db table and assigning it to packed value . while storing the value back to db im just copying this packed value to a workarea where its defined as char and updating db. i'm using align while doing so.
it the correct way or do i need to use any function modules.
regards,
kumar.
2007 Mar 09 8:56 AM
Hello Kumar,
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
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.
The same runtime errors may occur as occur with the PACK statement.
Regards,
Vasanth
2007 Mar 09 8:56 AM
hi Kumar,
You can make use of <b>OIJY_CONVERT_CHAR_TO_PACK</b> FM for converting or <b>CHAR_PACK_CONVERSION</b>..
REgards,
Santosh
Message was edited by:
Santosh Kumar Patha