‎2006 Dec 08 1:24 PM
Hello Everybody,
Can someone tell me as to how a Custom Control is handled in module pool programming...............how r they declared n implemented.............can they b handled without the classes n events n methods.......
Thanking u in anticipation.
Regards,
Sirisha Matta.
‎2006 Dec 08 1:28 PM
‎2006 Dec 08 1:28 PM
Hi ,
Could you please tell me why you want a custom control in module pool program .
Reagdrs
Arun
‎2006 Dec 08 1:28 PM
‎2006 Dec 08 1:29 PM
‎2006 Dec 08 1:31 PM
‎2006 Dec 08 1:35 PM
‎2006 Dec 08 3:21 PM
hi sirisha,
This may be helpful for you to put text editor like long text.....
Go to screen layout, in screen painter attribute In Dict tab there ia a drop down box modify .you have to select longtext in that drop down box then save and activate the screen.
Please reward if usefull...
Regards,
SRI.
‎2006 Dec 09 12:56 PM
for text editor use class
CL_GUI_TEXTEDIT
and demo program for this
SAPTEXTEDIT_DEMO_3
Raja
‎2006 Dec 11 6:35 AM
hi sirish,
I have just added a sample code to display a text editor...
CLASS event_handler DEFINITION.
PUBLIC SECTION.
METHODS: handle_f1 FOR EVENT f1 OF cl_gui_textedit
IMPORTING sender,
handle_f4 FOR EVENT f4 OF cl_gui_textedit
IMPORTING sender.
ENDCLASS.
DATA: ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm.
DATA: init,
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit.
DATA: event_tab TYPE cntl_simple_events,
event TYPE cntl_simple_event.
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
DATA handle TYPE REF TO event_handler.
Reporting Events ***************************************************
START-OF-SELECTION.
line = 'First line in TextEditControl'.
APPEND line TO text_tab.
line = '----
'.
APPEND line TO text_tab.
line = '...'.
APPEND line TO text_tab.
CALL SCREEN 100.
Dialog Modules *****************************************************
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
IF init is initial.
init = 'X'.
CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',
editor EXPORTING parent = container,
handle.
event-eventid = cl_gui_textedit=>event_f1.
event-appl_event = ' '. "system event
APPEND event TO event_tab.
event-eventid = cl_gui_textedit=>event_f4.
event-appl_event = 'X'. "application event
APPEND event TO event_tab.
CALL METHOD: editor->set_registered_events
EXPORTING events = event_tab.
SET HANDLER handle->handle_f1
handle->handle_f4 FOR editor.
ENDIF.
CALL METHOD editor->set_text_as_stream EXPORTING text = text_tab.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'INSERT'.
CALL METHOD editor->get_text_as_stream IMPORTING text = text_tab.
WHEN 'F1'.
MESSAGE i888(sabapdocu) WITH text-001.
WHEN OTHERS.
MESSAGE i888(sabapdocu) WITH text-002.
CALL METHOD cl_gui_cfw=>dispatch. "for application events
MESSAGE i888(sabapdocu) WITH text-003.
ENDCASE.
SET SCREEN 100.
ENDMODULE.
Class Implementations **********************************************
CLASS event_handler IMPLEMENTATION.
METHOD handle_f1.
DATA row TYPE i.
MESSAGE i888(sabapdocu) WITH text-004.
CALL METHOD sender->get_selection_pos
IMPORTING from_line = row.
CALL METHOD sender->get_line_text
EXPORTING line_number = row
IMPORTING text = field.
CALL METHOD cl_gui_cfw=>set_new_ok_code "raise PAI for
EXPORTING new_code = 'F1'. "system events
CALL METHOD cl_gui_cfw=>flush.
ENDMETHOD.
METHOD handle_f4.
DATA row TYPE i.
MESSAGE i888(sabapdocu) WITH text-005.
CALL METHOD sender->get_selection_pos
IMPORTING from_line = row.
CALL METHOD sender->get_line_text
EXPORTING line_number = row
IMPORTING text = field.
CALL METHOD cl_gui_cfw=>flush.
ENDMETHOD.
ENDCLASS.
hope u can develop ur editor..
‎2006 Dec 12 8:20 AM
HELLO SRI Y
I COULD NOT SIMULATE WAT U TOLD ME.......COULD U TELL ME MORE CLEARLY??
REGARDS,
SIRISHA MATTA.