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

Read Text

Former Member
0 Likes
929

Hello friends,

I have created one custom container in module pool for allowing user to enter messages or text, Its successfully saving the text but now I want to show

The same text in tht container when user open the module pool program in display mode.

Please suggest how to read the text and show it in custom container tool?

Regards,

Sunny.

7 REPLIES 7
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
878

Hi,

Refer:

Hope this helps you.

Regards,

Tarun

Read only

Sm1tje
Active Contributor
0 Likes
878

Well, this kind of depends on how and where you have saved your text. Tarun's suggestion souds ok, but this will only work if you store your text in a Z-table as plain text. But it is also possible to store long text as string or as text in table STXH / STXL like is done is several standard transactions. To retrieve those text you can use FM READ_TEXT.

Read only

Former Member
0 Likes
878

Hello Micky thks for the reply

yes ur correct im saving my text in stxh and stxl tables, and im able to read the text through func module read_text

but how to display tht text in custome container???

pls let me knw...

Read only

Sm1tje
Active Contributor
0 Likes
878

Using READ_TEXT you can retrieve the text, as said. Next convert the text to a text stream (FM CONVERT_ITF_TO_STREAM_TEXT), and use method SET_TEXT_AS_STREAM from CL_GUI_TEXTEDIT.

I haven't got the exact coding at hand, but this is more or less what I can remember from the past.

Read only

Former Member
0 Likes
878

Hi,

Make use of the object cl_gui_textedit and the method set_text_as_r3table.

Do as follows:-

*filling up editor with text from texttable

CALL METHOD y_obj_ltext->set_text_as_r3table

EXPORTING

table = y_i_longtxttbl.

  • SET EDITABILTY DEPENDING UPON EDITABILITY OF THE CELL.

CALL METHOD y_obj_ltext->set_readonly_mode

EXPORTING

readonly_mode = y_v_ltxt_enable.

Regards,

Ankur Parab

Read only

Former Member
Read only

Former Member
0 Likes
878

ANSWERED