2011 Nov 11 8:54 AM
I tried to set focus on my cl_gui_textedit control programmatically in pbo of my dynpro.
But it doesn't work.
Here's my code.
CALL METHOD editor1->set_readonly_mode
EXPORTING readonly_mode = cl_gui_textedit=>false.
CALL METHOD editor1->set_focus
EXPORTING
control = editor1.
CALL METHOD cl_gui_cfw=>flush.
CALL METHOD editor->SET_SELECTION_POS_IN_LINE
EXPORTING pos = 5
line = 1.I almost tried everything.
It is the editor1 .
CALL METHOD editor1->set_readonly_mode "here you have mentioned editor
EXPORTING readonly_mode = cl_gui_textedit=>false.
CALL METHOD editor1->set_focus "here you have mentioned editor1
EXPORTING
control = editor1.
CALL METHOD cl_gui_cfw=>flush.
CALL METHOD editor1->SET_SELECTION_POS_IN_LINE "here you have mentioned editor EXPORTING pos = 5
line = 1.
2011 Nov 11 9:45 AM
I tried to set focus on my cl_gui_textedit control programmatically in pbo of my dynpro.
But it doesn't work.
CALL METHOD editor1->set_readonly_mode "here you have mentioned editor1
EXPORTING readonly_mode = cl_gui_textedit=>false.
CALL METHOD editor1->set_focus "here you have mentioned editor1
EXPORTING
control = editor1.
CALL METHOD cl_gui_cfw=>flush.
CALL METHOD editor->SET_SELECTION_POS_IN_LINE "here you have mentioned editor
EXPORTING pos = 5
line = 1.
So is it editor or editor1 ?. Hope you understood the problem.
Kesav
2011 Nov 11 9:48 AM
It is the editor1 .
CALL METHOD editor1->set_readonly_mode "here you have mentioned editor
EXPORTING readonly_mode = cl_gui_textedit=>false.
CALL METHOD editor1->set_focus "here you have mentioned editor1
EXPORTING
control = editor1.
CALL METHOD cl_gui_cfw=>flush.
CALL METHOD editor1->SET_SELECTION_POS_IN_LINE "here you have mentioned editor EXPORTING pos = 5
line = 1.
2011 Nov 11 9:51 AM
Hi,
In your previous post you have mentioned editor and editor1 , so i assumed the problem would be because of that. If it was a typo then now whatever you have written is correct and it should work. Here is a piece of code which works for me.
REPORT yvariant_text .
PARAMETERS:pa TYPE c.
DATA: container TYPE REF TO cl_gui_docking_container,
editor TYPE REF TO cl_gui_textedit,
report TYPE syrepid.
DATA:tlines TYPE TABLE OF tdline,
wa_tlines TYPE tdline.
AT SELECTION-SCREEN OUTPUT.
report = sy-repid.
IF container IS INITIAL.
CREATE OBJECT container
EXPORTING repid = report
dynnr = sy-dynnr
side = container->dock_at_left
extension = 1070.
CREATE OBJECT editor
EXPORTING
parent = container.
ENDIF.
wa_tlines = 'This is first line in the edit control'.
APPEND wa_tlines TO tlines.
wa_tlines = 'This is second line in the edit control'.
APPEND wa_tlines TO tlines.
CALL METHOD editor->set_text_as_r3table
EXPORTING
table = tlines
EXCEPTIONS
OTHERS = 1.
CALL METHOD editor->set_focus
EXPORTING
control = editor.
CALL METHOD editor->set_selection_pos_in_line
EXPORTING pos = 5
line = 2.
2011 Nov 11 9:56 AM
I tried your code, but it doesn't work.
Which version of SAP GUI do you use?
We us 7.02.
Maybe it's a bug?
thx
2011 Nov 11 9:58 AM
I use 4.7 & surely its not a bug. Place this code in SE38 sample program and check. You should be missing something in your code
Kesav
2011 Nov 11 10:10 AM
Hey
Yeah actually i tested exactly what you mentioned. But as i said, it doesn't work...
The Cursor will NOT jump into the Textedit.
It is a mistery.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |