<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: on_drop does not work in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882978#M1478934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code portions you sent me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think here is what the problem is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_dragdrop_receiver DEFINITION.
  PUBLIC SECTION.
  METHODS:
  NODE_DOUBLE_CLICK for EVENT NODE_DOUBLE_CLICK of
  cl_gui_column_tree
  IMPORTING
    NODE_KEY,
   handle_ON_DRAG for EVENT on_DRAG of CL_GUI_COLUMN_TREE
    IMPORTING
       NODE_KEY ITEM_NAME DRAG_DROP_OBJECT,
   handle_on_drop for EVENT on_drop of cl_gui_column_tree
   IMPORTING
     NODE_KEY DRAG_DROP_OBJECT .
ENDCLASS.



CLASS lcl_dragdrop_receiver IMPLEMENTATION.
  METHOD: HANDLE_ON_DRAG.
    DATA drag_object TYPE REF TO lcl_drag_object.
    CREATE OBJECT drag_object.
    BREAK-POINT.
    IF DRAG_DROP_OBJECT-&amp;gt;FLAVOR = 'Tree_move'."Move action.
      READ TABLE NODETABLE2 WITH KEY NODE_KEY = NODE_KEY
        INTO drag_object-&amp;gt;DATA_NODE.

      LOOP AT ITEMTABLE2  INTO  ITEM2WA  WHERE NODE_KEY = NODE_KEY.
      APPEND ITEM2WA TO DRAG_OBJECT-&amp;gt;DATA_ITM.
      ENDLOOP.
    ENDIF.
  ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The handle_on_drag method creates a local drag_object of type lcl_drag_object This should be used to pass information of the dragged data to the drop target. But this local object is not inserted into the event's parameter drag_drop_object (I think that attribute is named OBJECT?).&lt;/P&gt;&lt;P&gt;So while dropping the system realises that there is no dragged object and the event is not passed to your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gerd Rother&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 May 2010 08:10:57 GMT</pubDate>
    <dc:creator>gerd_rother</dc:creator>
    <dc:date>2010-05-05T08:10:57Z</dc:date>
    <item>
      <title>on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882968#M1478924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All expert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am developing a program with CL_GUI_COLUMN_TREE.For the event on_drag, it works fine .But for the event on_drop, it never work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need the drop works to reorganize the data of the internal table and user interface .I already register the event for the tree.&lt;/P&gt;&lt;P&gt;Also the local class to handle the event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; set handler dragdrop-&amp;gt;handle_on_drag     for g_alv_tree.&lt;/P&gt;&lt;P&gt; set handler dragdrop-&amp;gt;handle_on_drop     for g_alv_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 10:11:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882968#M1478924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-04T10:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882969#M1478925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the drag &amp;amp; drop examples in the workbench's control examples. It is enough to set the event handlers to successfully establish drag &amp;amp; drop, you need also an instance of class CL_DRAGDROP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 10:21:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882969#M1478925</guid>
      <dc:creator>gerd_rother</dc:creator>
      <dc:date>2010-05-04T10:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882970#M1478926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already create a instance.also read the related sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CREATE OBJECT dragdrop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set HANDLER DRAGDROP-&amp;gt;handle_ON_DROP_GET_FLAVOR for g_alv_tree.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   set handler dragdrop-&amp;gt;handle_on_drag     for g_alv_tree.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set handler dragdrop-&amp;gt;handle_ON_DRAG_MULTIPLE     for g_alv_tree.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   set handler dragdrop-&amp;gt;handle_on_drop     for g_alv_tree.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  set handler dragdrop-&amp;gt;handle_ON_DROP_COMPLETE for g_alv_tree.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 10:25:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882970#M1478926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-04T10:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882971#M1478927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you also set the drag &amp;amp; drop handle id  in your tree's items (received by the CL_DRAGDROP-&amp;gt;GET_HANDLE method)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 11:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882971#M1478927</guid>
      <dc:creator>gerd_rother</dc:creator>
      <dc:date>2010-05-04T11:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882972#M1478928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. I did it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The confusion is why it work for event on_drag but not work for ON_DROP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 12:15:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882972#M1478928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-04T12:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882973#M1478929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you also call CL_DRAGDROP-&amp;gt;ADD defining the drag &amp;amp; drop as source and target?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method init_drag_n_drop.  " returning dd_id to be added to tree item definitions

data: dd_obj type ref to cl_dragdrop.

free dd_id.
create object dd_obj.
dd_obj-&amp;gt;add( EXPORTING 
                              flavor = 'MY_FLAVOR'       " normally you use a meaningful constant here
                              dragsrc    = abap_true
                              droptarget = abap_true
                              effect     = cl_dragdrop=&amp;gt;copy ).
dd_obbj-&amp;gt;get_handle( IMPORTING handle = dd_id ).

endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 13:18:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882973#M1478929</guid>
      <dc:creator>gerd_rother</dc:creator>
      <dc:date>2010-05-04T13:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882974#M1478930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. I did it .The problem is it works already for on_drag.But I can not find the reason for why it does not work for on_drop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 13:56:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882974#M1478930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-04T13:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882975#M1478931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show us the declaration of your Event handler class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 14:08:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882975#M1478931</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-05-04T14:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882976#M1478932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;class lcl_dragdrop definiation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-methods :&lt;/P&gt;&lt;P&gt; handle_on_drag for event on_drap of cl_gui_column_tree&lt;/P&gt;&lt;P&gt; importing&lt;/P&gt;&lt;P&gt;node_key  ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;handle_on_drop for event on_drag of cl_gui_column_tree&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;node_key ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class lcl_dragdrop implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method handle_on_drag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method handle_on_drop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 14:21:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882976#M1478932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-04T14:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882977#M1478933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you did all of that it should work. Without the actual coding of setting up all the d&amp;amp;d behavior I cannot tell what is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Gerd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 May 2010 16:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882977#M1478933</guid>
      <dc:creator>gerd_rother</dc:creator>
      <dc:date>2010-05-04T16:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: on_drop does not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882978#M1478934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code portions you sent me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think here is what the problem is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_dragdrop_receiver DEFINITION.
  PUBLIC SECTION.
  METHODS:
  NODE_DOUBLE_CLICK for EVENT NODE_DOUBLE_CLICK of
  cl_gui_column_tree
  IMPORTING
    NODE_KEY,
   handle_ON_DRAG for EVENT on_DRAG of CL_GUI_COLUMN_TREE
    IMPORTING
       NODE_KEY ITEM_NAME DRAG_DROP_OBJECT,
   handle_on_drop for EVENT on_drop of cl_gui_column_tree
   IMPORTING
     NODE_KEY DRAG_DROP_OBJECT .
ENDCLASS.



CLASS lcl_dragdrop_receiver IMPLEMENTATION.
  METHOD: HANDLE_ON_DRAG.
    DATA drag_object TYPE REF TO lcl_drag_object.
    CREATE OBJECT drag_object.
    BREAK-POINT.
    IF DRAG_DROP_OBJECT-&amp;gt;FLAVOR = 'Tree_move'."Move action.
      READ TABLE NODETABLE2 WITH KEY NODE_KEY = NODE_KEY
        INTO drag_object-&amp;gt;DATA_NODE.

      LOOP AT ITEMTABLE2  INTO  ITEM2WA  WHERE NODE_KEY = NODE_KEY.
      APPEND ITEM2WA TO DRAG_OBJECT-&amp;gt;DATA_ITM.
      ENDLOOP.
    ENDIF.
  ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The handle_on_drag method creates a local drag_object of type lcl_drag_object This should be used to pass information of the dragged data to the drop target. But this local object is not inserted into the event's parameter drag_drop_object (I think that attribute is named OBJECT?).&lt;/P&gt;&lt;P&gt;So while dropping the system realises that there is no dragged object and the event is not passed to your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gerd Rother&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 08:10:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/on-drop-does-not-work/m-p/6882978#M1478934</guid>
      <dc:creator>gerd_rother</dc:creator>
      <dc:date>2010-05-05T08:10:57Z</dc:date>
    </item>
  </channel>
</rss>

