Application Development and Automation 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: 
Read only

String Concatination

Former Member
0 Likes
782

Hi,

I want to concatenate two strings. But I want those two to print in two seperate lines instead of seperated by space. Is there any way to do it.

Thanks

Veni.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
730

That's a little contradictive, isn't it? Put two things together, but print/write them on two separate lines?

I'm confused. 😮

Regards,

Rich Heilman

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
731

That's a little contradictive, isn't it? Put two things together, but print/write them on two separate lines?

I'm confused. 😮

Regards,

Rich Heilman

Read only

0 Likes
730

Are you trying to do something like this?



report zrich_0001 .

data:

      str1 type string,
      str2 type string,
      str3(1000) type c.

data: out_lines type table of string with header line.

str1 = 'Hi there. How are you?'.
str2 = 'Why am I working today, its my day off.'.

concatenate str1 str2 into str3 separated by space.

call function 'RKD_WORD_WRAP'
  exporting
    textline                  = str3
   outputlen                 = 35
 tables
   out_lines                 = out_lines
 exceptions
   outputlen_too_large       = 1
   others                    = 2.

loop at out_lines.
  write:/ out_lines.
endloop.

Regards,

Rich Heilman

Read only

0 Likes
730

Hi Rich,

I have a table called i_attach.

*Itab to hold data to be sent as email attachment

i_attach TYPE STANDARD TABLE OF solisti1

And I want to add three strings to this table. These 3 strings should print in seperate lines. How should I do it.

Thanks

Veni.

Read only

0 Likes
730

Oh ok. That's easy. Just append them to the table.

i_attach-line = 'Hey, how are you?'.
append i_attach.

i_attach-line = 'Im fine'.
append i_attach.

i_attach-line = 'Not sure why Im working today, though'.
append i_attach.

Regards,

Rich Heilman

Read only

0 Likes
730

Oops, I noticed that you don't have a header line for you table, then try this.

data: wa_attach type SOLISTI1.

wa_attach-line = 'Hey, how are you?'.
append wa_attach to i_attach.

wa_attach-line = 'Im fine'.
append wa_attach to i_attach.

wa_attach-line = 'Not sure why Im working today, though'.
append wa_attach to i_attach.

Regards,

Rich Heilman

Read only

0 Likes
730

Thank you Rich.

Read only

0 Likes
730

Hello Rich,

I think there's somethig wrong:

why use

str3(1000) type c ?

It will be trunc by system at 250 digit (more or less) !!!!

There's a way to use something at 1000 digit ?

tks.