Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

cl_gui_alv_grid drop event does not work

Hi all

I have two alv grids, that looks like:

I want to drag a row from left side to right side and reverse. My problem is, the drop event does not got fired, when I drag an object from left to right. The drag event works fine.

Events methods definition

methods handle_alv_drag

       for event ondrag

       of cl_gui_alv_grid

       importing e_row e_column es_row_no e_dragdropobj.

    methods handle_alv_drop_complete

        for event ondropcomplete

        of cl_gui_alv_grid

        importing e_row e_column e_dragdropobj.

Events registration

set handler me->_grf_event_handler->handle_alv_drop for _grf_alv_grid.
set handler me->_grf_event_handler->handle_alv_drag for _grf_alv_grid.

and dropdrag implementation

me->_grf_dragdrop = new cl_dragdrop( ).

    me->_grf_dragdrop->add(

        exporting

            flavor = 'Line'

            dragsrc = 'X'

            droptarget = 'X'

            effect = cl_dragdrop=>move

    ).

    me->_grf_dragdrop->get_handle(

        importing

            handle = ef_dd

    ).

and alv drag and drop registration

  me->add_drag_drop(

    importing

        ef_dd = data(lf_dd)

  ).

  _grf_alv_grid->set_table_for_first_display(

     exporting

         i_structure_name = 'ZQM_PHRASES'

         it_toolbar_excluding = value ui_functions( ( cl_gui_alv_grid=>mc_fc_excl_all ) )

         is_layout = value lvc_s_layo( col_opt = 'X' s_dragdrop = value lvc_s_dd01( row_ddid = lf_dd cntr_ddid = lf_dd fieldname = space ) )

     changing

         it_outtab       = me->_gt_phrases->*

  ).

What am I doing wrong?

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question