Posted: Tue Dec 20, 2011 10:04 am Post subject: Не срабатывает событие handle_on_drag
Здравствуйте!
Я делаю перетаскивание drag and drop с ALV Tree на ALV grid.
Элемент дерева уже перетаскивается на грид, но почему то событие HANDLE_ON_DRAG не срабатвает
Code:
CLASS CL_TREE_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
* double click item
METHODS HANDLE_DOUBLE_CLICK
FOR EVENT NODE_DOUBLE_CLICK OF cl_gui_alv_tree
IMPORTING node_key sender.
METHODS HANDLE_ON_DRAG
FOR EVENT ON_DRAG OF CL_GUI_ALV_TREE
IMPORTING DRAG_DROP_OBJECT
FIELDNAME
NODE_KEY.
PRIVATE SECTION.
ENDCLASS.
CLASS CL_TREE_EVENT_RECEIVER IMPLEMENTATION.
* handle double_click
METHOD HANDLE_DOUBLE_CLICK.
perform select_flats using node_key.
ENDMETHOD.
* Drag & Drop
METHOD HANDLE_ON_DRAG.
CHECK NOT NODE_KEY IS INITIAL.
perform AddFlat using node_key.
CALL METHOD CL_GUI_CFW=>SET_NEW_OK_CODE EXPORTING NEW_CODE =
FCODE_ENTR.
ENDMETHOD.
ENDCLASS.
В PBO пытаюсь поймать событие
if TREE_EVENT_RECEIVER is initial.
CREATE OBJECT TREE_EVENT_RECEIVER.
DATA: LT_EVENTS TYPE CNTL_SIMPLE_EVENTS,
L_EVENT TYPE CNTL_SIMPLE_EVENT.
* define the events which will be passed to the backend
CLEAR L_EVENT.
L_EVENT-EVENTID = CL_GUI_COLUMN_TREE=>EVENTID_NODE_DOUBLE_CLICK.
APPEND L_EVENT TO LT_EVENTS.
CLEAR L_EVENT.
L_EVENT-EVENTID = CL_GUI_COLUMN_TREE=>EVENTID_EXPAND_NO_CHILDREN.
APPEND L_EVENT TO LT_EVENTS.
CLEAR L_EVENT.
L_EVENT-EVENTID = CL_GUI_COLUMN_TREE=>EVENTID_HEADER_CLICK.
APPEND L_EVENT TO LT_EVENTS.
CLEAR L_EVENT.
* register events
CALL METHOD TREE1->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = LT_EVENTS
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
IF SY-SUBRC <> 0.
MESSAGE X534(0K).
ENDIF.
SET HANDLER TREE_EVENT_RECEIVER->HANDLE_ON_DRAG FOR TREE1.
SET HANDLER TREE_EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR TREE1.
CALL METHOD TREE1->FRONTEND_UPDATE.
endif.
perform AddFlat using node_key не выполняется.
подскажите, пожалуйста, в чем может быть дело? Почему не работает?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.