|
This sample code shows you the parts that are needed to get the TextEdit control object working on a dialog screen.
PBO if editor1 is initial * create control container create object textedit_custom_container1 exporting container_name = 'TEXTEDITOR1' exceptions cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 lifetime_dynpro_dynpro_link = 5. if sy-subrc ne 0. * add your handling endif. * create calls constructor, which initializes, creats and links * a TextEdit Control create object editor1 exporting parent = textedit_custom_container1 wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position wordwrap_position = line_length wordwrap_to_linebreak_mode = cl_gui_textedit=>true exceptions others = 1. endif. “End of EDITOR1 is initial SELECT * FROM znotes INTO CORRESPONDING FIELDS OF wa_mytable where qmnum = zpcr-qmnum. append wa_mytable to mytable1. ENDSELECT. CALL METHOD editor1->set_selected_text_as_r3table EXPORTING table = mytable1 EXCEPTIONS error_dp = 1 error_dp_create = 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. PAI on SAVE refresh: mytable1. CALL METHOD editor1->get_text_as_r3table IMPORTING table = mytable1 EXCEPTIONS OTHERS = 1. DATA constants: line_length type i value 52. *** Variables data: editor1 type ref to cl_gui_textedit, * reference to custom container: necessary to bind TextEdit Control textedit_custom_container1 type ref to cl_gui_custom_container. * define table type for data exchange types: begin of mytable_line, line(line_length) type c, end of mytable_line. * table to exchange text types: mytable type standard table of mytable_line initial size 0. data: mytable1 type mytable, wa_mytable type mytable_line.
Related Items:
|