Application Development and Automation 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: 
Read only

packed to char

Former Member
0 Likes
546

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.

2 REPLIES 2
Read only

Former Member
0 Likes
493

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

Read only

Former Member
0 Likes
493

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