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: 

need space when concatenating

Former Member
0 Kudos

hello gurus

i want a space befor my hyphen and after the hyphen,

i tried using ' ' before and after the hyphen but i dont see any space...how to do that???

plz help

concatenate wa_Fin-a '- ' wa_fin-b into wa_fin-c.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
concatenate wa_Fin-a ' - ' wa_fin-b into wa_fin-c .
or,
concatenate wa_Fin-a space '-'  space  wa_fin-b into wa_fin-c .

regards,

Gurpreet

16 REPLIES 16

GauthamV
Active Contributor
0 Kudos

Did you SEARCH in SCN before posting ?

Press F1 on concatenate.

concatenate wa_Fin-a '- ' wa_fin-b into wa_fin-c seperated by space.

Former Member
0 Kudos
concatenate wa_Fin-a ' - ' wa_fin-b into wa_fin-c .
or,
concatenate wa_Fin-a space '-'  space  wa_fin-b into wa_fin-c .

regards,

Gurpreet

matt
Active Contributor
0 Kudos

I was going to reject this post, but saw the question about 5 spaces, so I decided it's sufficiently different to remain.

>

>

concatenate wa_Fin-a ' - ' wa_fin-b into wa_fin-c .
> or,
> concatenate wa_Fin-a space '-'  space  wa_fin-b into wa_fin-c .

>

> regards,

> Gurpreet

Nonsense. Have you tried it?

To the original poster. Concatenate ignores (removes) trailing spaces from the components. ( Generally - there are some exceptions in later releases, read F1 help for more info. ). If you need to retain spaces, or add extra ones in, try something like this

CONCATENATE field1 '#####-#####' field2 INTO output.
TRANSLATE output USING '# '.

matt

Edited by: Matt on Apr 2, 2009 8:21 AM

0 Kudos

Thank you so much Matt.........

I will try to use F1 as much as possible ....sometimes i dont understand ,,,,and feel here i get the apt answer i expect......

Anyways thanz all

matt
Active Contributor
0 Kudos

Often the F1 help isn't entirely clear. We're always happy to provide further explanation to people who've shown that they tried to help themselves.

0 Kudos

Hi Beginers ,

No worries,

You are always welcome to the Forums to clear your Ideas...

We just wanted you to have seach first..>! Thats it..!

Appologies if my post hurts you.

Thanks & Regards,

Dileep .C

Former Member
0 Kudos

Hi,

concatenate wa_Fin-a '- ' wa_fin-b into wa_fin-c SEPARATED BY space.

regards,

Naveen

0 Kudos

hi thanks

i want to leave 5 spaces or so , in such case separated by space leaves only one space ....

wat to do???

0 Kudos

please search sdn first

0 Kudos

Here's the logic

data: v_str type string.

concatenate 'Mahesh' '&' '&' '-' '&' '&' 'Reddy' into v_str.

replace '&' WITH SPACE INTO v_str.
replace '&' WITH SPACE INTO v_str.
replace '&' WITH SPACE INTO v_str.
replace '&' WITH SPACE INTO v_str.

write:/ V_STR.

In this you'll find double spaces between the strings.

Hope it helps

Mahesh

SEARCH in SCN you will get so many posts on using this statement for multiple spaces.

CONCATENATE text1 text2 INTO text RESPECTING BLANKS.

Former Member
0 Kudos

Whenver u need to have space between two words use the option 'seperated by space'.

This will provide you space between each word.

Former Member
0 Kudos

Hi,

If u want to cancatenate c1 c2 c3 in to C4 separated by spaces

use statement

concatenate C1 c2 C3 into C4 separated by spaces.

Thanks

Kaza

Former Member
0 Kudos

Hi,

Use like this

concatenate wa_Fin-a space '-' space wa_fin-b into wa_fin-c .

Regards,

Jyothi CH.

Former Member
0 Kudos

Hi Beginers,

When you post a query before search for that in SCN.

Before searching that search in ABAP F1 Help...(Best & Easy Guide to all Strings)

Before searching there Try to change your editor to new editor, where it automatically Shows the syntax.

It hurts to reply like this, But some day you will gain enough knowledge very Quickly.

Thanks & regards,

Dileep. C

Former Member
0 Kudos

This message was moderated.