Application Development 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: 

how to convert a curr type to char

Former Member
0 Kudos

hi all,

i am using subroutine where V_UNITPRICE = 4.67 (of type BSEG-WRBTR). Now when i assign it to a char say OUTTAB-VALUE = V_UNITPRICE where OUTTAB-VALUE is of type char255.

the value is not assing to OUTTAB-VALUE .

kindly do the needful.

is there any function module?

points will be rewarded

thank in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi jaysree,

1. use <b>CONDENSE OUTTAB-VALUE</b> .

2. The value is there, but it is on the RIGHT most side,

and since it is 255 in length, it does not show on screen.

3. just copy paste.

REPORT YAM_TEMP04.

data : v_unitprice type bseg-wrbtr.

V_UNITPRICE = '4.67' .

data : s type char255.

s = v_unitprice.

condense s.

break-point.

regards,

amit m.

5 REPLIES 5

Former Member
0 Kudos

HI..,

It will definitely work..

Can u post ur actual code here !!!!

regrads,

sai ramesh

Former Member
0 Kudos

Hi jaysree,

1. use <b>CONDENSE OUTTAB-VALUE</b> .

2. The value is there, but it is on the RIGHT most side,

and since it is 255 in length, it does not show on screen.

3. just copy paste.

REPORT YAM_TEMP04.

data : v_unitprice type bseg-wrbtr.

V_UNITPRICE = '4.67' .

data : s type char255.

s = v_unitprice.

condense s.

break-point.

regards,

amit m.

varma_narayana
Active Contributor
0 Kudos

Hi..

Try this ...

<b>Write V_UNITPRICE TO OUTTAB-VALUE left-justified.</b>

This will work..

<b>Reward if Helpful</b>

Former Member
0 Kudos

Hi,

You can use the FM HRCM_AMOUNT_TO_STRING_CONVERT to convert it from amount to string format.

Regards

Former Member
0 Kudos

Hi,

Your code will work fine, but the only thing is the value 4.67 will be stored at the extreme right of the variable OUTTAB-VALUE and the value of the vaiable will get printed only if the LINE-SIZE of the report is GE 255.

You can verify this by placing break point after the value assigment statement, and checking the variable using offset : OUTTAB-VALUE+230(25).

If you want to remove the leading BLANK spaces, you can use the following statement.

CONDENSE : OUTTAB-VALUE(removes the leading BLANK spaces).

Regards,

Dilli