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: 

Read Text

Former Member
0 Kudos

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

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer:

Hope this helps you.

Regards,

Tarun

Sm1tje
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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...

Sm1tje
Active Contributor
0 Kudos

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.

former_member555112
Active Contributor
0 Kudos

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

Former Member

Former Member
0 Kudos

ANSWERED