on 06-28-2012 12:50 PM
Hello expert,
I am facing problem in display of the internal table's row data returned from read_text function module on web dynpro view in the text view UI element.
is there any other option than looping the internal table and geting the data into string .
Hi vishal,
Use belo code to get data into string...
Use below code to get text..
->Create text object in SO10
->Do coding like below...
data: lt_tline type table of tline,
ls_tline type tline,
lv_string type string.
1. use 'READ_TEXT' FM to get text from SO10 which give you TLINE format table (lt_tline).
loop at lt_tline into ls_tline.
concatenate lv_string ls_tline-tdline into lv_string.
clear: ls_tline.
endloop.
2. Now lv_string contains full text of SO10.
3. Bind lv_string to textedit UI element text.
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
To preserve newlines from the standard text object in the TextView string you need to loop through the text lines returned by READ_TEXT and pay attention to the TDFORMAT of each line. Try the following.
* -- Read text
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = ls_thead-tdid
language = ls_thead-tdspras
name = ls_thead-tdname
object = ls_thead-tdobject
TABLES
lines = lt_lines
EXCEPTIONS
OTHERS = 0.
* -- Construct the text string
LOOP AT lt_lines ASSIGNING <t> WHERE tdformat <> '/*'. " not a comment
CASE <t>-tdformat.
WHEN '*'. " is a newline
CONCATENATE text_string
<t>-tdline
INTO text_string
SEPARATED BY cl_abap_char_utilities=>cr_lf.
WHEN OTHERS.
CONCATENATE text_string
<t>-tdline
INTO text_string
SEPARATED BY space.
ENDCASE.
ENDLOOP.
Cheers,
Amy
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.