2009 Jul 08 11:40 AM
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.
2009 Jul 08 11:42 AM
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
2009 Jul 08 11:42 AM
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
2009 Jul 08 11:46 AM
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
2009 Jul 08 11:52 AM
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
2009 Jul 08 11:55 AM
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
2009 Jul 08 11:58 AM
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
2009 Jul 08 12:21 PM
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.