‎2008 Sep 04 10:20 AM
how to create a text editor??
for eg in my pf -status -> menubar -> test ->a text editor should open up where some comments can be written.how to do that???
‎2008 Sep 04 10:24 AM
Try -
REPORT ZEX_MINITEXTEDITOR .
Parameters: P_title(10). " Enter any name for the text editor
Data: Begin of int_text occurs 0,
Text(100),
End of int_text.
CALL FUNCTION 'TERM_CONTROL_EDIT'
EXPORTING
TITEL = P_title
LANGU = 'E'
TABLES
TEXTLINES = int_text
EXCEPTIONS
USER_CANCELLED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Text editor will be generated after executing the program. Enter the data in editor which is captured in int_text table in the program
Regards,
Aparna Gaikwad
‎2008 Sep 04 10:24 AM
Try -
REPORT ZEX_MINITEXTEDITOR .
Parameters: P_title(10). " Enter any name for the text editor
Data: Begin of int_text occurs 0,
Text(100),
End of int_text.
CALL FUNCTION 'TERM_CONTROL_EDIT'
EXPORTING
TITEL = P_title
LANGU = 'E'
TABLES
TEXTLINES = int_text
EXCEPTIONS
USER_CANCELLED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Text editor will be generated after executing the program. Enter the data in editor which is captured in int_text table in the program
Regards,
Aparna Gaikwad
‎2008 Sep 04 10:25 AM
Hi,
Creating the TextEdit control
This is a simple example of how to implement a text edit control.
Steps
Create a report
In the start of selection event add: SET SCREEN '100'.
Create screen 100
Place a custom control on the screen by choosing the custom control icon which can be recognized by the letter 'C', and give it the name MYCONTAINER1.
To be able to exit the program, add a pushbutton with the function code EXIT.
In the elements list enter the name OK_CODE for the element of type OK.
The code
REPORT sapmz_hf_controls1 .
CONSTANTS:
line_length TYPE i VALUE 254.
DATA: ok_code LIKE sy-ucomm.
DATA:
Create reference to the custom container
custom_container TYPE REF TO cl_gui_custom_container,
Create reference to the TextEdit control
editor TYPE REF TO cl_gui_textedit,
repid LIKE sy-repid.
START-OF-SELECTION.
SET SCREEN '100'.
-
MODULE USER_COMMAND_0100 INPUT *
-
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
MODULE status_0100 OUTPUT.
The TextEdit control should only be initialized the first time the
PBO module executes
IF editor IS INITIAL.
repid = sy-repid.
Create obejct for custom container
CREATE OBJECT custom_container
EXPORTING
container_name = 'MYCONTAINER1'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Create obejct for the TextEditor control
CREATE OBJECT editor
EXPORTING
wordwrap_mode =
cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
parent = custom_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
others = 6
.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
http://abaplovers.blogspot.com/2008/03/sap-abap-tutorial-module-pool_17.html
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://www.erpgenie.com/abap/controls/textedit.htm
Regards,
Vivek Gaur
‎2008 Sep 04 10:27 AM
Hello Priya,
If you are aware of OO ABAP Programming, you can use the Class CL_GUI_TEXTEDIT class. You'll find all the relevant Methods / Properties of the Class by using which you can Create a Text Editor.
Hope that was helpful.
Thanks and Regards,
Venkat Phani Prasad Konduri