Code for double clicking rows  in alvgrido/p and moving it to internal tabl

hi,
code for double clicking rows  in alvgrido/p and moving it to internal table

hi,
      see the following code which uses layout , double_click event in ALVGRID.
TABLES: mara,marc.
DATA:obj_custom TYPE REF TO cl_gui_custom_container,
     obj_alv TYPE REF TO cl_gui_alv_grid.
DATA: it_mara TYPE TABLE OF mara,
      wa_mara TYPE mara,
      wa_layout TYPE lvc_s_layo,
       wa_variant TYPE disvariant,
        x_save.
DATA:it_marc TYPE TABLE OF marc,
      wa_marc TYPE marc.
SELECT-OPTIONS: s_matnr FOR mara-matnr DEFAULT 1 TO 500.
START-OF-SELECTION.
  SELECT * FROM mara INTO TABLE it_mara
    WHERE matnr IN s_matnr.
  CALL SCREEN '100'.
      CLASS cl_dbclick DEFINITION
CLASS cl_dbclick DEFINITION.
  PUBLIC SECTION.
    METHODS dbl FOR EVENT double_click OF cl_gui_alv_grid
      IMPORTING e_row e_column.
ENDCLASS.
DATA: obj1 TYPE REF TO cl_dbclick.
      CLASS cl_dbclick IMPLEMENTATION
CLASS cl_dbclick IMPLEMENTATION.
  METHOD dbl.
    IF e_row-rowtype = space AND NOT e_row-index IS INITIAL.
      READ TABLE it_mara INDEX e_row-index INTO wa_mara.
    SELECT * FROM marc INTO TABLE it_marc
    WHERE matnr = wa_mara-matnr.
        CALL METHOD obj_custom->free
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL SCREEN '200'.
    ENDIF.
  ENDMETHOD.                    "dbl
ENDCLASS.                    "cl_dbclick IMPLEMENTATION
*&      Module  USER_COMMAND_0100  INPUT
      text
MODULE user_command_0100 INPUT.
  CALL METHOD obj_custom->free
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  CASE sy-ucomm.
    WHEN 'BACK'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&      Module  filldata  OUTPUT
      text
MODULE filldata OUTPUT.
  CREATE OBJECT obj_custom
    EXPORTING
      container_name = 'CONTROL'.
  CREATE OBJECT obj_alv
    EXPORTING
      i_parent = obj_custom.
  CREATE OBJECT obj1.
  SET HANDLER obj1->dbl FOR obj_alv.
  CALL METHOD obj_alv->set_table_for_first_display
    EXPORTING
   i_buffer_active               =
   i_bypassing_buffer            =
   i_consistency_check           =
      i_structure_name              = 'MARA'
      is_variant                    = wa_variant
      i_save                        = x_save
   i_default                     = 'X'
      is_layout                     = wa_layout
   is_print                      =
   it_special_groups             =
   it_toolbar_excluding          =
   it_hyperlink                  =
   it_alv_graphics               =
   it_except_qinfo               =
   ir_salv_adapter               =
    CHANGING
      it_outtab                     = it_mara
   it_fieldcatalog               =
   it_sort                       =
   it_filter                     =
EXCEPTIONS
   invalid_parameter_combination = 1
   program_error                 = 2
   too_many_lines                = 3
   others                        = 4
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDMODULE.                 " filldata  OUTPUT
*&      Module  STATUS_0100  OUTPUT
      text
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  STATUS_0200  OUTPUT
      text
MODULE status_0200 OUTPUT.
  SET PF-STATUS 'STATUS'.
*  SET TITLEBAR 'xxx'.
SUPPRESS DIALOG.
     SET PARAMETER ID 'MAT' FIELD wa_mara-matnr.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
*WRITE:/ wa_mara-matnr,
       wa_mara-mbrsh,
       wa_mara-meins.
  CREATE OBJECT obj_custom
    EXPORTING
      container_name = 'CONTROL'.
  CREATE OBJECT obj_alv
    EXPORTING
      i_parent = obj_custom.
  CALL METHOD obj_alv->set_table_for_first_display
    EXPORTING
   i_buffer_active               =
   i_bypassing_buffer            =
   i_consistency_check           =
      i_structure_name              = 'MARC'
   is_variant                    = wa_variant
   i_save                        = x_save
   i_default                     = 'X'
   is_layout                     = wa_layout
   is_print                      =
   it_special_groups             =
   it_toolbar_excluding          =
   it_hyperlink                  =
   it_alv_graphics               =
   it_except_qinfo               =
   ir_salv_adapter               =
    CHANGING
      it_outtab                     = it_marc
   it_fieldcatalog               =
   it_sort                       =
   it_filter                     =
EXCEPTIONS
   invalid_parameter_combination = 1
   program_error                 = 2
   too_many_lines                = 3
   others                        = 4
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDMODULE.                 " STATUS_0200  OUTPUT
*&      Module  layout  OUTPUT
      text
MODULE layout OUTPUT.
  wa_layout-grid_title = 'MATERIAL DATA'.
  wa_layout-zebra = 'X'.
wa_layout-edit = 'X'.
ENDMODULE.                 " layout  OUTPUT
*&      Module  variant  OUTPUT
      text
MODULE variant OUTPUT.
  wa_variant-report = 'ZALV_GRID1'.
  x_save = 'A'.
ENDMODULE.                 " variant  OUTPUT
*&      Module  USER_COMMAND_0200  INPUT
      text
MODULE user_command_0200 INPUT.
  CASE sy-ucomm.
    WHEN 'BACK'.
      CALL METHOD obj_custom->free
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LEAVE TO SCREEN '100'.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0200  INPUT
thanks,
raji
reward if helpful

Similar Messages

  • BDC Ok-Code for Double Click

    Hi ,
    Could anyone let me know the BDC OK Code for Double click.
    I need to select a row by double clicking it in my recording but not able to capture the code for it.
    Please do the needful.
    Thanks in Advance,
    Sowmmya B

    Hi sowmmya,
    1. If the row you are talking about is
       ALV Grid OO concepts,
       then i think there is a problem.
       It won't work with BDC as u are trying.
    2. Well, for getting the code,
       before double clicking go in debug mode /H
       and then double click.
    3. Now in deubbing mode,
      see the value of sy-ucomm.
    regards,
    amit m.

  • How to call a screen /t-code by double clicking on the output of an alv?

    Hi,
    I want to call a screen /  t-code on double clicking on the output of an alv report.
    Suppose we click on a value in the "Pur Req" feild of the ALV output  it should  open the the transaction code and give us  the  details of that particular value. How can I do that?
    Thanx in advance..

    If you displaying ALV using Classes..( CL_GUI_ALV_GRID)... You need to create event receiver and register the double click event handler method dynamically.... Here's the sample code...
    *                            C L A S S E S                             *
    class lcl_event_receiver definition.
      public section.
        methods:  handle_double_click
                  for event double_click
                  of cl_gui_alv_grid
                  importing e_row e_column.
    endclass.
    *       CLASS lcl_event_receiver IMPLEMENTATION
    class lcl_event_receiver implementation.
      method handle_double_click.
        data: l_cc like line of gt_cc.
        data:
        g_row type i,
          g_value(10),
          g_col type i,
          g_row_id type lvc_s_row,
          g_col_id type lvc_s_col,
          g_row_no type lvc_s_roid.
    *  Read the double click cell
        call method gr_grid->get_current_cell
               importing
                 e_row     = g_row
                 e_value   = g_value
                 e_col     = g_col
                 es_row_id = g_row_id
                 es_col_id = g_col_id
                 es_row_no = g_row_no.
        clear wa_itab
        read table gt_itab index g_row_id into wa_itab.
        case g_col_id.
          when 'EBELN'.                   "Show Process Order
            if not wa_itab-ebeln is initial.
              set parameter id 'BES' field wa_cc-ebeln.
              call transaction 'ME22N'  and skip first screen.
            endif.
        call method gr_grid->set_table_for_first_display
            exporting
            i_consistency_check   =  g_consistency_check
            it_toolbar_excluding  =  gt_exclude
            is_variant            =  gs_variant
            i_save                =  g_save
            i_default             =  'X'
            is_layout             =  g_layout
        changing it_outtab        =  gt_cc[]
                 it_fieldcatalog  =  gt_fieldcat[]
                 it_sort          =  gt_sortcat[].
        create object event_receiver.
    *   Register the 'Double Click' event handler method dynamically.
        set handler event_receiver->handle_double_click for gr_grid.

  • Change preferences for double click on images in Bridge

    Hiya,
    I feel a bit silly for asking this because it seems so obvious, but the onvious way just doesn't seem to work for me.
    When double-clicking on an image in Bridge, it opens Photoshop - which I suppose in some cases helps, but drives me crazy because it slows the system down so much. I want it to open Camera Raw 6 or just have a bigger preview of the photo.
    I tried Edit/Preferences: Under General I ticked the option that double clicks edits camera raw settings
    and under file associations I tried to associate jpg files with something other than photoshop but Camera Raw 6.0 is not offered to me there and I can't find the path that leads to it. What is the path? Or is there a different way?
    Thanks so much!!
    (Oh and another question, when when you filter for two keywords, you get all files that have either one or the other, how can I make them only show the ones that have both???)

      Don't think you could get a jpeg to open in camera raw with a double click as that is not the normal route, like it is with a raw image.  If you right click on the image you have the option to open in camera raw.
    If you do a search with 2 keywords it you only want images that have both you have to click if all criteria met in the match drop down box.

  • Integrating code for mouse click!

    Hello!
    I'm trying to get this code working where I want to integrate a shortcut for clicking an button made in Egde Animate.
    The code snippets you see is just some copied areas of the whole working code,
    Serial.print(c);
            if (c == '\n') {
              if (readString.indexOf("?") <0)
                //do nothing
              else
                 if(readString.indexOf("UP=UP") >0)
                     movetiltupstep();
    // now output HTML data starting with standard header
              client.println("HTTP/1.1 200 OK");
              client.println("Content-Type: text/html");
              client.println();
              //set background to green
              client.print("<body style=background-color:green>");
              client.println("<hr />");
              client.println("<center>");
              client.println("<h1>Servo control</h1>");
              client.println("<form method=get name=SERVO>");
              client.println("<input type=submit value=UP name=UP style=\"width:100px\"><br>");
              client.println("<input type=submit value=LT name=LT style=\"width:100px\"><input type=submit value=CN name=CN style=\"width:100px\"><input type=submit value=RT name=RT style=\"width:100px\"><br>");
              client.println("<input type=submit value=DN name=DN style=\"width:100px\">");
              client.println("</form>");
              client.println("</center>");
              client.println("</body></html>");
              //clearing string for next read
              readString="";
              //stopping client
              client.stop();
    void movetiltupstep(){
      tiltpos = tilt.read();
      Serial.println(tiltpos);
      if (tiltpos >= 66)
      tilt.write(tiltpos - 2);
    This is just an overview of my setup for a webpage, where I can move a servo with a button and this is called movetiltupstep();
    The button is made here, ("<input type=submit value=UP name=UP style=\"width:100px\"><br>"); and I want to use this with the button in Edge Animate.
    For a button this is the setup, function(sym, e) and I tried to integrate something like this:
    // insert code for mouse click here
    sym.$("<input type=submit value=UP name=UP>")  but not working.
    How would i proceed with this problem, ideas anyone?
    Regards, Tor

    import javax.swing.*;
    import java.awt.event.MouseMotionListener;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseEvent;
    import java.awt.*;
    public class MouseTracker extends JFrame implements MouseListener, MouseMotionListener
        private JLabel statusBar;
        public MouseTracker()
            super("Demonstrating Mouse Events");
            statusBar = new JLabel();
            getContentPane().add(statusBar, BorderLayout.SOUTH);
            addMouseListener(this);
            addMouseMotionListener(this);
            setSize(275, 100);
            setVisible(true);
        public static void main(String[] args)
            MouseTracker application = new MouseTracker();
            application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public void mouseClicked(MouseEvent e)
            statusBar.setText("Clicked at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseReleased(MouseEvent e)
            statusBar.setText("Released at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseEntered(MouseEvent e)
            statusBar.setText("Clicked at [" + e.getX() + ", " + e.getY() + "]");
            getContentPane().setBackground(Color.GREEN);
        public void mousePressed(MouseEvent e)
            statusBar.setText("Pressed at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseExited(MouseEvent e)
            statusBar.setText("Mouse outside window");
            getContentPane().setBackground(Color.WHITE);
        public void mouseDragged(MouseEvent e)
            statusBar.setText("Dragged at [" + e.getX() + ", " + e.getY() + "]");
        public void mouseMoved(MouseEvent e)
            statusBar.setText("Moved at [" + e.getX() + ", " + e.getY() + "]");
    }

  • How do I adjust double click speed in Mountain Lion. The mouse system preferences does not seem to have a speed slider for double clicking. Only the tracking speed slider is visible.

    Double clicking is no longer opening my folders.
    How can I adjust the double click speed in Mountain Lion to reduce the double clicking speed. The mouse system preferences does not seem to have a speed slider for double clicking. Only the tracking speed slider is visible.

    For 10.8.3,  it's in System Preferences > Accessiblity > highlight Mouse & trackpad on the left.  The Double click speed slider shows on the right.  Moving it to the left gives you more time between clicks.  Moving it right gives you less time.

  • Double-click intermittently accepted in Finder and most apps

    since upgrading to Lion, I've experienced intermittent (though frequent) problems with double-clicking being accepted (e.g. to launch an app, open a folder, or to select a word in an application - basically it takes quadruple-click, or more). The first time I solved the problem with suggestions from this community that the Spotify app caused the problem.
    I haven't used Spotify since; and have incidentally doubled the RAM in my iMac to 8GB. But the double-click problem seems to be migrating back.
    Are there any other known or suspected third-party apps? I use MagicPrefs with my MagicMouse, for example. Or is this a known problem? I've also noticed that the Mouse preferences for MagicMouse no longer include a setting for double-click speed...

    I agree. Send Apple Feedback here.
    The more who send feedback the more likely it will get done.

  • HT3159 When I double click on IPhoto to open and look at my photos the APP store trys to open it. I never had this issue before. Why now?

    I was using IPhoto looking at creating a Book when I uploaded the book for purchasing the site froze. I stopped the upload turned off computer and when I restarted the computer IPhoto dissappeared. I called Apple and the lady talked me through restoring IPhoto. She found it in the trash.It worked fine for a day or two, I uploaded more photos from Nikon camera closed IPhoto and now it won't open. The App Store trys to open it but it times out and won't connect.
    When I double click on IPhoto to open and look at my photos the APP store trys to open it. I never had this issue before. What  do I do?

    Try dragging a photo to the desk top, highlight it and press COMMAND I this will open the info window, in the drop down menu "open with" select either preview, or other, then select iPhoto. Preview is the default.
    Then click "Change All"
    Hope this helps

  • Suddenly my double click both on track pad and mouse is not working

    suddenly my double click both on track pad and mouse is not working.in System Preferences,track pad, i have ticked and unticked the Tap to click several times.Restarted the mac for several times at well but still i do not have double click.help me please.

    It might be the double click speed setting.
    Look in System Preferences > Universal Access > Mouse & Trackpad tab > Trackpad options.. button > move the double click speed to the slow side of the range.

  • How can i setup pages to automatically open when double clicked.  Currently when I double click it creates cpgz file and does not open.  The only way to open pages doc is to manually ask to open with pages.

    Currently when I double click it creates cpgz file and does not open.  The only way to open pages doc is to manually ask to open with pages.

    Hi Karen,
    Sounds like OS X has lost the association between Pages and its files.
    Start by quitting Pages, then going to Finder.
    In Finder, locate a .pages file. Click on it (once), then press command-I (eye, not one) to Get Info.
    In the Info window that opens, expand the Open With section.
    In this section, click on the pop-up menu and choose Pages (even if Pages is already shown).
    Click the Change All button to associate all files with the .pages extension with Pages.
    Close the info window.
    Double click any .pages file to check that Pages will now launch and open the file.
    Regards,
    Barry

  • I bought an Iphone 4S 16Gb from softbank - Japan. I would like to buy an active code for my Iphone, how can I do and where can I buy?

    I bought an Iphone 4S 16Gb from softbank - Japan. I would like to buy an active code for my Iphone, how can I do and where can I buy?

    That iPhone is useable only on the softbank network. Softbank does not
    unlock iPhones for use on other networks. Sell that iPhone to someone who
    can use it on Softbank and use the money to buy an iPhone that will work
    with your wireless provider.

  • Double click to open Menu bar and then close the apps...

    Good morning to all,
    I've an Iphone 4 since 2011 and yesterday I downloaded the iOS 7 software. Now I miss the function where you double click on the home button and then you keep the icon pressed until the forbidden sign appears to close the app definetly. Somebody knows how to do it now with iOS 7?
    Thanks a lot in advance and have a great day, Giovanni.
    Buongiorno a tutti. Io ho un Iphone 4 del 2011 e per momento funzione che è una meraviglia. Ieri l'ho aggiornato ad iOS 7 e ho subito notato che non esiste più la funzione doppio clic su Home per poi chiudere del tutto i programmi utilizati prima. Per me era diventato proprio un'abbitudine di chiudere le applicazioni subito dopo l'uso per risparmiare anche batteria oltre a non consumare traffico internet. Qualcuno sa come si fa con iOS 7? Grazie mille, Giovanni.

    double click the home button and in the open apps preview(above the app icon), swipe it upwards to close

  • Open T-code on double click of field in table maintenance

    Hi Gurus,
    I have one scenario, I have to show a transaction on double click event on a field of Table Maintence.
    Please guide me in this .
    Is there is any event in Table Maintenance Events to capture double_click of a field.
    Regards,
    Sowmen

    1. In the field attributes of the particular field there is a chechbox  in display tab which says respond to double click, check that.
    2. Assign the fuction code "PICK" for function code F2 in GUI status.
    3.Now whenver you double click the field function code "PICK" gettes triggeed.
    Now you can wrie yyou code based on this function code.
    CASE sy-comm.
    WHEN 'PICK'.
    *If you want the name of the field and the value in that field use the below code.
    GET CURSOR FIELD gv_field VALUE gv_cursor_value.
    *DO your operation based on the field and the value.
    ENDCASE.
    Regards,
    Smithesh

  • OK CODE FOR SINGLE CLICK IN DYNPRO

    HEY GUYS,
    CAN YOU PLEASE TELL ME WHATS THE OKCODE FOR SINGLE CLICK.
    IF I MAKE SINGLE CLICK IN TABLE CONTROL COLUMN HEADER ITS NOT GOING TO PAI FLOW LOGIC.
    PLEASE SUGGEST ME ..HOW TO GO WITH PAI USING SINGLE CLICK ACTION WITH TABLE CONTROL COLUMN HEADER.
    IS THERE ANY FUNCTION CODE I HAVE MAKE TO ON READY TO STATUS AT TABLE CONTROL COLUMNS.
    THANKS IN ADVANCE.
    AMBICHAN

    Hi Chan,
    Instead of Single click better u can handle trying Double click...  Then PAI will definitely be triggered..
    Regards,
    Sridhar

  • Expand collapsed code by double-click. A ticking bomb

    I might have posted about this before, but since the technical support doesn't accept cases after-hours (they seem not like to arrive to the office with tons of requests, so we are all squeezed to the the group of those that have the time to wait in line - in the chat… which often closes itself because of the long time waited)
    When I double click collapsed code to expand it, Dreamweaver ALWAYS crashes. It might be on the spot, or later.
    If I NEVER double click collapsed code, Dreamweaver can run for weeks without even closing it (I never shutdown my MacBook Pro)
    If I do it, it WILL crash, usually on the spot, or minutes later.
    When I dare to do it, and I forget that I did minutes later, I end up regretting when it finally crashes, and it NEVER dissapointed me: Soon it crashes as expected.
    I already deleted all the possible preferences and customizations, and it still happens.
    It's been happening for years, so it's not only DreamWeaver CC. Definitely from CS4 and up.
    I use creative swite CC, on Mac OS 10.6.8

    I use creative swite CC, on Mac OS 10.6.8
    Can you confirm the version(s) of DW you're running on 10.6.8?
    Dreamweaver CC only runs on Mac OS X 10.7 and higher
    http://www.adobe.com/products/dreamweaver/tech-specs.html

Maybe you are looking for

  • Getting Runtime Errors...?

    I managed to install 7.3 with no problem (also no podcasts) but then came patch Tuesday. This afternoon I got runtime errors (courtesy of the Microsoft Visual C++ Runtime Library) and iTunes would close. Uninstalling the .NET Security patch didn't fi

  • White screen or green screen question

    hi i have a series of interviews coming up...will shoot 1080.  I like the nice clean look of white for the background. Question is whether to shoot with white backdrop or green screen and key white in post.  Here is my issue: I want to use part of th

  • 3G/UMTS even after 2.1 poor

    My iPhone shows "3G" but while I try 2 open a website it changes 2 Edge while I'am in a very good supported UMTS aerea!! After new connecting (airplain mode) the phone finds again 3G/UMTS, but if I try 2 open (an other) site - same game again A updat

  • Yesterday's Updates to Dynamic Link Media Server

    I woke to find four updates to CS6 (Au, Ae, Ps, and Pr) yesterday, which the Updater called "Dynamic Link Media Server CS6 1.0.1 Update." I updated, and I updated my CUDA about the same time. Pr started working slower.  So, I reverted back, using my

  • HT201364 mid-late 2007? can you be a bit more specific, will Mavericks work on Intel Core 2 Duo 2.66 GHz 4GB ?

    mid-late 2007? can you be a bit more specific, will Mavericks work on Intel Core 2 Duo 2.66 GHz 4GB ?