2015 Mar 02 12:01 PM
Hi All,
Can we use multiple text editor in a single module pool Screen ,if yes how can we save the data of individual text editor
values using the SAVE_TEXT function module.
Regards,
Shivashankar
2015 Mar 02 12:25 PM
Hi Shivashankar
If you have three text editor objects, then call three times 'SAVE_TEXT' with different text object and id.
regards,
Archer
2015 Mar 02 12:32 PM
Hi Archer,
If i call 3 times save_text how it will take the values of the text editor objects individually,consider if am having a,b,c as text editors,how the data of a,b,c text editor values will be saved separately as we will not pass the text editor names to the function modules.
Regards,
Shivashankar
2015 Mar 02 12:32 PM
Hi Shivashankar,
In your requirement you have to design 3 custom container in your screen,
Again you need to declare 3 object of each class
cl_gui_custom_container,
cl_gui_textedit,
If you want the code I can share it further.
Regards,
Swaroop
2015 Mar 02 12:45 PM
Hi Swaroop,
I have designed the three text editors in a single screen,my question is to how to save the data from each text editor separately in a single save button.
Regards,
Shivashankar
2015 Mar 02 12:46 PM
Declare like this........
DATA: line_length TYPE i VALUE 254,
editor_container1 TYPE REF TO cl_gui_custom_container,
editor_container2 TYPE REF TO cl_gui_custom_container,
editor_container3 TYPE REF TO cl_gui_custom_container,
text_editor1 TYPE REF TO cl_gui_textedit,
text_editor2 TYPE REF TO cl_gui_textedit,
text_editor3 TYPE REF TO cl_gui_textedit,
text1 TYPE string,
text2 TYPE string,
text3 TYPE string.
************** In PBO Write the code ......................
CREATE OBJECT editor_container1
EXPORTING
container_name = 'TEXTEDITOR1'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
CREATE OBJECT text_editor1
EXPORTING
parent = editor_container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
** Call the above code 2 more times for object 2 & 3.....
*********************** IN PAI >>>>...................................
CALL METHOD text_editor1->get_textstream
* EXPORTING
* ONLY_WHEN_MODIFIED = CL_GUI_TEXTEDIT=>TRUE
IMPORTING
text = text1
* IS_MODIFIED =
EXCEPTIONS
error_cntl_call_method = 1
not_supported_by_gui = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
****************** Call the above code 2 more time with obj 2 & 3 and get the value of Text2 & Text3 ...........