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: 

adjusting space

Former Member
0 Kudos

hi folks,

I have to adjust the space while cocatenation of characters

If I have the data '7/08 TU MET ENT' I need the data to be spaced as

'7/08 TU

MET ENT'

Few days back one of the developers helped me with this code

constants: c_crt type x value '0D'.

concatenate zdate1 wa-vavartyp c_crt zbunit zposcc

into wa1-zdateproductcode separated by space.

but it throws an error saying that c_crt is not a char type

one of the other developer also gave me

concatenate ztotalwidth cl_abap_char_utilities=>cr_lf zzquantity into wabb1-zadsize separated by spac

this is working but I am getting '##' sign in the form I am displaying.

Can anybody help me to adjust the code here?

thanks

Santhosh

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you saying that you need that one string to be in two lines. If so, is having two strings out of the question.

Data: a(50) type c,
      b(50) type c.

concatenate zdate1 wa-vavartyp into a.
concatenate zbunit zposcc into b.

Regards,

Rich Heilman

0 Kudos

No , I need to have that in one string only but dbecause I will reading the data into a single variable and displaying it in two lines in the form.

Santhosh

0 Kudos

<<this is working but I am getting '##' sign in the form I am displaying.>>

What do you mean by form here ..

if you are displaying the results in ABAP then line - break character will be displayed as # but if you are downloading it into a file on PC or application server - and then if you will open the file with notepad, it should display the lines properly.

Thanks,

Ram

0 Kudos

HI Ram,

the data is getting displayed N THE SMARTFORM in this format

'7/08 TU ##

MET ENT'

I AM READING THIS ENTIRE DATA INTO A FIELD OF AN INTERNAL TABLE READING THAT INTO THE SMARTFORM.

SANTHOSH

0 Kudos

It will not work the way you want while displaying it in smartforms or ABAP Reports.

This can be used while downloading the data to text files...

I suggest, you break that variable into separate lines at line break character.

You might try ..something like

SPLIT var into itab at <line_break_char> ..

write this itab lines one by one.

cheers,

Ram

0 Kudos

I agree with Ram, as I stated earlier, If you want them to print on different lines, they are going to have to be two separate fields.

Regards,

Rich Heilman