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

Text Editor on modulepool Screen

Former Member
0 Likes
640

Hi,

my requirement is to have two input fields on the screen where the user can input some text. when the user comes to the end of one field the cursor should automatically to the next input field.

How to do this one.

I thought of placing an text editor on the screen, can anybody give some sample code to place the text editor on the screen and at the desired position in my case it is in the middle of the screen...

Thanks and Regards,

Kiran Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

Hi,

Automaticaly, We can't move cursor one field to another field wihtout pressing key. ABAP is not suport for this.

L.Velu

4 REPLIES 4
Read only

Former Member
0 Likes
581

Hi,

Automaticaly, We can't move cursor one field to another field wihtout pressing key. ABAP is not suport for this.

L.Velu

Read only

Former Member
0 Likes
580

Check your SAPGui settings (Customizing of Local Layout) under Options > Cursor... there is a checkbox "Automatic Tabbing at End of Field" that can control this behaviour.

Jonathan

Read only

Former Member
0 Likes
580

Check jonathan sugestion will work for u r requirement

Thanks

Read only

Former Member
0 Likes
580

To put text editor on moudule pool screen,

1. Add 'custom control' element on Screen : name it as TEXTEDITOR1.

2. Declare the variable in TOP include as

DATA :

g_editor TYPE REF TO cl_gui_textedit, " Text Editor

g_editor_container TYPE REF TO cl_gui_custom_container, "Container For Text Editor

"Variables to Get the Content of the Text Box Editor

DATA: line TYPE solisti1.

DATA : it_editor TYPE STANDARD TABLE OF line.

3. Put following code in PBO as

IF g_editor IS INITIAL.

CREATE OBJECT g_editor_container

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.

ENDIF.

" 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 = 128

wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

ENDIF.

4. Now to Retireve data from Editor in PAI write:

CLEAR it_editor.

"Method to retrieve table from control (Text From Editor in IT_EDITOR)

CALL METHOD g_editor->get_text_as_r3table

" EXPORTING

" ONLY_WHEN_MODIFIED = FALSE

IMPORTING

table = it_editor

" IS_MODIFIED =

EXCEPTIONS

error_dp = 1

error_cntl_call_method = 2

error_dp_create = 3

potential_data_loss = 4

OTHERS = 5

.