‎2008 Mar 11 7:44 AM
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
‎2008 Mar 11 8:36 AM
Hi,
Automaticaly, We can't move cursor one field to another field wihtout pressing key. ABAP is not suport for this.
L.Velu
‎2008 Mar 11 8:36 AM
Hi,
Automaticaly, We can't move cursor one field to another field wihtout pressing key. ABAP is not suport for this.
L.Velu
‎2008 Mar 11 10:48 AM
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
‎2008 Mar 11 11:19 AM
‎2008 Mar 12 7:13 AM
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
.