Drag & Drop Tree --> ALV

Die Objektorientierung mit ABAP®: Vererbung, Dynamische Programmierung, GUI Controls (u.a. ALV im OO).
8 Beiträge • Seite 1 von 1
8 Beiträge Seite 1 von 1

Drag & Drop Tree --> ALV

Beitrag von the-FoX (ForumUser / 87 / 0 / 0 ) »
Hallo,

ich habe mir einen Tree erstellt und ein ALV-GRID. Nun möchte ich ähnlich dem Programm: BCALV_GRID_DND_TREE etwas vom Tree in eine Spalte des ALV ziehen.
Ich habe die Events soweit registriert und ein Receiver-Objekt für den Tree und einen für das ALV angelegt.
Das für das ALV beinhaltet eine Methode für das Ereignis ONDROP.
Aber es wird nie in diese Methode gesprungen.
Die OnDRAG des Trees funktioniert jedoch einwandfrei.

Ich habe es so verstanden, dass erst die OnDrag Methode aufgerufen wird, dann die OnDrop und abschließend die OnDropComplete.
Gibt es da außnahmen ? Ist bestimmt nur ein kleiner Denkfehler von mir :(

Code-Ausschnitte:

Code: Alles auswählen.

*__________________________________________
*
*  Klasse Event-Receiver
*__________________________________________

CLASS CL_EVENT_RECEIVER DEFINITION.

  PUBLIC SECTION.
    DATA: UCOMM TYPE SY-UCOMM.
    DATA: SELFIELD TYPE SLIS_SELFIELD.

    METHODS:
     HANDLE_ONDROP
      FOR EVENT ONDROP OF CL_GUI_ALV_GRID
      IMPORTING E_ROW
                E_COLUMN
                E_DRAGDROPOBJ,

     HANDLE_DROPCOMPL
      FOR EVENT ONDROPCOMPLETE OF CL_GUI_ALV_GRID
       IMPORTING E_ROW
                E_COLUMN
                E_DRAGDROPOBJ,
     HANDLE_FLAV
      FOR EVENT ONDROPGETFLAVOR OF CL_GUI_ALV_GRID
       IMPORTING E_ROW
                E_COLUMN
                E_DRAGDROPOBJ
                E_FLAVORS.

  PRIVATE SECTION.
ENDCLASS.


* Implementation

CLASS CL_EVENT_RECEIVER IMPLEMENTATION.
* Drag & Drop
  METHOD HANDLE_ONDROP.
*
  ENDMETHOD.

  METHOD HANDLE_DROPCOMPL.
*
  ENDMETHOD.

 METHOD HANDLE_FLAV.
*
  ENDMETHOD.

ENDCLASS.


....

    GS_LAYOUT_ALV-S_DRAGDROP-ROW_DDID = G_HANDLE_ALV.
*   handler for ALV grid
    SET HANDLER EVENT_RECEIVER->HANDLE_ONDROP FOR GRID.
    SET HANDLER EVENT_RECEIVER->HANDLE_DROPCOMPL FOR GRID.
    SET HANDLER EVENT_RECEIVER->HANDLE_FLAV FOR GRID.

*   first call with dummy entry
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
                   IS_LAYOUT        = GS_LAYOUT_ALV
         CHANGING  "IT_SORT          = GT_SORT_GRID[]
                   IT_OUTTAB        = GT_SFLIGHT[]
                   it_fieldcatalog  = fieldcat[].

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Beitrag von popeiko (ForumUser / 47 / 0 / 1 ) »
Bräuchte mehr Infos.
Kann an Hand des Code-Ausschnittes keinen großen Fehler feststellen. Das Ereignis ondropcomplete gehört aber so weit ich weiß zum Tree (allgemein zum sendenden Control) und nicht zum Grid (s. BCALV_DND_01).
Wie sehen denn deine behaviour-Objekte aus? Und wie sieht die Methode für onDrag aus? Und welchen Knoten weist du den behaviour-Handle zu und wie? Wie sieht dein Datenobjekt für das DRAGnDROP aus ... :?:

Gruß, Heiko.

Beitrag von the-FoX (ForumUser / 87 / 0 / 0 ) »
Moin moin!

Anbei nochmal der gesamte Code ;-)

Code: Alles auswählen.

INCLUDE <ICON>.

*----------------------------------------------------------------------*
*   INCLUDE BCALV_DND_TOP2                                             *
*----------------------------------------------------------------------*
* definition of tables, types, data and constants
* tables
TABLES: SCARR, SFLIGHT, SPFLI, SAPLANE.
TYPE-POOLS: SLIS.

* internal tables
DATA: GT_SCARR        TYPE TABLE OF SCARR WITH HEADER LINE,
      begin of wa_tab,
        cat1(20),
        cat2(20),
        cont(40),
      end of wa_tab,
      GT_SPFLI        like TABLE OF wa_tab WITH HEADER LINE,
      begin of wa_grid,
        name1(20),
        name2(20),
        name3(20),
      end of wa_grid,
      GT_SFLIGHT      like TABLE OF wa_grid WITH HEADER LINE,
      GT_SAPLANE      TYPE TABLE OF SAPLANE WITH HEADER LINE,
      GT_HEADER       TYPE TABLE OF SLIS_LISTHEADER WITH HEADER LINE,
      GT_FIELDCAT_LVC TYPE LVC_T_FCAT WITH HEADER LINE,
      GT_SORT         TYPE LVC_T_SORT, "Sortiertabelle
      GT_SORT_GRID    TYPE LVC_T_SORT WITH HEADER LINE,
      GT_ROW_TABLE     TYPE LVC_T_ROW WITH HEADER LINE.  " selected rows

* global fields
DATA: CONTROLS_CREATED,
      FLG_NEW,
      GS_LAYOUT_ALV  TYPE LVC_S_LAYO,
      GS_LAYOUT_TREE TYPE LVC_S_LAYO,
      GS_TOOLBAR  TYPE STB_BUTTON,


      G_DROPEFFECT TYPE I,
      G_REPID      LIKE SY-REPID,
      OK_CODE      LIKE SY-UCOMM,
      SAVE_OK_CODE LIKE SY-UCOMM,
      SELECTED     VALUE 'X',
      TREE1  TYPE REF TO CL_GUI_SIMPLE_TREE.
* constants
CONSTANTS: FCODE_BACK   LIKE SY-UCOMM VALUE 'BACK',
           FCODE_DISP   LIKE SY-UCOMM VALUE 'DISP',
           FCODE_END    LIKE SY-UCOMM VALUE 'END',
           FCODE_ENTR   LIKE SY-UCOMM VALUE 'ENTR',
           FCODE_ESC    LIKE SY-UCOMM VALUE 'ESC',
           FCODE_PLANE  LIKE SY-UCOMM VALUE 'FLIGHT'.




TYPES: NODE_TABLE_TYPE LIKE STANDARD TABLE OF MTREESNODE
           WITH DEFAULT KEY.


DATA: NODE_TABLE TYPE NODE_TABLE_TYPE,
      NODE LIKE MTREESNODE.


DATA: " Drag&Drop Objekte
      DRAGDROP_TREE TYPE REF TO CL_DRAGDROP,
      DRAGDROP_ALV TYPE REF TO CL_DRAGDROP,

      " Handles
      G_HANDLE_TREE TYPE I,
      G_HANDLE_ALV  TYPE I,

      " Custom Container für ALV-Grid
      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

      " Das ALV-GRID
      GRID TYPE REF TO CL_GUI_ALV_GRID,

      " Docking-Container (links)
      G_CONTAINER_OBJECT TYPE REF TO CL_GUI_DOCKING_CONTAINER.

*__________________________________________
*
*  Klasse Event-Receiver
*__________________________________________

CLASS CL_EVENT_RECEIVER DEFINITION.

  PUBLIC SECTION.
    DATA: UCOMM TYPE SY-UCOMM.
    DATA: SELFIELD TYPE SLIS_SELFIELD.

    METHODS:
     HANDLE_ONDROP
      FOR EVENT ONDROP OF CL_GUI_ALV_GRID
      IMPORTING E_ROW
                E_COLUMN
                E_DRAGDROPOBJ,

     HANDLE_DROPCOMPL
      FOR EVENT ONDROPCOMPLETE OF CL_GUI_ALV_GRID
       IMPORTING E_ROW
                E_COLUMN
                E_DRAGDROPOBJ,
     HANDLE_FLAV
      FOR EVENT ONDROPGETFLAVOR OF CL_GUI_ALV_GRID
       IMPORTING E_ROW
                E_COLUMN
                E_DRAGDROPOBJ
                E_FLAVORS.

  PRIVATE SECTION.
ENDCLASS.


* Implementation

CLASS CL_EVENT_RECEIVER IMPLEMENTATION.
* Drag & Drop
  METHOD HANDLE_ONDROP.
*    
  ENDMETHOD.

  METHOD HANDLE_DROPCOMPL.
*
  ENDMETHOD.

 METHOD HANDLE_FLAV.
*
  ENDMETHOD.

ENDCLASS.



DATA: EVENT_RECEIVER TYPE REF TO CL_EVENT_RECEIVER.


*_________________________________________
*
*  Klasse Event-Receiver für Trees
*_________________________________________

CLASS CL_TREE_EVENT_RECEIVER DEFINITION.

  PUBLIC SECTION.
*   Drag
    METHODS: HANDLE_ON_DRAG
      FOR EVENT ON_DRAG OF cl_gui_simple_tree
      IMPORTING DRAG_DROP_OBJECT
                node_key.


  PRIVATE SECTION.
ENDCLASS.

* Implementation

CLASS CL_TREE_EVENT_RECEIVER IMPLEMENTATION.
* Drag & Drop
  METHOD HANDLE_ON_DRAG.
    PERFORM DISPLAY_FLIGHTS USING node_key.
    "CALL METHOD CL_GUI_CFW=>SET_NEW_OK_CODE EXPORTING NEW_CODE =
    "FCODE_ENTR.
  ENDMETHOD.

ENDCLASS.


DATA: TREE_EVENT_RECEIVER TYPE REF TO CL_TREE_EVENT_RECEIVER.

DATA: fieldcat_3020  type lvc_t_fcat,     " Fieldcatalog
        wa_3020  like line of  fieldcat_3020.




MODULE STATUS_1000 OUTPUT.

  IF CONTROLS_CREATED IS INITIAL.
    " Iniitialisieren der Drag&Drop Objekte
    PERFORM INIT_DRAGDROP.
    " Anlegen des Dockingcontrols
    PERFORM CREATEDOCKINGCONTROL.
    PERFORM CREATETREECONTROL.
    CONTROLS_CREATED = SELECTED.
  ENDIF.

  " ALV-Grid anlegen
  IF G_CUSTOM_CONTAINER IS INITIAL.
    " Custom Container anlegen für das ALV-GRID
    CREATE OBJECT G_CUSTOM_CONTAINER
       EXPORTING
         CONTAINER_NAME = 'CUSTOM_CONTROL'.
  ENDIF.


  IF GRID IS INITIAL.

    " Status-Icon hinzufügen
    wa_3020-fieldname = 'NAME1'.
    wa_3020-coltext = 'Tag 1'.
    wa_3020-col_pos = 0.
    wa_3020-outputlen = 15.
    wa_3020-checkbox = SPACE.
    wa_3020-ICON = 'X'.
    APPEND wa_3020 to fieldcat_3020.

    wa_3020-fieldname = 'NAME2'.
    wa_3020-coltext = 'Tag 2'.
    APPEND wa_3020 to fieldcat_3020.

    wa_3020-fieldname = 'NAME3'.
    wa_3020-coltext = 'Tag 3'.
    APPEND wa_3020 to fieldcat_3020.



*   create Event Receiver
    CREATE OBJECT EVENT_RECEIVER.

*   create ALV grid
    CREATE OBJECT GRID
       EXPORTING
         I_APPL_EVENTS = SELECTED      "application event
         I_PARENT = G_CUSTOM_CONTAINER.
*   Dummy entry for D'n'D
    CLEAR GT_SFLIGHT.
    APPEND GT_SFLIGHT.
*   handle for D'n'D
    GS_LAYOUT_ALV-S_DRAGDROP-ROW_DDID = G_HANDLE_ALV.
*   handler for ALV grid
    SET HANDLER EVENT_RECEIVER->HANDLE_ONDROP FOR GRID.
"    SET HANDLER EVENT_RECEIVER->HANDLE_DROPCOMPL FOR GRID.
    SET HANDLER EVENT_RECEIVER->HANDLE_FLAV FOR GRID.

*   first call with dummy entry
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
                   IS_LAYOUT        = GS_LAYOUT_ALV
         CHANGING  "IT_SORT          = GT_SORT_GRID[]
                   IT_OUTTAB        = GT_SFLIGHT[]
                   it_fieldcatalog  = fieldcat_3020[].
*   flush
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = GRID.
    CALL METHOD CL_GUI_CFW=>FLUSH.
  ENDIF.
  IF FLG_NEW = SELECTED.
    CLEAR FLG_NEW.
*   first call with data
    GS_LAYOUT_ALV-GRID_TITLE = SCARR-CARRNAME.
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
                   IS_LAYOUT        = GS_LAYOUT_ALV
         CHANGING  " IT_SORT          = GT_SORT_GRID[]
                   IT_OUTTAB        = GT_SFLIGHT[]
                   it_fieldcatalog  = fieldcat_3020[].
*   reset fields on screen 100
    CLEAR SAPLANE.
*   flush
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = GRID.
    CALL METHOD CL_GUI_CFW=>FLUSH.
  ENDIF.



ENDMODULE.



*----------------------------------------------------------------------*
*   INCLUDE GRID_DND_TREE_SIMPLE_F01                                   *
*----------------------------------------------------------------------*

*&---------------------------------------------------------------------*
*&      Form  CREATEDOCKINGCONTROL
*&---------------------------------------------------------------------*
FORM CREATEDOCKINGCONTROL.
  " Docking-Container anlegen
  CREATE OBJECT G_CONTAINER_OBJECT
      EXPORTING SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_LEFT
                EXTENSION = 320
                REPID     = G_REPID
                DYNNR     = '1000'.
ENDFORM.                               " CREATEDOCKINGCONTROL

*&---------------------------------------------------------------------*
*&      Form  CREATETREECONTROL
*&---------------------------------------------------------------------*
FORM CREATETREECONTROL.

  " Event-Receiver anlegen
  CREATE OBJECT TREE_EVENT_RECEIVER.

  " Tree anlegen in G_CONTAINER_OBJECT
  CREATE OBJECT TREE1
    EXPORTING
        PARENT              = G_CONTAINER_OBJECT
        node_selection_mode = cl_gui_simple_tree=>node_sel_mode_single.

   " Nodes anlegen
  " Node with key 'ROOT1'
  NODE-NODE_KEY = 'ROOT1'.   "#EC NOTEXT
                            " Key of the node (max.12 Zeichen)
  CLEAR NODE-RELATKEY.      " Special case: A root node has no parent
  CLEAR NODE-RELATSHIP.     " node.

  NODE-HIDDEN = ' '.        " The node is visible,
  NODE-DISABLED = ' '.      " selectable,
  NODE-ISFOLDER = 'X'.      " a folder.
  CLEAR NODE-N_IMAGE.       " Folder-/ Leaf-Symbol in state "closed":
                            " use default.
  CLEAR NODE-EXP_IMAGE.     " Folder-/ Leaf-Symbol in state "open":
                            " use default
  CLEAR NODE-EXPANDER.      " see below.
  NODE-TEXT = 'Root1'.
  APPEND NODE TO NODE_TABLE.

  " Node with key 'ROOT2'
  NODE-NODE_KEY = 'ROOT2'.   "#EC NOTEXT
                            " Key of the node (max.12 Zeichen)
  CLEAR NODE-RELATKEY.      " Special case: A root node has no parent
  CLEAR NODE-RELATSHIP.     " node.

  NODE-HIDDEN = ' '.        " The node is visible,
  NODE-DISABLED = ' '.      " selectable,
  NODE-ISFOLDER = 'X'.      " a folder.
  CLEAR NODE-N_IMAGE.       " Folder-/ Leaf-Symbol in state "closed":
                            " use default.
  CLEAR NODE-EXP_IMAGE.     " Folder-/ Leaf-Symbol in state "open":
                            " use default
  CLEAR NODE-EXPANDER.      " see below.
  NODE-TEXT = 'Root2'.
  APPEND NODE TO NODE_TABLE.


 " Nodes anlegen
  " Node with key 'CHILD1'
  NODE-NODE_KEY = 'CHILD1'.   "#EC NOTEXT
                            " Key of the node (max.12 Zeichen)
  " Node is inserted as child of the node with key 'Resources'.
  NODE-RELATKEY = 'ROOT1'.
  NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.

  NODE-HIDDEN = ' '.        " The node is visible,
  NODE-DISABLED = ' '.      " selectable,

  NODE-ISFOLDER = 'X'.      " a folder.
  CLEAR NODE-N_IMAGE.       " Folder-/ Leaf-Symbol in state "closed":
                            " use default.
  CLEAR NODE-EXP_IMAGE.     " Folder-/ Leaf-Symbol in state "open":
                            " use default
  CLEAR NODE-EXPANDER.      " see below.
  NODE-TEXT = 'Child1'.
  APPEND NODE TO NODE_TABLE.



  NODE-NODE_KEY = 'CHILD2'. "#EC NOTEXT
                            " Key of the node
  " Node is inserted as child of the node with key 'Root'.
  NODE-RELATKEY = 'CHILD1'.
  NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.

  NODE-HIDDEN = ' '.
  NODE-DISABLED = ' '.
  NODE-ISFOLDER = 'X'.
  NODE-N_IMAGE = ICON_TRANSPORT.
  NODE-EXP_IMAGE = ICON_TRANSPORT.
  NODE-DRAGDROPID = g_handle_tree.
  NODE-EXPANDER = ' '. " The node is marked with a '+', although
                       " it has no children. When the user clicks on the
                       " + to open the node, the event
                       " expand_no_children is fired. The programmer can
                       " add the children of the
                       " node within the event handler of the
                       " expand_no_children event
                       " (see method handle_expand_no_children
                       " of class lcl_application)

  NODE-TEXT = 'Child2'.
  APPEND NODE TO NODE_TABLE.


  NODE-NODE_KEY = 'CHILD3'. "#EC NOTEXT
                            " Key of the node
  " Node is inserted as child of the node with key 'Root'.
  NODE-RELATKEY = 'CHILD1'.
  NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.

  NODE-HIDDEN = ' '.
  NODE-DISABLED = ' '.
  NODE-ISFOLDER = 'X'.
  NODE-N_IMAGE = ICON_TRANSPORT.
    NODE-DRAGDROPID = g_handle_tree.
  NODE-EXP_IMAGE = ICON_TRANSPORT.
  NODE-EXPANDER = ' '. " The node is marked with a '+', although
                       " it has no children. When the user clicks on the
                       " + to open the node, the event
                       " expand_no_children is fired. The programmer can
                       " add the children of the
                       " node within the event handler of the
                       " expand_no_children event
                       " (see method handle_expand_no_children
                       " of class lcl_application)

  NODE-TEXT = 'Child3'.
  APPEND NODE TO NODE_TABLE.


  CALL METHOD tree1->add_nodes
     EXPORTING
       table_structure_name = 'MTREESNODE'
       node_table = node_table.

* handle for D'n'D
  GS_LAYOUT_TREE-S_DRAGDROP-ROW_DDID = G_HANDLE_TREE.

* set handler for tree1
  SET HANDLER TREE_EVENT_RECEIVER->HANDLE_ON_DRAG FOR TREE1.
ENDFORM.                               " CREATETREECONTROL

*&---------------------------------------------------------------------*
*&      Form  DISPLAY_FLIGHTS
*&---------------------------------------------------------------------*
FORM DISPLAY_FLIGHTS USING P_NODE_KEY LIKE NODE-NODE_KEY .
  " Drag-Objekt auslesen ...
  READ TABLE NODE_TABLE INTO node WITH KEY node_key = p_node_key.

  LOOP AT GT_SFLIGHT.
    GT_SFLIGHT-NAME1 = node-text.
    modify GT_SFLIGHT.
  ENDLOOP.

  call method grid->Refresh_table_display.
ENDFORM.                               " DISPLAY_FLIGHTS



*&---------------------------------------------------------------------*
*&      Form  init_dragdrop
*&---------------------------------------------------------------------*
FORM INIT_DRAGDROP.
  G_DROPEFFECT = CL_DRAGDROP=>COPY.
  " Drag&Drop Objekt für Tree anlegen
  CREATE OBJECT DRAGDROP_TREE.
  CALL METHOD DRAGDROP_TREE->ADD EXPORTING
                                 FLAVOR = 'LINE'
                                 DRAGSRC = SELECTED
                                 DROPTARGET = ''
                                 EFFECT = G_DROPEFFECT.
  " Handle merken
  CALL METHOD DRAGDROP_TREE->GET_HANDLE IMPORTING
                                          HANDLE = G_HANDLE_TREE.

  " Drag&Drop Objekt für ALV anlegen
  CREATE OBJECT DRAGDROP_ALV.
  CALL METHOD DRAGDROP_ALV->ADD EXPORTING
                            FLAVOR = 'LINE'
                            DRAGSRC = ''
                            DROPTARGET = SELECTED
                            EFFECT = G_DROPEFFECT.
  " Handle merken
  CALL METHOD DRAGDROP_ALV->GET_HANDLE IMPORTING
                                          HANDLE = G_HANDLE_ALV.
ENDFORM.                               " init_dragdrop

Beitrag von popeiko (ForumUser / 47 / 0 / 1 ) »
Der Fehler liegt darin, dass du auf jeden Fall ein Objekt definieren (und ggf. befüllen) musst, dass per Drag and Drop übertragen wird.

In der Methode 'handle_on_drag' des Trees musst du das Objekt (bei mir ein Objekt der Klasse lcl_dragdrop_data) befüllen (z. B. mit dem Text des entsprechenden Knotens) und die Referenzvariable (lx_dragdrop_object) dem EXPORTING-Parameter 'drag_drop_object' im Attribut 'object' mitgeben.

In der Methode 'handle_ondrop' nimmst du dieses Datenobjekt wieder in Empfang und weist es wieder einer Referenzvariablen zu (per widening cast (?=) weil unsere Klasse spezieller ist als die Klasse des Attributs 'e_dragdropobj->object'. Cast Error abfangen!).

Nun kannst du mit den Daten etwas anstellen. Dabei habe ich den relevanten Teil von display_flights auf die Sende- und Empfangsmethode verteilt. So wird also die komplette 1. Spalte des Grids mit dem Knotennamen gefüllt.

Code: Alles auswählen.

...
* unser DnD-Datenobjekt
CLASS lcl_dragdrop_data DEFINITION.
  PUBLIC SECTION.
    DATA:
      daten(50).
ENDCLASS.
...


...
* Sendemethode des Trees
  METHOD handle_on_drag.

    DATA: lx_dragdrop_data TYPE REF TO lcl_dragdrop_data.

*   Daten des TreeKnotens lesen...
    READ TABLE node_table INTO node WITH KEY node_key = node_key.

*   und DragNDrop-Objekt mit Infos füllen
    CREATE OBJECT lx_dragdrop_data.
    lx_dragdrop_data->daten = node-text.

*   handle speichern
    drag_drop_object->object = lx_dragdrop_data.

  ENDMETHOD.
...


...
* Empfangsmethode des Grids
  METHOD handle_ondrop.

    DATA:
      lx_dragdrop_data TYPE REF TO lcl_dragdrop_data.

    FIELD-SYMBOLS:
      <ls_sflight> LIKE LINE OF gt_sflight.

*   Objekt in Referenzvariable umfüllen (widening cast)
    CATCH SYSTEM-EXCEPTIONS move_cast_error = 1.
      lx_dragdrop_data ?= e_dragdropobj->object.
    ENDCATCH.

*   sauberer Abbruch, wenn Objekte nicht kompatibel sind
    IF sy-subrc <> 0.
      CALL METHOD e_dragdropobj->abort.

    ELSE.

*     komplette 1. Spalte mit Daten füllen?
      LOOP AT gt_sflight ASSIGNING <ls_sflight>.
        <ls_sflight>-name1 = lx_dragdrop_data->daten.
      ENDLOOP.

      CALL METHOD grid->refresh_table_display.

    ENDIF.

  ENDMETHOD.
...

Viele Grüße, Heiko.

Beitrag von Gast ( / / 0 / 3 ) »
Danke!Das hat mir sehr geholfen

the-FoX

Beitrag von the-FoX (ForumUser / 87 / 0 / 0 ) »
Vieleicht noch ein Nachtrag:

Wie kann i ch feststellen, auf welcher Spalte das Objekt gedropt wurde ?

Beitrag von popeiko (ForumUser / 47 / 0 / 1 ) »
Du hast bei der event_receiver Definition noch 2 andere Parameter (neben e_dragdropobj) definiert: e_row und e_column.

E_row liefert die Zeilen-ID deiner internen Gridtabelle und e_column den Namen der Grid-Spalte :wink:

Gruß, Heiko.

Beitrag von the-FoX (ForumUser / 87 / 0 / 0 ) »
Genau @Heiko! Danke, hab ich auch gerade bemerkt ;)

Ich glaub ich hab da was übersehen *peinlich* der Drop Methode wird die Spalte ja bereits übergeben in E_COLUMN ;)

Seite 1 von 1

Vergleichbare Themen

0
Antw.
1396
Views
drag and drop functionality ina tree to change its hierarchy
von sreejith » 12.10.2005 11:20 • Verfasst in ABAP Objects®
2
Antw.
2079
Views
Drag & Drop im Tree im gleichen Knoten(Child1)
von eschi78 » 17.05.2006 12:12 • Verfasst in ABAP Objects®
1
Antw.
1494
Views
Drag and Drop Fnktion
von Stahle71 » 06.04.2016 16:21 • Verfasst in ABAP® für Anfänger
6
Antw.
7124
Views
Muster per Drag'n'Drop
von ewx » 24.01.2007 20:09 • Verfasst in Tips + Tricks & FAQs
1
Antw.
2537
Views
Alv-Baum mit der drag und drop
von sreejith » 17.10.2005 16:40 • Verfasst in ABAP Objects®

Über diesen Beitrag


Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Unbeantwortete Forenbeiträge

Daten an Tabelle binden
vor 2 Tagen von Bright4.5 1 / 769
aRFC im OO-Kontext
vor 4 Wochen von ralf.wenzel 1 / 2391
Hilfe bei SWEC/SWE2
letzen Monat von retsch 1 / 8976