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: 

add line feed to string

Former Member
0 Kudos

Hello everyone,

I have a Form that will output a bar code. That bar code is composed of 4 fields from a table that are concatenated into a string. The problem is that the client wants to read the bar code and have an output with 4 distinct lines on screen.

So, i need to add to my result string 3 carriage returns/line feeds. How do i do that ?

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Hi Nuno,

When you concatenate try using the abap char utility for newline as well.

i.e CL_ABAP_CHAR_UTILITIES=>NEWLINE.

concatenate field1

CL_ABAP_CHAR_UTILITIES=>NEWLINE

field2

CL_ABAP_CHAR_UTILITIES=>NEWLINE

field3

CL_ABAP_CHAR_UTILITIES=>NEWLINE

field4

into v_result.

Regards,

Ravi

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos

Hi Nuno,

When you concatenate try using the abap char utility for newline as well.

i.e CL_ABAP_CHAR_UTILITIES=>NEWLINE.

concatenate field1

CL_ABAP_CHAR_UTILITIES=>NEWLINE

field2

CL_ABAP_CHAR_UTILITIES=>NEWLINE

field3

CL_ABAP_CHAR_UTILITIES=>NEWLINE

field4

into v_result.

Regards,

Ravi

Former Member
0 Kudos

Hi

See the BARCODE you need by trx SE73.

So you should use that barcode as chararcter type when you print your output.

Max

0 Kudos

Very helpfull answers !!

Thank you all.