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

char to packed

Former Member
0 Likes
440

Hi

how to convert char to packed decimal???

Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
399

Hi gullipalli,

DATA: char TYPE char10 VALUE '254.879,004'.

DATA: pac(10) TYPE p DECIMALS 2.

REPLACE ALL OCCURRENCES OF '.' IN char WITH space.

CONDENSE char NO-GAPS.

PAC = CHAR.

Read only

former_member386202
Active Contributor
0 Likes
399

Hi,

Use pack statement.

Example

DATA C_FIELD(4) TYPE C VALUE '0103',

P_FIELD(2) TYPE P.

PACK C_FIELD TO P_FIELD.

C_FIELD: C'0103' --> P_FIELD: P'103C'

Regards,

Prashant