Process documentationD&D Behavior for all Rows/Columns Locate this document in the navigation structure

 

You can use this process if you want to define a standard Drag & Drop behavior for all rows or columns. For example, if attribute dragsource is set in the behavior, you can link all rows or columns to objects that have set attribute droptarget and use the same flavor.

Note Note

It does not make any difference if you define a behavior for all rows or for all columns.

End of the note.

Although you can use this method to define an identical behavior for all rows, you can determine in events OnDrop and OnDropGetFlavor if you want to cancel the Drag & Drop operation. To do this, you use the data object passed and the flavor as a basis. In the data object, you normally store the data of the row dragged.

Process

  1. Define the layout structure of type LVC_S_LAYO.

  2. Define your Drag & Drop behavior and get the associated handle using method get_handle of class cl_dragdrop.

  3. Assign the handle to field s_dragdrop-row_ddid or s_dragdrop-col_ddid of the layout structure.

  4. Pass the layout structure with method set_table_for_first_display.

    Note Note

    You can also subsequently pass the layout structure with the Drag & Drop behavior using method set_frontend_layout.

    End of the note.

Result

Each row or column can be dragged by the user or appears as the target for any Drag & Drop operation.

Caution Caution

If you want to check the Drag & Drop behavior defined on the screen, you must have at least one drag source and one drop target that have the same flavor.

End of the caution.