REPORT rsdemo_drag_drop_edit_tree .
DATA ok_code TYPE sy-ucomm.
DATA node_itab LIKE node_str OCCURS 0.
DATA node LIKE node_str.
DATA container TYPE REF TO cl_gui_custom_container.
DATA splitter TYPE REF TO cl_gui_easy_splitter_container.
DATA right TYPE REF TO cl_gui_container.
DATA left TYPE REF TO cl_gui_container.
DATA editor TYPE REF TO cl_gui_textedit.
DATA tree TYPE REF TO cl_gui_simple_tree.
DATA behaviour_left TYPE REF TO cl_dragdrop.
DATA behaviour_right TYPE REF TO cl_dragdrop.
DATA handle_tree TYPE i.
*---------------------------------------------------------------------*
* CLASS lcl_treeobject DEFINITION
*---------------------------------------------------------------------*
* Definition of Data Container *
*---------------------------------------------------------------------*
CLASS lcl_drag_object DEFINITION.
PUBLIC SECTION.
DATA text TYPE mtreesnode-text.
ENDCLASS.
*---------------------------------------------------------------------*
* CLASS dragdrop_receiver DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
CLASS lcl_dragdrop_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
flavor_select FOR EVENT on_get_flavor OF cl_gui_textedit
IMPORTING index line pos flavors dragdrop_object,
left_drag FOR EVENT on_drag OF cl_gui_simple_tree
IMPORTING node_key drag_drop_object,
right_drop FOR EVENT ON_DROP OF cl_gui_textedit
IMPORTING index line pos dragdrop_object,
drop_complete FOR EVENT on_drop_complete OF cl_gui_simple_tree
IMPORTING node_key drag_drop_object.
* Drag Drop behaviour of tree control nodes are defined in the node
* structure
PERFORM fill_tree.
CALL METHOD tree->add_nodes
EXPORTING node_table = node_itab
table_structure_name = 'NODE_STR'.
* registration of drag and drop events
DATA dragdrop TYPE REF TO lcl_dragdrop_receiver.
CREATE OBJECT dragdrop.
SET HANDLER dragdrop->flavor_select FOR editor.
SET HANDLER dragdrop->left_drag FOR tree.
SET HANDLER dragdrop->right_drop FOR editor.
set handler dragdrop->drop_complete for tree.
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.