cancel
Showing results for 
Search instead for 
Did you mean: 

Drag and drop ALV Row

Former Member
0 Kudos

HI All,

My requirement is that " user should be able to drag and drop one row position to another row position( example: if the user select row 2 and drag and drop it to row5 then the row 2 should move to the row 5 ).

Can anybody knows how to achieve this functionality in WD application

Thanks & Regards,

Ruchi Tiwari

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

not resolved

Former Member
0 Kudos

I m also looking for samples how to drag and drop within alv in webdynpro abap.

Former Member
0 Kudos

hi,

yes .. just set the contents of the ALV table row at index5 with contents at index2 .

regards,

amit

Former Member
0 Kudos

Hi Amit ,

Yes but how to dynamically identify the drop position of it .......because i need drag drop functionality in ALV

Thanks ,

Ruchi

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In NetWeaver 7.01, you can do create this functionality with the standard table UI element. The table become both the onDrop target and the drag source. In the onDrop event you just change the position of the context element. If you need some code samples, I can post them.

However this doesn't work on 7.01 for the ALV. The necessary drag and drop events of the underlying table aren't exposed yet. These events and the drag and drop functionality will be added to the ALV in NetWeaver 7.02.

Former Member
0 Kudos

Hi Thomas,

please provide the samples it will be really helpfull.

Thanks & Regards,

Ruchi Tiwari

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

First add both the dragsourceinfo and droptarget info to the table UI element make sure their tags are compatible. Implement the onDrop event of the table. In the onDrop you can place the following code (adjusting for your context names):

data lo_nd_ds_field_catalog type ref to if_wd_context_node.
  lo_nd_ds_field_catalog = wd_context->get_child_node( name = wd_this->wdctx_ds_field_catalog ).
  data temp type i.
  temp = row_element->get_index( ).
  lo_nd_ds_field_catalog->move_element(
    exporting
      from = lo_nd_ds_field_catalog->get_element( )->get_index( )
      to   = row_element->get_index( ) ).

Former Member
0 Kudos

Thanks Thomas ,

Can u please elaborate it a bit more "First add both the dragsourceinfo and droptarget info to the table UI element make sure their tags are compatible"

Thanks ,

Ruchi Tiwari

Former Member
0 Kudos

hi ,

refer Thomas quote in the thread :

on NetWeaver 7.0 Enhancement Package 1. On this release we have a DragSourceInfo UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/e0a9f17e483c84e10000000a42189c/frameset.htm

and a DropTargetInfo UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/e0aa477e483c84e10000000a42189c/frameset.htm

We also have the DropTarget UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e4/a9f9a9b52742d3b0c43b6c671b8f60/frameset.htm

and an onDrop event built into several of the standard UI elements. These new events and new UI elements make Drag and Drop possible. For an overview on Drag and Drop in WDA, read this link:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a5/bf47414eca430794189fbb5919cc2f/frameset.htm

refer the standard WD component WDR_TEST_DRAG_AND_DROP .

regards,

amit

Edited by: amit saini on Jan 15, 2010 5:13 AM

Former Member
0 Kudos

Hi Amit & Thomas,

I am using ECC 6.0 with enhancement package 4 ......but i am not able to see these drag and drop controls in the layout of view.....also when i tried finding class CL_WD_DRAG_SOURCE_INFO it also does not exist ........is it a problem of some missing patch or something else?. Can i be able to drag drop row in a table with this version.

Looking for ur valuble inputs.

Thanks & Regards,

Ruchi Tiwari

Edited by: Ruchi Tiwari on Jan 15, 2010 11:37 AM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you are actually on ECC 6 EnhP4 (which runs on top of NetWeaver 7.01) then you should have drag and drop. There is only one UI element in the layout toolset related to drag and drop and that is the drop target UI element. You don't need that however for the table row drag and drop. Everything is done in the standard table UI element. You should have a standard event onDrop in the table UI element. You also should be about to right mouse click on the table UI element in the UI element hierachy tree and choose Insert Drag Source and Insert Drop Target. Input the same value in the tags property of the DragSourceInfo and the DropTargetInfo.

If you don't have the onDrop event or the option to insert the Drag Source/Drop Target - then I have to questoin if your system really is ECC 6 EnhP4.

Former Member
0 Kudos

Hi Thomas ,

Thanks for the clarification i had confirmed from my basis team it is ECC 6 with EhP 3. So is there any way out or i can not apply the desired functionality in this version.

Thanks ,

Ruchi

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Sorry, but there is no drag and drop functionality in Web Dynpro before NetWeaver 7.0 Enhancement Package 1. In order to have that functionality on your ERP system you would need to be at ERP 6.0 Enhancement Package 4.