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

conversion from decimal to char

Former Member
0 Likes
2,181

Hi experts,

i am using some function module which has parameter of type char(132) . now i have to pass packed no p(7) decimals 3

to this how to do it . if i send directly function module raising run time error ( type conflict).

how we can do this.

regards,

santosh.

Hi experts,

i am using some function module which has parameter of type char(132) . now i have to pass packed no p(7) decimals 3

to this how to do it . if i send directly function module raising run time error ( type conflict).

how we can do this.

regards,

santosh.

4 REPLIES 4
Read only

Former Member
0 Likes
1,367

Declare a variable of type char132 and pass the packed variable value to the char variable and pass it to the FM

Read only

Subhankar
Active Contributor
0 Likes
1,367

Hi,

1st: Before calling FM declare one local variable of type in FM (I think it should be p(7) decimals 3 ).

2nd: Transfer the value to this lo local variable from CHAR132.

3rd: Pass the local variable to FM

Thanks

Subhankar

Read only

Former Member
0 Likes
1,367

Hi Santosh,

Try this code for conversion.

DATA: AMOUNT(7) TYPE P DECIMALS 3.
DATA : VAR TYPE CHAR13.
DATA : VAR_1(132).

AMOUNT = '12345.333'.

WRITE AMOUNT TO VAR.
VAR_1 = VAR.
CONDENSE VAR_1.

AND PASS THE VALUE OF VAR_1 TO YOUR FM.

HOPE THIS WILL SOLVE YOUR PROBLEM.

Read only

Former Member
0 Likes
1,367

Hi,

1, USe FM FLTP_CHAR_CONVERSION to convert Packed value to Char.

2, Then pass the Char value to your FM.

Hope it helps,

Regards,

Shanmugavel Chandrasekaran