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: 

how to handle double click event in a text control

Former Member
0 Kudos

Hi,

Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.

Regards,

Praba.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Prabavathi,

I guess you are talking about the TEXT EDIT Control.

What exactly you want regarding the Double Click event?

Regarding the locks, these usually not at a table level, but a object level, meaning something like you lock a PO / Material. If its custom table, then you can create lock objects specific to the table.

You can create lock objects in SE11.

Regards,

Ravi

Note : Please mark the helpful answers

6 REPLIES 6

Former Member
0 Kudos

Prabavathi,

I guess you are talking about the TEXT EDIT Control.

What exactly you want regarding the Double Click event?

Regarding the locks, these usually not at a table level, but a object level, meaning something like you lock a PO / Material. If its custom table, then you can create lock objects specific to the table.

You can create lock objects in SE11.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

Hi Ravi,

Yes,It is text edit control, using double click event i have to bring the text edit control from display to change mode. I have to lock the table before manipulating db table value and then after the opearation unlock the table. Will u please send me the function modules used for it.

Thanks,

Praba

0 Kudos

Prabavathi,

I am not sure how are you planning to store these long texts in a table. These are usually stored in special tables and are processed using SAVE_TEXT, READ_TEXT function modules. So, you need to determine what values you want to give for TEXT OBJECT, TDID, TEXT NAME.

Coming to method, you can call SET_READONLY_MODE method and pass 0 or 1, depending on whether you want it to be editable or ready only. This can be done in the double click event.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

Hi Praba

You can say us which table you have to update and so you want to lock/unlock.

Every table should have an its own lock object (trx SE11).

If you have to update a Z-TABLE you should create the lock object by SE11.

The name of custom lock object should begin with EZ...., after generating it the system'll create the fm to lock and unclock:

ENQUEUE_<name of your object>

DEQUEUE_<name of your object>

mAX

0 Kudos

Hi,

Check this FM <b>TRM_COMMENT_POPUP_EDIT</b>, run it in SE37 and see.

Regards

vijay

Former Member
0 Kudos

Hi Prabhavathi,

Here is how you handle double click events in Textedit control.

1)Create a custom control in screen (say TEXT_CONTROL)

2)In main program,

a) Declarations:

data: obj type ref to cl_gui_custiom_control.

text type ref to cl_gui_textedit.

b) Create the instance of custom container

c) Create the instance of textedit control.

3)Now to handle double click events , create a local class as follows.

class shail_event definition.

public section.

methods:

handle_doubleclick for event dblclick of cl_gui_textedit .

endclass.

class shail_event implementation.

method handle_doubleclick .

  • here do the coding for handling the double click.

endmethod.

endclass.

4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.

5) Define varibles for event.

DATA: i_events TYPE cntl_simple_events,

wa_events TYPE cntl_simple_event.

SET HANDLER hand->handle_doubleclick for text.

wa_events-eventid = cl_gui_textedit=>event_double_click.

wa_events-appl_event = 'X'. "This is an application event

APPEND wa_events TO i_events.

6)

CALL METHOD texte->set_registered_events

EXPORTING

events = i_events

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

illegal_event_combination = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.

If you want the program, kindly send your mail-id so that I can mail it to you.

Regards,

Sylendra.