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

Error while concatenating amount field

Former Member
0 Likes
1,002

Hi,

While concatenating the amount filed with character field and numeric fields it is showing error message 'It must be a character type data object' how can i concatente it.

thanku in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
728

Hi,

U cannot directly concatenate interger and char

for that ; move the integer to char variable then concatenate.

example.


data : lv_int       type I,   " it can be currency ,  float.
       lv_char_int  type char16,
       lv_variable1 type char1,
       lv_data      type char30.


<b>lv_char_int = lv_int.</b>

concatenate lv_char_int
            lv_variable
        into lv_data. 

<b>Please Reward Points & Mark Helpful Answers</b>

To mark Helpful Answers ;click radio Button next to the post.

RadioButtons

<b>o</b> Helpful Answer

<b>o</b> Very helpful Answer

<b>o</b> Problem Solved.

Click any of the above button next to the post; as per the anwers

<b>To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers</b>

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
728

Hi,

First move that variable to char variable.

Then use the concatenate statement.

Integers can't be concatenated..

Cheers,

Simha.

Read only

ibrahim_u
Active Participant
0 Likes
728

you must convert to character types amount types.

ex:


data : sample(10) type p decimals 3.
data : charr(15) type c.
data : cuk(3) type c.
data : concat(100) type c.


sample = '12345.15'.
cuk = 'TO'.

write sample to charr.

concatenate charr cuk into concat.

ibrahim

Read only

Former Member
0 Likes
728

The best way is to use the UNPACK command...

I would suggest you to UNPACK the numeric field into a character one and than concatenate with the other character field.

Regards

Anurag