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: 

Line break in string concatenation

Former Member
0 Kudos

Hi

According to following link .. I tried to concatenate line break in string concatenation

and my code is like this... I'm on ECC6


DATA: line_br(2) TYPE X VALUE '0D0A'.

DATA: v_line TYPE string.

CONCATENATE 'LINE1' 'LINE2' INTO v_line SEPARATED BY line_br.

"But I'm getting syntax error like  line_br must be a character-type object 

"any other solution please...???

6 REPLIES 6

vinod_vemuru2
Active Contributor
0 Kudos

Hi Perez,

Declare the variable line_br as character data type. CONCATENATE statement will allow type c, n,string.

DATA: line_br(4) TYPE c VALUE 'ODOA'.

Thanks,

Vinod.

Edited by: Vinod Kumar Vemuru on Mar 29, 2008 6:51 PM

0 Kudos

thank you for reply vinod...

If i define line_br as CHAR

then my output is like this...

LINE10DLINE2

but I want like this..

LINE1

LINE2.

Former Member

hi ,

do like this ..it is not allowed with type x..

DATA: line_br(4) TYPE c VALUE '0Aew'.

DATA: v_line TYPE string.

CONCATENATE 'LINE1' 'LINE2' INTO v_line SEPARATED BY line_br.

write:/ v_line .

regards,

venkat.

Clemenss
Active Contributor

Hi Perez,

on unicode systems, starting with ECC600 all SAP systems, you must use attributes of class CL_ABAP_CHAR_UTILITIES. Look at the attributes of this class and use what you need,


CONCATENATE 'LINE1' 'LINE2' INTO v_line SEPARATED BY cl_abap_char_utilities=>cr_lf.

should do it.

Regards,

Clemens

Former Member
0 Kudos

Hi ,

Please use the declaration as follows.

DATA: v_NEWLINE(2) TYPE X VALUE '0D0A' (4.6c)

4.7 and 7.0

data: l_cr(1) type c value cl_abap_char_utilites=>cr_lf,

l_lf(1) type c value cl_abap_char_utilities=>linefeed.

Regards,

Venkat

0 Kudos

Just to share...

I was using a fm: FITP_POPUP_TO_INFORM, which I intended to pass in a string with linefeed.

On examination, the FM deletes away my linefeed (cl_abap_char_utilities=>cr_lf).

I found a substitile with vertical tab (cl_abap_char_utilities=>cr_vertical_tab).

Works just as well.