Double click using FM: REUSE_ALV_GRID_DISPLAY

Hi
I use FM: REUSE_ALV_GRID_DISPLAY to display ALV. Now I need use double-click action. After double click on e.g material I run mm03 with proper parameters (from presented list).
Could you give me advice how to do this (I know that using cl_gui_alv_grid it would be easier)
Thanks in advance

Hi,
Please find the code below which uses the 
FM: REUSE_ALV_GRID_DISPLAY for double click.
*& Report  YH1058_ALVDEMO1
REPORT  YH1058_ALVDEMO1.
*type pools for alv declarations
TYPE-POOLS: slis.
*structure declaration for tstc table
TYPES : BEGIN OF ty_tstc,
        tcode TYPE tcode,
        pgmna TYPE program_id,
        dypno TYPE dynpronr,
        END OF ty_tstc.
Internal table and workarea declarations for tstc
DATA: it_tstc TYPE STANDARD TABLE OF ty_tstc,
      wa_tstc TYPE ty_tstc.
*data declarations for ALV
DATA: it_layout TYPE slis_layout_alv,
      wa_fieldcat TYPE slis_fieldcat_alv,
      it_fieldcat TYPE slis_t_fieldcat_alv,
      it_eventexit TYPE slis_t_event_exit,
      wa_eventexit TYPE slis_event_exit.
*initialisation event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*subroutine to fetch data from the db table
  PERFORM fetch_data.
*subroutine for output display
  PERFORM alv_output.
*&      Form  fetch_data
      *subroutine to fetch data from the db table
FORM fetch_data.
*Internal table and work area declaratin for TSTC (local tables)
  DATA : lt_tstc TYPE STANDARD TABLE OF ty_tstc,
         ls_tstc TYPE ty_tstc.
*Static field definition
*Reads the last tcode and stores it in l_tstc that on refresh further data
*beyond this value is fetched
  STATICS l_tstc TYPE tcode.
Selection from the tstc table
*we select till 25 rows and on further refresh next 25 are selected
*we select transactions having screen numbers only
  SELECT tcode
         pgmna
         dypno
         FROM tstc
         INTO CORRESPONDING FIELDS OF TABLE lt_tstc
         UP TO 25 ROWS
         WHERE tcode GT l_tstc
         AND dypno NE '0000'.
Code for transferring the values of local table to output table
for 25 rows as sy-tfill is 25.
*In case there are no records a message pops up.
  IF sy-subrc EQ 0.
    DESCRIBE TABLE it_tstc.
    READ TABLE lt_tstc INTO ls_tstc INDEX sy-tfill.
    l_tstc = ls_tstc-tcode.
    it_tstc[] = lt_tstc[].
  ELSE.
    MESSAGE 'No Records found ' TYPE 'i'.
  ENDIF.
ENDFORM.                    "read_data
*&      Form  alv_output
      text
FORM alv_output.
*subroutine to refresh alv
  PERFORM event_exits.
*field catalogue
  PERFORM build_fieldcat.
*Layout for alv
  PERFORM build_layout.
*output display
  PERFORM alv_display.
ENDFORM.                    "alv_output
*&      Form  event_exits
      text
*subroutine to refresh alv
FORM event_exits.
  CLEAR wa_eventexit.
  wa_eventexit-ucomm = '&REFRESH'.    " Refresh
  wa_eventexit-after = 'X'.
  APPEND wa_eventexit TO it_eventexit.
ENDFORM.                     "event_exits
*&      Form  build_fieldcat
      text
*Field catalogue
FORM build_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-row_pos   = '1'.
  wa_fieldcat-col_pos   = '1'.
  wa_fieldcat-fieldname = 'TCODE'.
  wa_fieldcat-tabname   = 'it_tstc'.
  wa_fieldcat-seltext_m = 'TRANSACTION'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-row_pos   = '1'.
  wa_fieldcat-col_pos   = '2'.
  wa_fieldcat-fieldname = 'PGMNA'.
  wa_fieldcat-tabname   = 'it_tstc'.
  wa_fieldcat-seltext_m = 'PROGRAM'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-row_pos   = '1'.
  wa_fieldcat-col_pos   = '3'.
  wa_fieldcat-fieldname = 'DYPNO'.
  wa_fieldcat-tabname   = 'it_tstc'.
  wa_fieldcat-seltext_m = 'SCREEN'.
  APPEND wa_fieldcat TO it_fieldcat.
ENDFORM.                     "build_fieldcat
*&      Form  build_layout
      text
*Layout
FORM build_layout.
  it_layout-zebra = 'X'.
  it_layout-colwidth_optimize = 'X'.
ENDFORM.                     "build_layout
*&      Form  alv_display
      text
*ALV output
FORM alv_display.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_user_command  = 'USER_COMMAND'
      i_callback_pf_status_set = 'PFSTATUS'
      it_fieldcat              = it_fieldcat
      is_layout                = it_layout
      it_event_exit            = it_eventexit
      i_screen_start_column    = 10
      i_screen_start_line      = 20
      i_screen_end_column      = 70
      i_screen_end_line        = 45
      i_grid_title             = 'Call Tcode Refresh ALV'
    TABLES
      t_outtab                 = it_tstc.
ENDFORM.                    "alv_display
*&      Form  user_command
      text
*User actions on ALV
FORM user_command USING r_ucomm TYPE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
*User clicks a transaction code and that tcode is called from ALV
    WHEN '&IC1'.
      READ TABLE it_tstc INDEX rs_selfield-tabindex INTO wa_tstc.
      IF sy-subrc = 0.
        CALL TRANSACTION wa_tstc-tcode.
      ENDIF.
*user clicks the refresh button and the next 25 records are displayed
    WHEN '&REFRESH'.
      PERFORM fetch_data.
      rs_selfield-refresh    = 'X'.
      rs_selfield-col_stable = 'X' .
      rs_selfield-row_stable = 'X' .
  ENDCASE.
ENDFORM.                    "user_command
      FORM PFSTATUS                                            *
*Form for settings the pf status to the alv
FORM pfstatus USING ut_extab TYPE slis_t_extab.
  SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
ENDFORM.                               " PF_STATUS_SET
Warm Regards
R Adarsh

Similar Messages

  • Open Folder by double click using java.awt

    Hello Guys,
    I have a problem. I m listing directory in List(java.awt). When i single click on directory it will open. But how i can double click on that directory then and then it will open otherwise not. By using JAVA.AWT.

    According to the documentation for java.awt.List "When an item is selected or
    deselected by the user, AWT sends an instance of ItemEvent to the list. When
    the user double-clicks on an item in a scrolling list, AWT sends an instance of
    ActionEvent to the list following the item event. AWT also generates an action
    event when the user presses the return key while an item in the list is selected."
    If your directories are "opening" (whatever that means) in response to a single
    click, that it because of how you have written your code. Change it so that action
    events rather than item events cause the opening to happen.

  • Feature Request: Double Clicking should be slowed down for Browsing use.

    I have a menu on my website that you need to click some what fast - but when I do a normal double click using Opera, FF, or IE it doesn't highlight the entire menu. When I try in Safari it does.
    It seems like the other browsers have set the double click up a couple notches some how.

    This isn't the first instance of someone with mouse issues. It seems Safari is currently ignoring a lot of system wide keyboard and mouse settings, including but not limited to, special function buttons and scroll speeds.
    My inital guess is that its a bug just like the others.

  • Double-click not working on trackpad after Mavericks installation

    After doing a fresh installation of OS X Mavericks and zapping PRAM, I noticed that I'm unable to double-click using my trackpad (this is true throughout all applications, not just the Finder).  Can anyone advise me on how to remedy this?
    My system is a Late 2002 MacBook Pro Retina.
    Thanks,
    Nicholas

    You can type Command-Shift-G and type in ~/Library/Preferences
    I had some challenges deleting everything here while logged in, so you'll have to do this from another Admin account. 
    I suggest just doing a clean install if you have the time.  That solved all my problems and reduced my boot time as well.

  • Universal Access Mouse Keys Double Click Broken In Lion

    Hi,
    Lion has made a couple of changes to the Universal Access Mouse Keys, BUT...
    You can no longer double click with the 5 key...
    This is a HUGE problem for users reliant on this to counter RSI problems.
    To reproduce:
    In Universal Access, toggle Mouse Keys to 'On'.  Open a text document, hover the cursor over a word, and double click using the number pad 5 key.
    Prior to Lion this selected the word.  In Lion this is no longer happens.
    I am using an Apple keyboard with number pad and a MacBookPro.
    Please re-instate this functionality.
    Regards,
    Rob.

    This was fixed in 10.7.2 or 3 from memory, but returned in 10.8 and remains in 10.8.2.
    I use Keyboard Maestro to map F17 on my keyboard to double-click, Ctrl+F17 to triple-click
    http://www.keyboardmaestro.com/main/

  • REUSE_ALV_GRID_DISPLAY---Double click user command

    Hi,
    I am developing an ALV Report using REUSE_ALV_GRID_DISPLAY function call. I have the requirement to incorporate dirll down functionality using FB03 transaction for each of my line item in the ALV display.
    I have defined a subrouting user_command where i handle this event. However, i am unable to implement the logic. Any help is appreciated.

    hI Supriya,
    this is a sample code for calling a FORM user_command once you double-click on your key field..
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = SY-REPID
      I_CALLBACK_PF_STATUS_SET       = ' '
        I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
      I_STRUCTURE_NAME               =
         IS_LAYOUT                      = GS_LAYOUT
         IT_FIELDCAT                    = CT_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
         IT_SORT                        = IT_SORT[]
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
         I_SAVE                         = 'A'
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE         0   = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = ITAB_BKPF_BSEG
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *i_calLback_user_command = 'USER_COMMAND'.
    FORM USER_COMMAND
      USING UCOMM LIKE SY-UCOMM
      SELFIELD TYPE SLIS_SELFIELD.
      DATA wa LIKE LINE OF ITAB_BKPF_BSEG.
    READ TABLE ITAB_BKPF_BSEG index SELFIELD-TABINDEX INTO wa.
    WRITE : / 'TRIAL EVENT' , WA-BUKRS.
    ENDFORM.                    "user_command
    ps:reward points if helpful

  • When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    When I open up iphoto and click on the events tab then double click on an event, it used to show minis of all the photos in that event.  Now it shows only one photo at a time.  How do I get it back? Can you help?

    On the bottom bar of the window (on the left iPhoto 11, on the right in other versions) note the slider. Drag it left.
    Regards
    TD

  • I use several avatar forums that have timed features, when I click on them they act as though they have been double clicked or will not display properly.

    When visiting Roliana the Your Posts and Bookmark sections are suppose to load a list of my previous posts or bookmarks, this section is designed to have a cool down period between clicks. Even if it is the first time in a 24 hour window that I click on the link it acts as though I have double clicked or attempted to access it too quickly.
    On another site NeuroGalaxy the games will not work properly, they too act as though I have attempted to access them even though it is the first time in a 24 hour window.
    The last site Kingdom of Knuffle is having an event where one has to click the answer to quiz, it too can only be accessed once a day and when I click on the answer it redirects me as though I have tried to access it multiple times.
    I have attempted to use these functions on other browsers and they work fine, the only thread of similarity between the issues is Firefox and that they are all timed applications in some manner.
    There are no errors to report or other oddities going on, the sites otherwise display and operate properly.

    Reload web page(s) and bypass the cache to reset animated GIFs.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)

  • How do I take the zoom feature off my MacBook Pro? I have already went to System Preferences and turned "zoom" off in the Universal Access. I saw where someone said to use THREE fingers to double click... ??? Double click what? And 3 fingers?

    Can someone help me?How do I take the zoom feature off my MacBook Pro? I have already went to System Preferences and turned "zoom" off in the Universal Access. I saw where someone said to use THREE fingers to double click... ??? Double click what? And 3 fingers?

    What really cheeses me off here is that Apple isn't allowing users enough customization.  With each update of iTunes (and the OS and iOS) we're forced to give up something that worked well for the way we want to use the app and make do with fewer (and lamer) options.  If Apple keeps this up, they're going to start losing customers fast.  I mean if this isn't fixed soon, I'm pretty sure I'm going to give up on iTunes, and then I'll probably go ahead and get a Galaxy when I need to replace my iPhone.
    What I don't understand about how they won't let users delete the list of available podcasts now is why?  How is this making it a better program?  I can understand that not all users are capable enough to right-click on a feed and select "Show all available episodes", so I can see why they want the complete list to be the default (and, surprise, it already was).  But to not give users the option to delete that list?  It's inconsiderate because it makes navigating feeds with a large back catalogue really frustrating.  I'm flabbergasted that no one at Apple considered all the podcast feeds that keep hundreds of episodes available when they removed this feature.  It smacks of rank incompetence.
    What improvement were they trying to make here anyway?  There was nothing wrong to my mind about how podcasts were managed in previous versions.  Whatever improvement they were trying to make here, they should have realized that many users would at least want the option to keep things the way they were.
    And reverting to a previous version is no solution.  I can't sync my iPhone with the new iOS without this update, and (while I do have some issues--specifically how you can't play podcasts in the Music app anymore) I do like the new iOS.

  • JDeveloper IDE Crashing using double click on DataAction in struts-diagram.

    Hello,
    Has anyone had this problem with Jdeveloper10g?
    We have a workspace for an application that has grown fairly large. The
    problem happens when we try to drag a DataAction from the Component Palette
    onto the struts-diagram when in the the JDeveloper10g IDE and then
    double click the icon to create a data action. We get this message:
    An Error has occurred in the Java VM
    An operation has failed because an error has occurred in the Java VM. The current
    activity may fail and the system may have been left in an unstable state. The following
    is a stack trace.
    java.lang.StackOverflowError
    If further errors occur, you should restart the application.
    If the error was an OutOfMemoryError, try closing some components, such as some
    diagrams, or increase the Java heap size.
    Also, report the problem on the JDeveloper forum on otn.oracle.com, or contact Oracle
    support, giving the information in this message.
    The Version of JDeveloper we are using is: 10.1.2.1.0 Build 1913 but we also had the
    same problem using this same workspace in Build 1811. If we try a different workspace
    there is no problem and we don't see the issue. Neither do we see the problem if we drag
    either a DataPage or a plain Action from the Component Palette and the double click
    either of those to create a Jsp page or an action.
    We have spent hours using diffing software recursively on the workspace directories trying
    to determine what may have gone wrong. We have eliminated a great deal from the problem
    workspace including deleting everything from the struts-diagram (In a copy of the ws of course).
    We really can't afford to rebuild the workspace from scratch and this problem causes us a
    significant headache. It seems like a serious bug in JDeveloper itself.
    Any help would be appreciated.
    Thanks,

    Problem Solved! This condition is caused by a circular dependency set up when the view was checked as a depndency for the model. We had a small class in the view that was being used in the model so the model was made dependant on the view and this causes an infinite loop condition of some sort when double clicking on a newly dropped in DataAction as described below.

  • We have developed a desktop application using Flash software and published the same for MAC environment. When we double click on the index.app file, the application is working perfectly in Mac 10.6.7 at our office. But if the same index.app file is double

    We have developed a desktop application using Flash software and published the same for MAC environment. When we double click on the index.app file, the application is working perfectly in Mac 10.6.7 at our office. But if the same index.app file is double clicked in Mac 10.6.7 at out clients location, its not opening. For your information the client is able to open this same application by double clicking on index.swf file. The main problem is that client is not able to open the application using index.app file at their office whereas we are able to do so at our office. Can anyone give some suggestions to sort this problem?

    The most common reason is different versions of Flash, or different versions of web browsers used.  Some users may elect to not have Flash installed at all because of the processor overhead of Flash.  If you are going to make an application for a client, check what operating system and browser versions they are using first.  Then determine if a stand alone application is required, or if they have the necessary plugins to run specific browser enhanced code.
    P.S. MAC is an acronym for Media Access Control.  Mac is the shorthand for Macintosh, the operating system and computers made by Apple Inc.

  • The voice that was on when I first set up my ipad came back on and now I have to double click to get into my apps and can't use my apps because her voice is always talking.  How do I make her voice go away and my IPAD work like it should.

    The voice that was on when I first set up my ipad came back on and now I have to double click to get into my apps and can't use my apps because her voice is talking.  How do I make the voice stop and my IPAD work again. 

    If you've turned VoiceOver on then see if triple-clicking the home button turns it off, and then change what Settings > General > Accessibility > Triple-Click Home is set to.
    Otherwise, via 'the touch to select double-tap to activate' process you need to go into Settings > General > Accessibility > VoiceOver and turn it off
    The manual (http://support.apple.com/manuals/#ipad) also says that you should be able to switch voice-over off by connecting to your computer's iTunes :
    Turn VoiceOver on or off in iTunes: Select iPad in the iTunes sidebar. In the Options section of the Summary pane, click Configure Universal Access. Select VoiceOver, then click OK.
    So select Configure Universal Access at the bottom of the Summary tab and set Seeing to Neither

  • The latest version of iTunes does not allow me to open a playlist in a separate window.  I need this feature.  Is there another way?  You used to be able to double click a playlist and have it appear in a new window.

    The latest version of iTunes does not allow me to open a playlist in a separate window.  I need this feature.  Is there another way?  You used to be able to double click a playlist and have it appear in a new window.

    Others have commented on this too.  It seems to be one of the 'improvements' of the newer version you are supposed to embrace with joy as an exciting new development.  You can send feedback to Apple but realize you may be perceived as standing in the path of  progress.
    http://www.apple.com/feedback/itunesapp.html

  • How  can I start my Java Application using double-click  in Windows XP?

    I hava developed an editor in java. The file made by this editor is saved as the .cte format. so, I need to associate this file with the editor, which means that when you double click the .cte file ,this file will be opened in the editor just like the notepad.
    I know that Jbuider has used the JNI to achieve this way to open a project. So, will you kindly tell me the details about this technique or give me some document? My E_Mail is [email protected]
    Best Regards,
    Maria

    I think this can be done from a batch file which you can execute when you install your application.
    There are two commands which you are interested in, and they are:
    assoc - Displays or modifies file extension associations.
    ftype - Displays or modifies file types used in file extension associations.
    You should use assoc to associate an extension with a file type, and ftype to associate the file type with an application.
    E.g. jar is associated with this on my machine:
    .jar=jarfile (from assoc)
    jarfile="C:\Program Files\Java\jre1.5.0_06\bin\javaw.exe" -jar "%1" %* (from ftype)
    Kaj

  • How can i start my java application using double-click in WindowsXP?

    i hava developed an editor in java. The file made by this editor is saved as the .cte format. so, I need to associate this file with the editor, which means that when you double click the .cte file ,this file will be opened in the editor just like the notepad.
    I know that Jbuider has used the JNI to achieve this way to open a project. So, will you kindly tell me the details about this technique or give me some document? My E_Mail is [email protected]
    Best Regards,
    Maria

    Must you use native code? Can't you do what I said in your other thread?
    http://forum.java.sun.com/thread.jspa?threadID=699476
    Kaj

Maybe you are looking for

  • Printing Multiple PDF documents on the fly

    Hello all, I am looking for a solution for printing the documents to a PDF file. My requirement is that from the application, I can select a set of documents (say 50 numbers) and give for print. The program is in MS access. The MS access opens the re

  • WITH CLAUSE in SPARQL - Running SPARQL query using JENA

    Hi, Can anybody help me how to use WITH Clause in SPARQL. Below is my Query. I am using Jena 2.6.3 to Run my Query. "PREFIX assc: <http://www./.../> " + "WITH " +      "( " +                     " select ?associate" +                     " where {?as

  • High-level C interface to OCI?

    The OCI seems a little unfriendly in places, for example unnecessarily requiring you to pass string lengths when passing string parameters, using made-up types (e.g. ub4) when native types would probably do, and generally requiring the application de

  • How does one do this effect?

    The photo on the home page of this website has the dots around the edges, haven't seen this effect before. Can anyone tell me how this is done? Thanks! Robin http://lidosrestaurantpizza.com/index.html

  • F.62 Configure print program

    Hello Experts, I need to modify the data and the layout of transaction F.62 (Print Journal Voucher).  I have searched information from the web that it is possible to add a custom print program to modify the logic.  I would like to ask what is the tra