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

concatenate stmt.

Former Member
0 Likes
846

Hi All,

I need to use a varibale of type i in my concatenate stmt.But i am getting an error that it shud be of type c,n,d,t.But I need to use integer as my value is large.

Below is the stmt in my code.

CONCATENATE 'There is/are' count 'active BP assignment(s) on' into text1 separated by space.

Here count is of type i. But I get error at this stmt .Pls guide on this.

Hi All,

I need to use a varibale of type i in my concatenate stmt.But i am getting an error that it shud be of type c,n,d,t.But I need to use integer as my value is large.

Below is the stmt in my code.

CONCATENATE 'There is/are' count 'active BP assignment(s) on' into text1 separated by space.

Here count is of type i. But I get error at this stmt .Pls guide on this.

7 REPLIES 7
Read only

Former Member
0 Likes
815

Hi,

use type N.

this will help you.

or initially you keep value in i type variable and then move that to N type variable.

Regards,

vijay

Read only

Former Member
0 Likes
815

Its very simple.

Store your interger value in some character type of field by declaring specially for concatenation purpose.

After that try concatenate statement using character type variable.

data : m_count type i.

data : m_cnt type c.

move m_ciunt to m_cnt.

and use m_cnt on concatenate.

Regds,

Anil

Read only

Former Member
0 Likes
815

hi,

you can only use c,n,d,t.

first u use type i for populating the variable then move it to another variable of the above type and then use CONCATENATE..

Hope it helps

thanks

Read only

Former Member
0 Likes
815

Hi Amardeep,

You can assign that integer value to a varaible of type c and then you can concatenate the contents as per requirement..

thanks & Regards

Ashu Singh

Read only

Former Member
0 Likes
815

hi.

chk this code snippet.

DATA: text1 TYPE string,
      count TYPE i VALUE 1234567890,
      text2 TYPE string.
MOVE count TO text2.
CONCATENATE 'There is/are' text2 'active BP assignment(s) on' INTO text1 SEPARATED BY space.
WRITE text1.

Thanks

Read only

Former Member
0 Likes
815

Hi,

ABAP offers implicit type conversions.

If you want to concatenate a string and an integer use the following,

DATA:

lv_string type string,

lv_int type i.

lv_string = '4567'.

lv_int = 10.

lv_int = lv_int + lv_string.

lv_string = lv_string + lv_int.

Regards

P Bansal

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
815

try this


data:abc type i value '123'.
data:xyz type c value 'A'.
data:out(255) type c.
write abc to out.
condense out.
concatenate xyz out into out.
condense out.
write out.