Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8653

Re: how to sum the concatenated fileds in abap?

$
0
0

Hi,

 

Try this. It will work. As mentioned, you need to use P for adding and char or string for concatenating.

 

 

: lv_text1 type p decimals 2,

      lv_text2
type p decimals 2,     

      lv_sum1
type p decimals 2,

      lv_sum2
type p decimals 2,

      lv_text3
type string,

      lv_sum1c
type string,

      lv_sum2c
type string.



lv_text1
= '100.00'.



lv_text2
= '20.00'.



lv_sum1
= lv_text1 + lv_text2.

lv_text1
= '30.00' .



lv_text2
= '40.00'.



lv_sum2
= lv_text1 + lv_text2.

lv_sum1c
= lv_sum1.

lv_sum2c
= lv_sum2.

concatenate lv_sum1c lv_sum2c into lv_text3.

write lv_text3.

 


Viewing all articles
Browse latest Browse all 8653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>