cancel
Showing results for 
Search instead for 
Did you mean: 

How to add many lines in the Text View in Web Dynpro

Former Member
0 Kudos

Hi friends,

I have one Text Edit in Web Dynpro. I need to show the result of FM READ_TEXT in Text Edit View element, without lose the text format.

Cardinality of my node is 0:n and attribute datatype is string_table. after assigning the values using bind_table method, I am getting only the first row of the read_text returns...

By

deva

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Deva,

Text View is not meant to be bound to string_table. Create a string instead and convert that string table into that string with

<br>

between each row of string table. TextView component will make <br> into new lines. Code will be similar to following.


DATA: ROWS TYPE string_table,
      top type string,
      result type string.

      loop at rows into top.
        concatenate result top into result separated by '<br>'.
      endloop.

Now bind this result string to the text view component. It ll work. Hope it will be helpful for you.

Regards,

Fareez

Former Member
0 Kudos

Hi,

I don't think <br> works in webdynpro, and we can bind string_table attribute to the textview.

suppose you have a node with cardinality 1:1 and under it an attribute with type string_table.

Now the output of the FM READ TEXT is a string table, now using the SET_ATTRIBUTE method

of the context element interface IF_WD_CONTEXT_ELEMENT set the value of the attribute as

the output of string table.you can get the desired output.

Hope this helps.

former_member199125
Active Contributor
0 Kudos

if you want to display in multple lines,

then in above Fareez Ahamed solution,

User cl_abap_char_utilities=>newline.

concatenate result top into result separated by cl_abap_char_utilities=>newline.

Regards

Srinivas

Former Member
0 Kudos

Hi,

can you put up the code you used, So that we can figure it out.