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: 

insert mulltiple empty space in a string

AJeB
Participant
0 Kudos
335

how to insert multiple space in a string?
note: lv_string contains multiple space only
i tried

data lv_string type string.

if i debug the string is '' and the length is 0

4 REPLIES 4

matt
Active Contributor
242

DATA(my_string) = | |.

DATA(my_string) = ` `.

FredericGirod
Active Contributor
0 Kudos
242

Using ' ' means CHAR ´ ´ means STRING

Sandra_Rossi
Active Contributor
0 Kudos
242

bolivs22 and to continue what Matthew and Frederic said, when a variable of type CHAR contains trailing spaces, they are ignored by most of ABAP statements, hence not appearing in the target variable of type STRING.

JackGraus
Active Contributor
0 Kudos
242

` ` would be better here compared to | | as | | is to be used for strings containing variable ABAP data.