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: 

Regarding concatenation and new line..

former_member242166
Participant
0 Kudos

Hi experts,

I have four variables , i am concatenating these 4 variables into one variable but i am getting the output continually , But i want the output as following.This is report program using for mail triggering.

Examples: 

t1 =  'Material was dispatched, Your invoice number is:'.

t2 = invoiceno.

t3 = 'Thanks for your co-operation,'.

t4 = 'Regards,'.

t5 = 'Sales Division'.

concatenate t1 t2 t3 t4 t5 into t6.

write t6.

Output

Material was dispatched, Your invoice number is: 987764 Thanks for your co-operation, Regards, Sales Division

Expected Output

Material was dispatched, Your invoice number is: 987764

Thanks for your co-operation.

Regards,

Sales Division.

Please Help me for my need.

Regards,

Linganathan.K

Moderator Message: Please search for the available material before posting your question.


Message was edited by: Suhas Saha

6 REPLIES 6

hendrik_brandes
Contributor
0 Kudos

Hello,

use the constant CL_ABAP_CHAR_UTILITIES=>CR_LF between your variables:

CONCATENATE

  t1 t2 CL_ABAP_CHAR_UTILITIES=>CR_LF

  t3 CL_ABAP_CHAR_UTILITIES=>CR_LF

  CL_ABAP_CHAR_UTILITIES=>CR_LF

  CL_ABAP_CHAR_UTILITIES=>CR_LF

  t4 CL_ABAP_CHAR_UTILITIES=>CR_LF

  t5

INTO t6.

If you are working on 7.30 you can use the string-patterns which makes those operations much easier.

Kind regards,

Hendrik

0 Kudos

Dear Hendrik brandes,

I tried your code but i am getting output like following.

Material was dispatched, Your invoice number is:987764##Thanks for your co-operation,######Regards,#

0 Kudos

Hi

Where are you checking the result?

Max

0 Kudos

In ABAP editor's output (se38) only i am checking the result.

Regards,

Linganathan.K

0 Kudos

Hi,

within SE38 you cannot see CR_LF. Just export the output via System -> List -> Save and see the result in a normal text-editor.

Kind Regards,

Hendrik

0 Kudos

Dear Hendrik brandes,

Your answer is helpful, i am eager to give points to you, But i cant because my post was closed by moderator.   Anyway thanks for your reply.

Regards,

Linganathan.k