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: 

NEW LINE

Former Member
0 Kudos
84

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
57

Hello,

Why not passing it_lines2 to the smartform. Then in the smartform create a flow logic --> loop. Create a text in the loop. Then in this loop, loop at it_lines2 in wa_lines2. Then in the text (that is inside the loop), insert a field which content is &wa_lines2-tdline&.

I am not sure if it will work properly, but you can try.

Regards.

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos
57

I think the STRING variable will not help you much.

You can put one LOOP in the window where you need to print the Text and assign your TEXT table to that LOOP.

Like:

..TEXT WINDOW

....LOOP (IT_TEXT ... FROM READ_TEXT)

...... TEXT ... IT_TEXT-TEXT

Regards,

Naimesh Patel

Former Member
0 Kudos
58

Hello,

Why not passing it_lines2 to the smartform. Then in the smartform create a flow logic --> loop. Create a text in the loop. Then in this loop, loop at it_lines2 in wa_lines2. Then in the text (that is inside the loop), insert a field which content is &wa_lines2-tdline&.

I am not sure if it will work properly, but you can try.

Regards.