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

positioning cursor on screen with two textedit controls on it

Former Member
0 Likes
701

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
Read only

Former Member
0 Likes
665

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
Read only

Former Member
0 Likes
666

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
665

Hi David, use the SET_FOCUS method.

Regards,

RIch Heilman

Ooops, Naren's got it

Message was edited by:

Rich Heilman

Read only

Former Member
0 Likes
665

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

Read only

0 Likes
665

N/R -

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

Thanks again.

djh