08-10-2009 6:51 AM
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.
08-10-2009 6:54 AM
08-10-2009 7:06 AM
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.
08-10-2009 7:53 AM
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...
08-10-2009 8:16 AM
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.
08-10-2009 7:26 AM
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
08-10-2009 7:43 AM
08-11-2009 11:45 AM