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: 

concatenation with dynamic space - with abap cds view

0 Kudos

hi,

we need to concatenate 3 elements with dynamic space.

for example:

concatenate element with 3 digit and after it we need 5 spaces or

element with 4 digit and after it we need 4 spaces.

we need to calculate the spaces and put it in the concatenate_with_space function as the third argument.

thank you,

Omer

6 REPLIES 6

ArthurParisius
Contributor
0 Kudos

From your question I understand that you want the elements to start at a specific spot in your end variable.

Why don't you just use the offset and length part of string manipulation to get your result without looking at concatenate?

DoanManhQuynh
Active Contributor
0 Kudos

So how do you calculate the space...The easiest way i think is instead of concatenate space, you replace it with some kind of special character, after concatenate you can replace those character with space.

former_member185414
Active Contributor
0 Kudos

If you need to create elements with fixed size, you can find there runtime length using strlen( ). Then subtract the number of length from the size and get the number of spaces. Then run a do loop and concatenate that many spaces in the element.

horst_keller
Product and Topic Expert
Product and Topic Expert

Your question does not make it clear enough that you talk about ABAP CDS. Everybody gives you ABAP Language answers, but there, it is trivial.

0 Kudos

i want to do it in ABAP CDS View

0 Kudos

hi,

i need to do it in CDS View , any suggestion to do it?

thanks,

Omer