Skip to Content
SAP Visual Business

ABAP Development: HowTo handle a drop operation

Tags:

As described in the ABAP Development: HowTo handle frontend eventsdocument,

there are multiple options to receive and handle events from the Visual Business component. In this example we focus only on the default implementation in application class method HANDLE_DRAG_DROP. Despite the differences in how the event handler get invoked and the event data is passed, the actual event handling is equal in all cases.

If a drag-able object is dropped on a suitable drop target the backend receives event IF_VBI_CONST=>GC_CONTROL_EVENT-DROP. This event is per default passed on to method HANDLE_DRAG_DROP. The associated data is passed as import parameters to this specific handler method.
You receive the following information:

  • IV_TARGET_OBJECT_TYPE: type of the target object the source object was dropped on. Object types are defined as constants in interface IF_VBI_CONST attribute structure GC_SCENE_OBJECT_TYPE.
  • IT_DRAG_SOURCE_GUIDS: table of GUIDs of the dragged objects
  • IT_DROP_TARGET_GUIDS: table of GUIDs of the objects the sources get dropped on

The HANDLE_DRAG_DROP method is expected to set changing parameter CV_EVENT_HANDLED to ABAP_TRUE if the drop operation was handled. Otherwise the event will be passed on.

The following code sample shows the simplest handling of a drop event :

...

   message S002(VBI_GUI_TEST) with IV_TARGET_OBJECT_TYPE.

...

No comments