Application Development 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: 

Text Editor not working porperly in Module Pool

Former Member
0 Kudos

In Module Pool Programming,I have created a text editor on a button click using Function Modules Read_text,Create_text and Edit_text.While clicking on the button in the screen,the text editor window is not coming.Please explain me the way to solve.

4 REPLIES 4

Former Member
0 Kudos

Have you checked in the debugger what happens when you press the button?

Rob

Former Member
0 Kudos

hi,

can you use oops concepts please, may be your prob solve.

define this in top include.

DATA : editor TYPE REF TO cl_gui_textedit,

editcontainer TYPE REF TO cl_gui_custom_container,

dockcontainer TYPE REF TO cl_gui_docking_container,

and in on screen, place a custom container, and name it as "CC".

then in user command.

case ok_code.

when "button".

IF editor IS INITIAL.

CREATE OBJECT editcontainer

EXPORTING container_name = 'CC'

repid = program name

dynnr = screen name.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT editor EXPORTING parent = editcontainer

wordwrap_mode =

cl_gui_textedit=>wordwrap_at_fixed_position

wordwrap_position = 65

max_number_chars = 1000.

ENDIF.

          • Text editor methods *****

CALL METHOD editor->set_statusbar_mode

EXPORTING

statusbar_mode = '0'

EXCEPTIONS

error_cntl_call_method = 1

invalid_parameter = 2.

CALL METHOD editor->set_readonly_mode

EXPORTING

readonly_mode = cl_gui_textedit=>false

EXCEPTIONS

error_cntl_call_method = 1

invalid_parameter = 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 editor->set_text_as_r3table

EXPORTING

table = cc[].

CALL METHOD: editor->set_toolbar_mode

EXPORTING

toolbar_mode = 0.

endcase.

please try this. may be it will work.

rahul_mahajan
Active Participant
0 Kudos

Hi,

Please refer below sample code :

***********************************************************

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

  • This method is for handling the button click

handle_button_click

FOR EVENT button_click OF cl_gui_alv_grid

IMPORTING es_col_id es_row_no.

ENDCLASS.

  • This method is for handling the button click

METHOD handle_button_click.

IF es_col_id EQ 'NOTES'. " Notes

PERFORM handle_button_click USING es_col_id es_row_no.

ENDIF.

ENDMETHOD.

FORM handle_button_click USING es_col_id TYPE lvc_s_col

es_row_no TYPE lvc_s_roid.

READ TABLE i_tab INDEX es_row_no-row_id INTO wa_tab.

IF sy-subrc = 0.

CALL FUNCTION 'TERM_CONTROL_EDIT'

EXPORTING

titel = text-075

TABLES

textlines = lt_text

EXCEPTIONS

user_cancelled = 1

OTHERS = 2.

IF sy-subrc EQ 0.

" Your further coding logic

ENDIF.

ENDIF.

ENDFORM.

Write handler while displaying the ALV as follows

  • handle button click

SET HANDLER g_event->handle_button_click FOR o_grid.

********************************************************************

I hope this will help you.

Regards,

Rahul Mahajan

Former Member
0 Kudos

Thanks a lot