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

CONCATENATE

Former Member
0 Likes
544

Hi,

I am facing one problem while displaying the text in smart form. I am picking the text from transaction header and the same text I am displaying in smart form. For this I am using the function read text. After read_text the internal table is populating with text. My doubt is

Let say the text contains in the below way in transaction

**1 this is the text for sample.

**2 this is text for sample1.

Sometimes it may contains three lines also but every time it should start with **and line number.

For this what I am doing is after the function read_text I am writing the code like this.

Loop at itab.

CONCATENATE gv_str it_lines2-tdline INTO gv_str.

Endloop.

In above I have declared variable gv_str of type string.

Now what is happening is in smart form it is displaying the text in the below way

**1 this is the text for sample **2 this

Is the text for sample1

But I want in the below way

**1 this is the text for sample

**2 this is the text for sample1

How to separate each line while concatenating the text into gv_str.

Please help me I will give points.

Thanks a lot in advance.

Hi,

I am facing one problem while displaying the text in smart form. I am picking the text from transaction header and the same text I am displaying in smart form. For this I am using the function read text. After read_text the internal table is populating with text. My doubt is

Let say the text contains in the below way in transaction

**1 this is the text for sample.

**2 this is text for sample1.

Sometimes it may contains three lines also but every time it should start with **and line number.

For this what I am doing is after the function read_text I am writing the code like this.

Loop at itab.

CONCATENATE gv_str it_lines2-tdline INTO gv_str.

Endloop.

In above I have declared variable gv_str of type string.

Now what is happening is in smart form it is displaying the text in the below way

**1 this is the text for sample **2 this

Is the text for sample1

But I want in the below way

**1 this is the text for sample

**2 this is the text for sample1

How to separate each line while concatenating the text into gv_str.

Please help me I will give points.

Thanks a lot in advance.

3 REPLIES 3
Read only

Former Member
0 Likes
522

Hi,

Have you declared the it_lines2 as tlines?

Regards,

Satish

Read only

former_member199581
Active Participant
0 Likes
522

Try this:

LOOP AT itab.

CONCATENATE gv_str it_lines2-tdline INTO gv_str SEPARATED BY cl_abap_char_utilities=>newline.

ENDLOOP.

Hope this helps,

Roby.

Read only

0 Likes
522

Hi,

Thanks for your reply, but still it is giving the same problem. It Is not separating properly.

Thanks.