How to change the effect of drag and drop from MOVE to COPY in alv tree.

Hi,
I am using a tool in which now the behaviour on drag and drop is MOVE. I want to change it to COPY.
But I do not know which parameter needs to be set and where.
please help.
Regards,
Smita.

Hi,
Thanks for quick reply.
The code goes on like this
METHOD set_dd_behavior.
  DATA: l_copysrc(1) TYPE c,
        l_movesrc(1) TYPE c,
        l_droptarget(1) TYPE c.
Set the Drag and Drop Flavors.
  CREATE OBJECT dd_behavior.
  READ TABLE reg_functions WITH KEY name_function = 'COPY'
  TRANSPORTING NO FIELDS.
  IF sy-subrc = 0.
    l_copysrc = 'X' .
  ENDIF.
  READ TABLE reg_functions WITH KEY name_function = 'CUT'
  TRANSPORTING NO FIELDS.
  IF sy-subrc = 0.
    l_movesrc = 'X' .
  ENDIF.
  READ TABLE reg_functions WITH KEY name_function = 'PASTE'
  TRANSPORTING NO FIELDS.
  IF sy-subrc = 0.
    l_droptarget = 'X' .
  ENDIF.
  CALL METHOD dd_behavior->add
  EXPORTING
  flavor = 'MOVE'
  dragsrc = l_movesrc
  droptarget = l_droptarget
  effect = cl_dragdrop=>move.
  CALL METHOD dd_behavior->add
  EXPORTING
  flavor = 'COPY'
  dragsrc = l_copysrc
  droptarget = l_droptarget
  effect = cl_dragdrop=>copy.
  CALL METHOD dd_behavior->get_handle
  IMPORTING handle = dd_behavior_handle.
ENDMETHOD.
Here what changes needs to be done.
As I see once COPY is added and next time MOVE is added.
I am able to check because I am not able to edit while debugging the value of effect.
Please suggest.
Warm regards,
Smita.

Similar Messages

  • How can i get the address with drag and drop from address book into pages?

    I want to creat a letter withe the new pages. Normaly it was possible to put the adress from the adressbook with drag and drop into the letter. So it was possible to create one letter with many different adresses. But now I didn't find this function any more. How to do ist now?
    Withe best regards and I'm sorry for may bad english
    Klaus

    Sounds like you "upgraded" to Pages 5.
    Apple has removed over 90 features from Pages 5.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5, after Exporting your files to Pages '09, and rate/review it in the App Store, then get back to work.
    Peter

  • How to change mouse cursor during drag and drop

    Hi Guys,
    Iam performing a Drag and drop from Table1(on top of the figure) to Table2(down in the figure).
    see attached figure
    http://www.upload-images.net/imagen/e80060d9d3.jpg
    Have implemented the Drag and drop functionality using "Transferable" and "TransferHandler"using the java tutorial
    http://java.sun.com/docs/books/tutorial/uiswing/examples/dnd/index.html#ExtendedDndDemo
    Now My problem is that ,I want to make the 1st column in Table2(ie: Column2-0) not to accept any drops so that the cursor appears like a "No-Drop" cursor but with selection on the column cell during a drop action.
    Also when I move my cursor between "column2-0" and "column2-1",want to to have the "No-Drop" and "Drop" cursor to appear depending on the column.
    How can I achieve it using the TransferHandle class.Dont want to go the AWT way of implementing all the source and target listeners on my own.
    Have overridded the "CanImort" as follows:
    public boolean canImport(JComponent c, DataFlavor[] flavors) {
         JTable table = (JTable)c;      
    Point p = table.getMousePosition();
    /* if(p==null)
         return false;
    int selColIndex = table.columnAtPoint(p);
    if(selColIndex==0)
         return false;*/
    If I execute the above commented code,The "No-Drop" Icon appears in "column2-0",but no cell selection.Also If I move to "column2-1",which is the 1st column,Still get the "No-Drop" Icon there,also with no cell selection.
    for (int i = 0; i < flavors.length; i++) {
    if ((DataFlavor.stringFlavor.equals(flavors))) {
    return true;
    return false;
    Thanks in advance.....
    Edited by: Kohinoor on Jan 18, 2008 3:47 PM

    If you found the selection column based on the mouse pointer, then based on the column, you can set the cursor pointer as any one as below :
    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    setCursor(new Cursor(Cursor.HAND_CURSOR));

  • How to use the palette or drag and drop functions in netbean?

    Is there anyone who can help me out on using drag and drop function in netbean to design GUI inteface..??
    Is palette is the tool that can be used to drag and drop.??
    thank you in advance.

    I actually really like the GUI builder in netbeans. I used to be a big eclipse user so I am very familiar with coding GUIs by hand, and most of what I do involves GUI's or at least swing.
    At first I hated netbeans, I hated that I couldn't edit the code most. Then I decided to take a deep breath and really examine the issue. What I discovered is that most of the edits I wanted to make but couldn't really weren't the right way to be doing it in the first place, for the rest the code is actually really easy to change you just have to know how.
    Now my palette is huge, probably about 250 objects in it organized into sections that work for me. Basically if I want a object to do something that is not already in the palette I simply write a new object and add it to the palette. I started small like with rounded buttons/progress bars, and as I got comfortable I now have some fairly advanced objects like grids, isometric grids, alpha composits, an animated hourglass countdown timer, and an animated "loading/activity" indicator that is not tied to a progress indicator.
    The main reason I stuck with the netbeans drag and drop GUI builder is it's layout manager is really a very nice layout manager, you couldn't pay me enough to go back to eclipse or codeing GUIs by hand, as I can now do in one day what used to take me several weeks.
    So what I am saying is stick with netbeans and the drag and drop, it sucks at first, but once you get to a point where you are comfortable with it and adding to the palette it will become a great tool.
    JSG

  • How to change this code to drag and drop image/icon into it??

    Dear Friends:
    I have following code is for drag/drop label, But I need to change to drag and drop image/icon into it.
    [1]. code 1:
    package swing.dnd;
    import java.awt.*;
    import javax.swing.*;
    public class TestDragComponent extends JFrame {
         public TestDragComponent() {
              super("Test");
              Container c = getContentPane();
              c.setLayout(new GridLayout(1,2));
              c.add(new MoveableComponentsContainer());
              c.add(new MoveableComponentsContainer());
              pack();
              setVisible(true);
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              catch (Exception ex) {
                   System.out.println(ex);
              new TestDragComponent();
    }[2]. Code 2:
    package swing.dnd;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    import java.awt.image.*;
    import java.awt.dnd.DragSource;
    import java.awt.dnd.DropTarget;
    public class MoveableComponentsContainer extends JPanel {     
         public DragSource dragSource;
         public DropTarget dropTarget;
         private static BufferedImage buffImage = null; //buff image
         private static Point cursorPoint = new Point();
         public MoveableComponentsContainer() {
              setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.white, Color.gray));
              setLayout(null);
              dragSource = new DragSource();
              ComponentDragSourceListener tdsl = new ComponentDragSourceListener();
              dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, new ComponentDragGestureListener(tdsl));
              ComponentDropTargetListener tdtl = new ComponentDropTargetListener();
              dropTarget = new DropTarget(this, DnDConstants.ACTION_MOVE, tdtl);
              setPreferredSize(new Dimension(400,400));
              addMoveableComponents();
         private void addMoveableComponents() {
              MoveableLabel lab = new MoveableLabel("label 1");
              add(lab);
              lab.setLocation(10,10);
              lab = new MoveableLabel("label 2");
              add(lab);
              lab.setLocation(40,40);
              lab = new MoveableLabel("label 3");
              add(lab);
              lab.setLocation(70,70);
              lab = new MoveableLabel("label 4");
              add(lab);
              lab.setLocation(100,100);
         final class ComponentDragSourceListener implements DragSourceListener {
              public void dragDropEnd(DragSourceDropEvent dsde) {
              public void dragEnter(DragSourceDragEvent dsde)  {
                   int action = dsde.getDropAction();
                   if (action == DnDConstants.ACTION_MOVE) {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
                   else {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
              public void dragOver(DragSourceDragEvent dsde) {
                   int action = dsde.getDropAction();
                   if (action == DnDConstants.ACTION_MOVE) {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
                   else {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
              public void dropActionChanged(DragSourceDragEvent dsde)  {
                   int action = dsde.getDropAction();
                   if (action == DnDConstants.ACTION_MOVE) {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
                   else {
                        dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
              public void dragExit(DragSourceEvent dse) {
                 dse.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
         final class ComponentDragGestureListener implements DragGestureListener {
              ComponentDragSourceListener tdsl;
              public ComponentDragGestureListener(ComponentDragSourceListener tdsl) {
                   this.tdsl = tdsl;
              public void dragGestureRecognized(DragGestureEvent dge) {
                   Component comp = getComponentAt(dge.getDragOrigin());
                   if (comp != null && comp != MoveableComponentsContainer.this) {
                        cursorPoint.setLocation(SwingUtilities.convertPoint(MoveableComponentsContainer.this, dge.getDragOrigin(), comp));
                        buffImage = new BufferedImage(comp.getWidth(), comp.getHeight(), java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE);//buffered image reference passing the label's ht and width
                        Graphics2D graphics = buffImage.createGraphics();//creating the graphics for buffered image
                        graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));     //Sets the Composite for the Graphics2D context
                        boolean opacity = ((JComponent)comp).isOpaque();
                        if (opacity) {
                             ((JComponent)comp).setOpaque(false);                         
                        comp.paint(graphics); //painting the graphics to label
                        if (opacity) {
                             ((JComponent)comp).setOpaque(true);                         
                        graphics.dispose();
                        remove(comp);
                        dragSource.startDrag(dge, DragSource.DefaultMoveDrop , buffImage, cursorPoint, new TransferableComponent(comp), tdsl);     
                        revalidate();
                        repaint();
         final class ComponentDropTargetListener implements DropTargetListener {
              private Rectangle rect2D = new Rectangle();
              Insets insets;
              public void dragEnter(DropTargetDragEvent dtde) {
                   Point pt = dtde.getLocation();
                   paintImmediately(rect2D.getBounds());
                   rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
                   ((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
                   dtde.acceptDrag(dtde.getDropAction());
              public void dragExit(DropTargetEvent dte) {
                   paintImmediately(rect2D.getBounds());
              public void dragOver(DropTargetDragEvent dtde) {
                   Point pt = dtde.getLocation();
                   paintImmediately(rect2D.getBounds());
                   rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
                   ((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
                   dtde.acceptDrag(dtde.getDropAction());
              public void dropActionChanged(DropTargetDragEvent dtde) {
                   Point pt = dtde.getLocation();
                   paintImmediately(rect2D.getBounds());
                   rect2D.setRect((int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),buffImage.getWidth(),buffImage.getHeight());
                   ((Graphics2D) getGraphics()).drawImage(buffImage,(int) (pt.getX()-cursorPoint.getX()),(int) (pt.getY()-cursorPoint.getY()),MoveableComponentsContainer.this);
                   dtde.acceptDrag(dtde.getDropAction());
              public void drop(DropTargetDropEvent dtde) {
                   try {
                        paintImmediately(rect2D.getBounds());
                        int action = dtde.getDropAction();
                        Transferable transferable = dtde.getTransferable();
                        if (transferable.isDataFlavorSupported(TransferableComponent.COMPONENT_FLAVOR)) {
                             Component comp = (Component) transferable.getTransferData(TransferableComponent.COMPONENT_FLAVOR);
                             Point location = dtde.getLocation();
                             if (comp == null) {
                                  dtde.rejectDrop();
                                  dtde.dropComplete(false);
                                  revalidate();
                                  repaint();
                                  return;                              
                             else {                         
                                  add(comp, 0);
                                  comp.setLocation((int)(location.getX()-cursorPoint.getX()),(int)(location.getY()-cursorPoint.getY()));
                                  dtde.dropComplete(true);
                                  revalidate();
                                  repaint();
                                  return;
                        else {
                             dtde.rejectDrop();
                             dtde.dropComplete(false);
                             return;               
                   catch (Exception e) {     
                        System.out.println(e);
                        dtde.rejectDrop();
                        dtde.dropComplete(false);
    }Thanks so much for any help.
    Reagrds
    sunny

    Well, I don't really understand the DnD interface so maybe my chess board example will be easier to understand and modify:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=518707
    Basically what you would need to do is:
    a) on a mousePressed you would need to create a new JLabel with the icon from the clicked label and add the label to the glass pane
    b) mouseDragged code would be the same you just repaint the label as it is moved
    c) on a mouseReleased, you would need to check that the label is now positioned over your "drop panel" and then add the label to the panel using the panels coordinates not the glass pane coordinates.

  • How to change the Default login script and the USER login script in Netware3.12

    I need to cut down the disk map from Neware 3.12 in Win98 client's PC.
    please tell me
    how to change the Default login script and the USER login script in
    Netware3.12 ?
    Or is there any other ways to do this thing?
    Thanks a lot!

    On 4/6/2006 [email protected] wrote:
    > how to change the Default login script and the USER login script in
    > Netware3.12 ?
    Please repost in the discontinued.forums.
    Edison Ortiz
    Novell Product Support Forum SysOp
    (No Email Support, Thanks !)

  • How to change the icon of JOptionPane and JFileChooser in swing

    Hi,
    Does any body know how to change the icon of JOptionPane and JFileChooser in swing.
    Please help me out in this.
    Thanx in advance.

    Try this
    import javax.swing.*;
    import java.awt.event.*;
    public class Untitled4 {
      public Untitled4() {
      public static void main(String[] args) {
        ImageIcon i = new ImageIcon("C:/TestTree/closed.gif");
        JOptionPane p = new JOptionPane();
        p.setMessage("This JOptionPane has my icon");
        p.setMessageType(JOptionPane.QUESTION_MESSAGE);
        p.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION);
        final JDialog d = p.createDialog("test");
        d.setIconImage(i.getImage());
        d.setVisible(true);
        d.setModal(true);
        if(Integer.parseInt(p.getValue().toString()) == JOptionPane.YES_OPTION) {
            System.out.println("You Clicked Yes");
    }

  • How can we restrict the type of components that can be dragged and dropped from the sidekick CQ

    how can we restrict the type of components that can be dragged and dropped from the sidekick CQ

    Generally drop the components at parasys. The components allowed on the parsys is control via the design mode of the page.So restrict components at the design of the parsys. http://dev.day.com/docs/en/cq/current/wcm/working_with_cq_wcm/using_edit_designandpreviewm odes.html#Design%20Mode

  • How do I set up my drag and drop questionaire to export to a XML file?

    How do I set up my drag and drop questionaire to export to a
    XML file?
    I have a 70 seperate SWF files that pose a question and
    contain a drag and drop rank order response of 1,2,3,4.How do I set
    up a XML file that receives the responses.I don't understand how to
    do the Actionscript
    and get my responses to connect to the XML.Please
    Help!Thanks!
    Here's an example of my XML.
    <assessment>
    <sessionid>ffae926ea290ee93c3f26669c6c04a92</sessionid>
    <request>save_progress</request>
    <question>
    <number>1</number>
    <slot_a>2</slot_a>
    <slot_b>1</slot_b>
    <slot_c>4</slot_c>
    <slot_d>3</slot_d>
    </question>
    <question>
    <number>2</number>
    <slot_a>4</slot_a>
    <slot_b>3</slot_b>
    <slot_c>2</slot_c>
    <slot_d>1</slot_d>
    </question>
    <question>
    <number>3</number>
    <slot_a>1</slot_a>
    <slot_b>2</slot_b>
    <slot_c>3</slot_c>
    <slot_d>4</slot_d>
    </question>
    </assessment>

    Use XML.sendAndLoad.
    http://livedocs.macromedia.com/flash/8/main/00002879.html
    You will need a server script to receive the XML structure
    and it depends on
    the server scripting language how you obtain that data. Then
    you can either
    populate a database or write to a static file or even email
    the XML data
    received from Flash.
    For a basic example, I have two links I use for students in
    my Flash
    courses:
    http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLASP/Ex01/XMLASPEchoEx01_D oc.php
    http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLPHP/EX01/XMLPHPEchoEx01_D oc.php
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "kenpoian" <[email protected]> wrote in
    message
    news:e5i9hp$cs6$[email protected]..
    How do I set up my drag and drop questionaire to export to a
    XML file?
    I have a 70 seperate SWF files that pose a question and
    contain a drag and
    drop rank order response of 1,2,3,4.How do I set up a XML
    file that receives
    the responses.I don't understand how to do the Actionscript
    and get my responses to connect to the XML.Please
    Help!Thanks!
    Here's an example of my XML.
    <assessment>
    <sessionid>ffae926ea290ee93c3f26669c6c04a92</sessionid>
    <request>save_progress</request>
    <question>
    <number>1</number>
    <slot_a>2</slot_a>
    <slot_b>1</slot_b>
    <slot_c>4</slot_c>
    <slot_d>3</slot_d>
    </question>
    <question>
    <number>2</number>
    <slot_a>4</slot_a>
    <slot_b>3</slot_b>
    <slot_c>2</slot_c>
    <slot_d>1</slot_d>
    </question>
    <question>
    <number>3</number>
    <slot_a>1</slot_a>
    <slot_b>2</slot_b>
    <slot_c>3</slot_c>
    <slot_d>4</slot_d>
    </question>
    </assessment>

  • How to change the paper format in SOST tcode from X_65_80 to X_65_266?

    I got data from OTF in SAPSCRIPT and send by email.
    How to change the paper format in SOST tcode from X_65_80 to X_65_255?
    I need to change it automatically from abap.
    Any suggestion?

    Hi,
           change line size and line count in report.
            By default report line size and line count is taken in printer
           settings
    REgards
    amole

  • Is it possible to combine pdfs from software containing the file by dragging and dropping them?

    We have a piece of software that we profile PDF files into it and then have a need to combine those PDFs into one file.  Is it possible to just drag and drop from the software into the combine files area?  I know if you open the files first, you can do that or if you save the documents locally, then you can combine them.  It would be ideal to just select the files in the software, then drag and drop them into the combine pdf window.  We are using Adobe Pro XI.

    Hi Hawk2000,
    The workflow you are talking about is very much possible with Acrobat and a good example is Microsoft Outlook from which we can select multiple e-mails and simply drag into Acrobat combine dialog box for combining.
    What happens when you drag files from you software? Is it public software?
    Can we test your software?
    Regards,
    Anoop

  • Hello, does anyone know why when i drag and drop from the internet,why my images never show up?

    hello, does anyone know why when i drag and drop from the internet,why my images never show up?

    I'm wanting to drag images from the internet into a folder on my desktop or hard drive. I am used to being able to drag just about any image from any website off the web and into a folder on my old mac, but since I got my laptop, I've noticed I cannot do that. Is it a preference?

  • How come in Pages, i cannot drag and drop images?

    how come in Pages, i cannot drag and drop images?

    Yes you can in all versions.
    It helps if you actually describe what you are doing.
    Where are you dragging it from and where are you dragging it to?
    In what version of Pages?
    I suspect you are trying to drag an image into a Table, Header or Footer in Pages 5, which is no longer possible. Feature removed by Apple.
    Peter

  • Hi,  This was not what I meant.     The requirement is:      Drag and drop any one of specific list

    Hi,
    This was not what I meant.
    The requirement is:
    Drag and drop any one of specific list of components say x, y,z in the parsys
    Only after the drag and drop of these components other components can be dragged to the parsys. So we can say that the parsys should allow only the specific components to be added first and only after that other components can be added.
    Thanks ,
    Dipti

    Hi there
    I'm guessing that you mean to ask if one is able to force a user to perform a drag-and-drop as part of a simulation?
    Unless you program it in Flash or some other application it isn't avaiable. Check the link below for more.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Why doesn't the original document I'm dragging and dropping from one folder to another move?

    Why doesn't the original document I'm dragging and dropping from one folder to another move?
    What's happening is the computer is creating a duplicte of the document and placing it in the new location with a new creation date.  The original document I wanted to drag and drop into a new location remains where it started as the "original" document and the new copy has this little arrow protruding up from the lower left of its icon.
    At first I thought it was an alias, but it's a copy of the document I thought I was dragging and dropping.
    What gives here?
    Steve

    That arrow indicates it is a linik to the original, though. This happens if you wish to drag files, for which you do not have permissions to do this operation, e.g. from Library or System folder. I am pretty sure you do not accomplish this operation from/to folders like Desktop or Documents; if so, there is a problem with your system.

Maybe you are looking for

  • Error in installing CE 7.1 SP3 on Windows Server / XP

    I am trying to install CE 7.1 on Windows Server 2003 (version 5.2), SP1 but it fails the pre-requisite analysis giving the message:     Windows XP SP2 or higher and Windows Vista are the supported operating systems. The current version is: Version 5.

  • XSLT with java extensions not working with jdk 1.6

    Hi, in as XSL transformation I'm using java functions in some cases. With jdk1.5 this works fine. But when switching to jdk1.6 it seems the java classes are not properly initialized. See following simple XSL: <?xml version="1.0" encoding="UTF-8"?> <x

  • Registering a plug-in via an installer?

    Is there a way to register a Lightroom plug-in via a Windows Installer, so the user doesn't have to go into the plug-in manager and load it themselves after my installer completes? Thanks! Neil

  • Oracle Software not installed

    Hi! I tried to install SAP NetWeaver 7.1 with Oracle 10 under Windows Server 2003 64bit in english fully updated. But I ran into two problems which prevented the SAP installation to finish : first once all the oracles updates were installed, the orac

  • Documents / Cookbook on how to configure Extended Classic Scenario?

    We currently have the Classic scenario and are thinking of changing to exteded classic becuase we want to use the sourcing cockpit in SRM 7.0.  Does anyone have any good documentation on how to configured Extended Classic?