‎2009 Nov 02 12:16 PM
Dear All,
I have created a screen For Data entry which is for shipment Details.
In that i created long text by using custom container.
i Wrote following code.
module PBO output.
if CUSTOM_CONTAINER is initial.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = 'TEDITOR'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
endif.
CREATE OBJECT TEXT_EDITOR
EXPORTING
PARENT = CUSTOM_CONTAINER
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_WINDOWBORDER
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5.
endmodule. " PBO OUTPUT
Now my problem is how to store this text because i want to use this text in another report?
‎2009 Nov 02 3:23 PM
Like this
DATA: r_textedit TYPE REF TO cl_gui_textedit,
r_cont TYPE REF TO cl_gui_custom_container.
DATA: itab TYPE TABLE OF char255.
DATA: eename(10) TYPE c,
prev_eename(10) TYPE c.
CALL SCREEN 100.
MODULE pbo OUTPUT.
IF r_cont IS INITIAL.
CREATE OBJECT r_cont
EXPORTING
container_name = 'CUSTOM_CONTROL'.
CREATE OBJECT r_textedit
EXPORTING
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
parent = r_cont.
ENDIF.
CALL METHOD r_textedit->set_text_as_r3table
EXPORTING
table = itab.
ENDMODULE.
MODULE pai INPUT.
REFRESH itab.
IF prev_eename is not INITIAL and
eename = prev_eename.
CALL METHOD r_textedit->get_text_as_r3table
IMPORTING
table = itab. "here your entered text stored in ITAB
ENDIF.
prev_eename = eename.
ENDMODULE. "pai INPUT
Regards
Marcin
‎2009 Nov 02 5:58 PM
Hi Suhas,
As Marcin rightly said, if you want to use the entered text in the same program, you should call the method get_text_as_r3table.
If your requirement is to save the text, and use it later in another report, then you should use the concept of Text Object.
Its explained simply in the below link:
http://wiki.sdn.sap.com/wiki/display/Snippets/HowtosaveandretreiveTextobjects
You need to call SAVE_TEXT to save the entered text, and READ_TEXT to get back the saved text.
Let us know if your problem is not solved.
Thanks,
Nisha Vengal.
‎2009 Nov 03 6:53 AM
Hi Nisha,
Thanks for your reply.
You understand my problem correctly. I want to save the text first and then i want to use it in another program.
But still I am littile bit confuse. My confusion is whether i have to create text object, text name and text id in STXH table first or there is no need create in STXH.
So can you pls send me steps in detail?
Thanks
‎2009 Nov 04 11:08 AM
Hi Suhas,
Yes, you need to create Z-Text object, using SE75.
Did you go through the link I pasted in my previous reply ?
Below is another link, which has detailed steps with screenshots:
Below one is also good.
http://wiki.sdn.sap.com/wiki/display/ABAP/Long+Texts
Let me know if you face any issues while coding.
Thanks,
Nisha Vengal.
Edited by: Nisha G. Vengal on Nov 4, 2009 12:12 PM