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: 

Data Type Convertion in ABAP

Former Member
0 Kudos
1,239

Hi,

i want to convert a numeric type field to character type field in ABAP,

and also i want to concatenate some set of different types of field to a character type field at last

if i give just like this

<b>CONCATENATE ' ' it_pa0000-pernr it_pa0105-usrid ' ' it_pa0105-begda into record_tab-string.</b>

it remove space out from the string i need space also in the <b>record_tab-string</b>,

Reg,

Hariharan

5 REPLIES 5

former_member196280
Active Contributor
0 Kudos
394

Use like this

Ex:CONCATENATE num1 num2 num3 into num SEPARATED BY SPACE.

Regards,

SaiRam

Former Member
0 Kudos
394

Hi,

data : char(10) type c,

num(10) type n.

write num to char. " to convert num to char type..

and use SEPERATED BY SPACE in the concatenate statment to get the space after each field.

thanks

mahesh

Former Member
0 Kudos
394

Hi,

The CONCATENATE statement combines two or more separate strings into one.

<b>CONCATENATE <c1> ... <cn> INTO <c> [SEPARATED BY <s>].</b>

This statement concatenates the character fields <c1> to <cn> and assigns the result to <c>. The system ignores spaces at the end of the individual source strings.

The addition SEPARATED BY <s> allows you to specify a character field <s> which is placed in its defined length between the individual fields.

try with this sample code..........

CONCATENATE  it_pa0000-pernr it_pa0105-usrid  it_pa0105-begda INTO record_tab-string  SEPARATED BY SPACE.

regards,

Ashok Reddy

Former Member
0 Kudos
394

Dump all the datatype values into chracter values..

data: char1 type char20,

char2 type char20.

char1 = num1.

char2 = num2.

CONCATENATE char1 char2 SEPERATED by space.

Former Member
0 Kudos
394

hi guys,

what you guys told is correct but i need a more than one space in between two variable in concade operator,

str1 = 'Hari'.

str2 = 'Hariharan'

concatenate str1 ' ' str2 ' ' into str3.

i need str3 just like this

str3 = 'Hari Hariharan '

Reg,

Hariharan