Application Development and Automation 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 only

Custom Controls

Former Member
0 Likes
1,110

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.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,027

Check out transaction DWDM. There a lots of example programs which uses custom controls with different frontend controls, like HTML, Picture, trees and grids.

Regards,

Rich Heilman

9 REPLIES 9
Read only

Former Member
0 Likes
1,027

Hi ,

Could you please tell me why you want a custom control in module pool program .

Reagdrs

Arun

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,028

Check out transaction DWDM. There a lots of example programs which uses custom controls with different frontend controls, like HTML, Picture, trees and grids.

Regards,

Rich Heilman

Read only

0 Likes
1,027

And, yes, you must use the appropriate class/methods to implement.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,027

i need to put in a text editor in the screen

Read only

0 Likes
1,027

In the transaction that I mentioned, there is an example of an editor used in the Drag/Drop section, called Tree->Editor.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,027

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.

Read only

0 Likes
1,027

for text editor use class

CL_GUI_TEXTEDIT

and demo program for this

SAPTEXTEDIT_DEMO_3

Raja

Read only

Former Member
0 Likes
1,027

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

Read only

Former Member
0 Likes
1,027

HELLO SRI Y

I COULD NOT SIMULATE WAT U TOLD ME.......COULD U TELL ME MORE CLEARLY??

REGARDS,

SIRISHA MATTA.