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

help with concantenate

Former Member
0 Likes
995

I have the following statement and it is only putting in the firls letter of the last name

DATA:FINALNAME TYPE C.

CONCATENATE TRAN_STRUCTURE-NACHN+0(40) ',' ' '

TRAN_STRUCTURE-VORNA+0(40) ' '

TRAN_STRUCTURE-MIDNM+0(40) INTO FINALNAME.

RESULT = FINALNAME.

I have the following statement and it is only putting in the firls letter of the last name

DATA:FINALNAME TYPE C.

CONCATENATE TRAN_STRUCTURE-NACHN+0(40) ',' ' '

TRAN_STRUCTURE-VORNA+0(40) ' '

TRAN_STRUCTURE-MIDNM+0(40) INTO FINALNAME.

RESULT = FINALNAME.

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
968

You need to define the lenth of FINALNAME, try this.l

DATA: FINALNAME(40) TYPE C.

Regards,

RIch Heilman

Read only

0 Likes
968

BTW, as you have it defined without a length specification, the system thinks that FINALNAME is a character field of a length of 1, this is why you are only getting the first character.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
968

Hi,

Use like this:

CONCATENATE TRAN_STRUCTURE-NACHN+0(40)

','

TRAN_STRUCTURE-VORNA+0(40)

TRAN_STRUCTURE-MIDNM+0(40)

INTO FINALNAME

SEPARATED BY space.

Thanks and Best Regards,

Vikas Bittera.

Read only

0 Likes
968

Hi,

USE :

DATA : finalname(255) TYPE c.

Thanks and Best Regards,

Vikas Bittera.

Read only

0 Likes
968

thanks. This worked using the "separated by SPACE". I tried changing the size of the field but that didn't work. thanks again

Read only

0 Likes
968

It alsmost works but it puts a space between the 1st field and the comma like below

James ,

Read only

Former Member
0 Likes
968

change ur declaration.

DATA: FINALNAME(200) TYPE C.

Shreekant

Read only

Former Member
0 Likes
968

also instead of ' ' you can use seprated by space.

Shreekant

Read only

Former Member
0 Likes
968

Thanks