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: 

getting contents of textfield

Former Member
0 Kudos

Hi,

On a screen i have a multiline text field. I want to copy the contents of the text field to a variable. how do i it?

i hav created the text field as shown below:

i have created a custom container on the screen and then written the following code in PBO.

CREATE OBJECT g_editor_container

EXPORTING

container_name = 'L_PMD_COMMENTS'

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

  • TextEdit Control

CREATE OBJECT g_editor

EXPORTING

parent = g_editor_container

wordwrap_mode =

  • cl_gui_textedit=>wordwrap_off

cl_gui_textedit=>wordwrap_at_fixed_position

  • cl_gui_textedit=>WORDWRAP_AT_WINDOWBORDER

wordwrap_position = line_length

wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

CALL METHOD g_editor->set_toolbar_mode

EXPORTING

toolbar_mode = cl_gui_textedit=>false.

CALL METHOD g_editor->set_statusbar_mode

EXPORTING

statusbar_mode = cl_gui_textedit=>false.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You can call this method in the PAI to get the text from the Text Editor.

call method g_editor->get_text_as_r3table
importing
table = textlines
exceptions
others = 1.

Regards,

Naimesh Patel

4 REPLIES 4

naimesh_patel
Active Contributor
0 Kudos

You can call this method in the PAI to get the text from the Text Editor.

call method g_editor->get_text_as_r3table
importing
table = textlines
exceptions
others = 1.

Regards,

Naimesh Patel

0 Kudos

hi,

wat will be the datatype of textlines?

0 Kudos

Have a look at Rich's example here:

Jonathan

0 Kudos

You can use this type:

data: textlines type RE_T_TEXTLINE.

Regards,

Naimesh Patel