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: 

positioning cursor on screen with two textedit controls on it

Former Member
0 Kudos

I have a screen with two textedit controls on it.

The left one is for history ... just display.

The right one is for entry of new text.

When the screen pops, the cursor is positioned in the lefthand textedit control.

How do I position cursor in the righthand textedit control?

Thanks

djh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try this..Call the static method set_focus of the class CL_GUI_TEXTEDIT..and pass the instance..

Ex..

CALL METHOD cl_gui_textedit=>set_focus

EXPORTING

control = my_editor "instance of the class.

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

others = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Hope this helps..

Thanks,

Naren

4 REPLIES 4

Former Member
0 Kudos

Hi,

Try this..Call the static method set_focus of the class CL_GUI_TEXTEDIT..and pass the instance..

Ex..

CALL METHOD cl_gui_textedit=>set_focus

EXPORTING

control = my_editor "instance of the class.

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

others = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Hope this helps..

Thanks,

Naren

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi David, use the SET_FOCUS method.

Regards,

RIch Heilman

Ooops, Naren's got it

Message was edited by:

Rich Heilman

former_member181923
Active Participant
0 Kudos

Hi Rich/Naren -

I gave the 6 and the 10 the way I did because I already knew it was the set_focus method - I didn't know how to pass the control that the underlying method was looking for - that's what Naren's example showed me.

Thanks again to both of you.

You da best.

djh

0 Kudos

N/R -

Just a note to let you know that worked as expected.

Thanks again.

djh