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 move a decimal value into string

former_member295881
Contributor
0 Kudos

Hello Experts,

I've a requirement where I need to copy a decimal into string so that I can upload a file on server. However, I gets the error when I try to move.

For reference here is my code and data types..

data: lv_line  type string.

        CHARGES type charges.

move gv-charges to lv_line.

Can anybody please help me to resolve this issue.

Many thanks in the advance.

3 REPLIES 3

pavanm592
Contributor
0 Kudos

Hi,

seems like declaration error you ended the declaration after lv_line with a full stop (.) , and using a different variable gv_charges in moving data and declared chagres.

do like this

data: lv_line  type string,

         gv_CHARGES type XXOVRSZAMT. "charges.

move gv-charges to lv_line.


Regards,

Pavan

Former Member
0 Kudos

hii ZERO

define one variable type string or char 15 then pass this value to variable.

from screen shot it suggests that you are using concatenate statement.. hope this will help you out

Regards

Gaurav

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Try:

FORM test_07 .

   DATA: charges TYPE p DECIMALS 2.

   charges = '122555.39' .


   DATA: output_1  TYPE string .

   output_1 = charges .

   DATA: output_2  TYPE c LENGTH 15 .

   WRITE  charges to output_2 LEFT-JUSTIFIED .

   BREAK-POINT .

* look at the output fields .

ENDFORM .  


                     


Regards.