‎2007 Sep 03 8:59 AM
Hi All,
I have created a custom editor on the top half of a screen using FM 'RH_EDITOR_SET'.
I need to capture the cursor position on the editor (row and column).
Though below the editor the line no and col no as displayed (like in the ABAP editor), I am not able to capture them inside the program.
The GET cursor function does not work b'cos the screen element for the editor is a container. I also tried some system fields but none returns the value of the row no and column no on the editor on a screen.
Please suggest.
Thanks in advance,
Archana.
‎2007 Sep 03 9:04 AM
Actually I want to insert some code at a selected cursor position in the editor.
But the problem is that I have to choose a position on the editor and then have to click on a puch button to insert code at that position in the editor.
An example of this is like we call FM's from an ABAP program, select a cursor position in the editor and click on 'Pattern' the code gets inserted on that position.
I need a similar functionality.
Please let me know how we can achieve this on a custom editor.
‎2007 Sep 03 10:39 AM
Hello Archana,
Please try calling the function module
"GET_CURSOR"
As mentioned,i have debugged the action of insertion of pattern out of curiosity and found that this function module "GET_CURSOR" is called in OOPs..
The return parameters
FIRST_LINE
CURSOR_LINE -> line
CURSOR_OFFSET -> offset
will be returned...you will be able to insert your code at the location returned
which means -> on the push of the button this FM needs to be called
Please let me know if it worked out
All the best
Regards
Byju
‎2007 Sep 03 1:34 PM
Hi,
Thanks for the effort. I had tried doing that but it works in case you have an object created, but since I used the FM's it doesnt work.
However I have foudn a solution. I created the editor using class cl_gui_textedit and called the method get_selection_pos.
Thanks a lot