Mouse over events on alv report?

Hello,
i want to make mouse over event for rows of a alv report.When mouse is on a row there will be shown explanations.
how can i do this?
thanks inn advance.

Cem ,
Please follow the code mentioned in the links below :
Hotspot in ALV grid
http://wiki.scn.sap.com/wiki/display/Snippets/Interactive?original_fqdn=wiki.sdn.sap.com
Thanks
Ankit

Similar Messages

  • Mouse over event for every word inside a text?

    I want to do a separate mouse over event for every word inside a text.
    or at least get the string below the mouse cursor.
    any hint?
    henry

    There are no events for it but you can use TextField.getCharIndexAtPoint() to determine the character where the mouse is over, and from there you can work out the word where the mouse is over.

  • Mouse Over Event handling - Webdynpro

    Hi,
    We are working on a sample Webdynpro application. We want to show a pop up window on Mouse over of a control. Is this possible in WebDynpro? Do we have a handle for the mouse over event!?
    Kindly help.
    Best Regards,
    Anusha

    hi anusha,
    If it is simply a tooltip that you would like to be displayed then there is a tooltip attribute that can be set when using the HTMLb controls, or the method setTooltip("my tooltip"); when using the APIs. If you need more of a mouse over event, then I would personally use standard HTML instead. You can use the same css classes that are used when creating HTMLb components so that the button would look the same, but it would be more under your own control
    some code snippets are there in this link if you are using bsp.
    Clicking a htmlb:button via Java Script
    thanks
    vishal

  • How to define mouse-over event for a icon

    Hello,
    I have defined a icon for a panel in my plugin. I want that the icon should be changed on mouse over event.
    The code for icon is given below.
    resource PanelList (kDNDListsPaletteResourceID) {
                        // 1st panel in the list
                        kDNDListsPaletteResourceID,                    // Resource ID for this panel (use SDK default rsrc ID)
                        kIBPluginPluginID,                                             // ID of plug-in that owns this panel
              #if CSVER >= 4
                        kIsResizable,
              #else
                        isResizable,
              #endif
                        kIBClientPluginDNDPanelWidgetActionID,          // Action ID to show/hide the panel
                        kIBClientPluginDNDPanelTitleKey,               // Shows up in the Window list.
                        "",                                                           // Alternate menu path of the form "Main:Foo" if you want your palette menu item in a second place
                        0.0,                                                                                     // Alternate Menu position Alternate Menu position for determining menu order
                        kPlusIconPNGIconRsrcID, kIBPluginPluginID,                                                            // Rsrc ID, Plugin ID for a PNG icon resource to use for this palette
                        c_Panel
    Where should I give the resourceID of the other icon?

    Hi
    First change the name from kPlusIconPNGIconRsrcID to kPlusIconPNGIconIRsrcID
    so "I" will indicate that your icon is inactive
    Create another resource id like:
    #define kPlusIconPNGIconIRsrcID 15
    #define kPlusIconPNGIconARsrcID 15
    Define paths to the icons
    resource PNGA(kPlusIconPNGIconIRsrcID) "../res/icons/PLUS_ICO_23_I.png" // Inactive icon
    resource PNGR(kPlusIconPNGIconARsrcID) "../res/icons/PLUS_ICO_23_A.png" // Active icon
    Regards
    Bartek

  • Reg. Events in ALV Reports

    Hi all,
    Can anybody send me the sample program, related to Events on ALV Reports.
    Use ful answers rewards more.

    Hi Raj,
    Here I'm sending 2 programs with user command on grid and list.
    along with interaction and commentory boxes and all.
    separate box ****************
    TABLES: KNA1,VBAK,VBAP.
    TYPE-POOLS: SLIS.
    SELECT-OPTIONS: CUST FOR KNA1-KUNNR.
    DATA: BEGIN OF ITAB OCCURS 0,
          KUNNR LIKE KNA1-KUNNR,
          NAME LIKE KNA1-NAME1,
          LAND1 LIKE KNA1-LAND1,
          END OF ITAB.
    DATA: BEGIN OF JTAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          NETWR LIKE VBAK-NETWR,
          END OF JTAB.
    DATA: BEGIN OF KTAB OCCURS 0,
          POSNR LIKE VBAP-POSNR,
          MATNR LIKE VBAP-MATNR,
          END OF KTAB.
    DATA: REPID LIKE SY-REPID,
    *INTERNAL TABLE AND STRUCTURE.
    *SLIS_T_FIELDCAT_ALV IS AN INTERNAL TABLE.
    *SLIS_FIELDCAT_ALV   IS AN STRUCTURE.
          F_KNA11 TYPE SLIS_T_FIELDCAT_ALV,
          F_KNA1 TYPE SLIS_FIELDCAT_ALV,
          F_VBAK1 TYPE SLIS_T_FIELDCAT_ALV,
          F_VBAK TYPE SLIS_FIELDCAT_ALV,
          F_VBAP1 TYPE SLIS_T_FIELDCAT_ALV,
          F_VBAP TYPE SLIS_FIELDCAT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT,
          S_EVENTS TYPE SLIS_ALV_EVENT.
      PERFORM GET-VAL.
      REPID = SY-REPID.
      SELECT KUNNR NAME1 LAND1 FROM KNA1 INTO TABLE ITAB WHERE KUNNR IN
    CUST
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
         I_CALLBACK_PROGRAM             = REPID
         IT_FIELDCAT                    = F_KNA11
         IT_EVENTS                      = I_EVENTS
        TABLES
          T_OUTTAB                       = ITAB.
    GET VAL
    FORM GET-VAL.
          F_KNA1-FIELDNAME = 'KUNNR'.
          F_KNA1-REF_TABNAME = 'KNA1'.
          F_KNA1-REF_FIELDNAME = 'KUNNR'.
          APPEND F_KNA1 TO F_KNA11.
          F_KNA1-FIELDNAME = 'NAME'.
          F_KNA1-REF_TABNAME = 'KNA1'.
          F_KNA1-REF_FIELDNAME = 'NAME1'.
          APPEND F_KNA1 TO F_KNA11.
          F_KNA1-FIELDNAME = 'LAND1'.
          F_KNA1-REF_TABNAME = 'KNA1'.
          F_KNA1-REF_FIELDNAME = 'LAND1'.
          APPEND F_KNA1 TO F_KNA11.
          F_VBAK-FIELDNAME = 'VBELN'.
          F_VBAK-REF_TABNAME = 'VBAK'.
          F_VBAK-REF_FIELDNAME = 'VBELN'.
          APPEND F_VBAK TO F_VBAK1.
          F_VBAK-FIELDNAME = 'NETWR'.
          F_VBAK-REF_TABNAME = 'VBAK'.
          F_VBAK-REF_FIELDNAME = 'NETWR'.
          F_VBAK-DO_SUM = 'X'.
          APPEND F_VBAK TO F_VBAK1.
          F_VBAP-FIELDNAME = 'POSNR'.
          F_VBAP-REF_TABNAME = 'VBAP'.
          F_VBAP-REF_FIELDNAME = 'POSNR'.
          APPEND F_VBAP TO F_VBAP1.
          F_VBAP-FIELDNAME = 'MATNR'.
          F_VBAP-REF_TABNAME = 'VBAP'.
          F_VBAP-REF_FIELDNAME = 'MATNR'.
          APPEND F_VBAP TO F_VBAP1.
          S_EVENTS-NAME = 'USER_COMMAND'.
          S_EVENTS-FORM = 'VAL'.
          APPEND S_EVENTS TO I_EVENTS.
    ENDFORM.
    FORM VAL USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
    DATA: CUS(10) TYPE N,
          SALNO(10) TYPE N,
          MAT(10) TYPE C.
    display lists
    IF SEL-FIELDNAME = 'KUNNR'.
        CUS = SEL-VALUE.
        SELECT VBELN NETWR FROM VBAK INTO TABLE JTAB WHERE KUNNR = CUS.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
         I_CALLBACK_PROGRAM             = REPID
         IT_FIELDCAT                    = F_VBAK1
         IT_EVENTS                      = I_EVENTS
        TABLES
          T_OUTTAB                       = JTAB.
    ENDIF.
    IF SEL-FIELDNAME = 'VBELN'.
        SALNO = SEL-VALUE.
        SELECT POSNR MATNR FROM VBAP INTO TABLE KTAB WHERE VBELN = SALNO.
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
       I_TITLE                       = ' ITEM DETAILS'
        I_TABNAME                     = VBAP
       IT_FIELDCAT                   = F_VBAP1
       I_CALLBACK_PROGRAM            = REPID
    IMPORTING
       ES_SELFIELD                   = SEL
      TABLES
        T_OUTTAB                      = KTAB.
    ENDIF.
    IF SEL-FIELDNAME = 'MATNR'.
    MAT = SEL-VALUE.
    SET PARAMETER ID 'MAT' FIELD MAT.
    CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDFORM.
    Grid Display ***************
    TYPE-POOLS: SLIS.
    TABLES: KNA1.
    *DATA: ITAB TYPE STANDARD TABLE OF ZJKNA1 WITH HEADER LINE.
    DATA: BEGIN OF ITAB OCCURS 0,
          KUNNR TYPE KUNNR,
          NAME1 TYPE KNA1-NAME1,
          END OF ITAB.
    DATA: JTAB LIKE ITAB OCCURS 0 WITH HEADER LINE.
    DATA: IT_TOP TYPE SLIS_T_LISTHEADER.
    DATA: W_TOP TYPE SLIS_LISTHEADER.
    DATA: IT_EVENT TYPE SLIS_T_EVENT.
    DATA: W_EVENT TYPE SLIS_ALV_EVENT.
    W_EVENT-NAME = 'TOP_OF_PAGE'.
    W_EVENT-FORM = 'TOPS'.
    APPEND W_EVENT TO IT_EVENT.
    W_EVENT-NAME = 'USER_COMMAND'.
    W_EVENT-FORM = 'UCOM'.
    APPEND W_EVENT TO IT_EVENT.
    DATA: S_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *S_LAYOUT-NO_VLINE = 'X'.
    S_LAYOUT-ZEBRA = 'X'.
    S_LAYOUT-NO_COLHEAD = ''.
    S_LAYOUT-TOTALS_ONLY = 'TL'.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: W_LISTHEADER TYPE SLIS_LISTHEADER.
    W_LISTHEADER-TYP = 'H'.
    W_LISTHEADER-KEY = 'THIS IS LIST'.
    APPEND W_LISTHEADER TO IT_LISTHEADER.
    DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: W_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    W_FIELDCAT-COL_POS = 1.
    W_FIELDCAT-FIELDNAME = 'KUNNR'.
    W_FIELDCAT-TABNAME = 'ITAB'.
    W_FIELDCAT-SELTEXT_M = 'CUST. NO'.
    W_FIELDCAT-HOTSPOT = 'X'.
    APPEND W_FIELDCAT TO IT_FIELDCAT.
    CLEAR W_FIELDCAT.
    W_FIELDCAT-COL_POS = 2.
    W_FIELDCAT-FIELDNAME = 'NAME1'.
    W_FIELDCAT-TABNAME = 'ITAB'.
    W_FIELDCAT-SELTEXT_M = 'CUST. NAME'.
    W_FIELDCAT-OUTPUTLEN = 30.
    APPEND W_FIELDCAT TO IT_FIELDCAT.
    CLEAR W_FIELDCAT.
    SELECT KUNNR NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE ITAB
    UP TO 50 ROWS.
    CALL FUNCTION 'REUSE_ALV_GRID_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           = ' '
      I_CALLBACK_TOP_OF_PAGE            = W_LISTHEADER
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = 'ENJOY.BMP'
      I_GRID_TITLE                      = 'THIS IS MY FIRST ALV REPORT'
      I_GRID_SETTINGS                   = W_LISTHEADER
       IS_LAYOUT                         = S_LAYOUT
       IT_FIELDCAT                       = IT_FIELDCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
       IT_EVENTS                         = IT_EVENT
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = ITAB
    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.
    **&      Form  TOPS
          text
    -->  p1        text
    <--  p2        text
    FORM TOPS .
    REFRESH IT_TOP.
    W_TOP-TYP = 'H'.
    *W_TOP-KEY = 'JAGAN'.
    W_TOP-INFO = 'THIS IS SAMPLE HEADER'.
    APPEND W_TOP TO IT_TOP.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
       IT_LIST_COMMENTARY       = IT_TOP
       I_LOGO                   = 'IDLOGO1'
      I_END_OF_LIST_GRID       =
    ENDFORM.                    " TOPS
    *&      Form  UCOM
          text
    -->  p1        text
    <--  p2        text
    FORM UCOM USING USER_COMMAND LIKE SY-UCOMM SEL TYPE SLIS_SELFIELD.
    DATA: CUS(10) TYPE N VALUE '0000000000'.
    CUS = SEL-VALUE.
    REFRESH ITAB.
    SELECT KUNNR NAME1 FROM KNA1 INTO TABLE ITAB WHERE KUNNR = CUS.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
         I_CALLBACK_PROGRAM             = SY-REPID
         IT_FIELDCAT                    = IT_FIELDCAT
        IT_EVENTS                      = IT_EVENTS
        TABLES
          T_OUTTAB                       = ITAB.
    ENDFORM.                    " UCOM

  • Does Flash Engine supports "Mouse Over" events on an Android device with a mouse?

    We built our custome Android on a Beagle Board. When we play a Flash content on WebKit, the flash does not respond to mouse over events.
    When mouse pointer comes on an object with mouse over effect, nothing happends.
    Can you confirm that there is Mouse Over support in Android 2.2 Flash Engine?
    Thanks in Advance

    Thanks for the link. Im just stuck on one issue right now. I
    quickly noticed that the samples make use of mx.transitions.easing
    as seen in the script below. How does Flash 8 address this?
    myButton_btn.onRelease = function() {
    tweenBall(mx.transitions.easing.Bounce.easeOut);
    function tweenBall(easeType) {
    var begin = 20;
    var end = 380;
    var time = 20;
    var mc = ball_mc;
    ballTween = new mx.transitions.Tween(mc, "_x", easeType,
    begin, end, time);

  • Mouse Over event not dispatching properly.

    Hi,
    I am working on a scroll for iPhone, in which I'm using touch scrolling, it is working fine with less number of list items, but when I increases the nuber of items in scroll list, the mouse over event not propogates properly, I mean to say those events are overlapping due to some extra memory issue, can any one have any idea about it.
    I'm pasting code for your reference :
    public function IPhoneScroll( pContent:DisplayObjectContainer, pStage:Stage ) {
                                  _stage = pStage;
                                  _myScrollElement = pContent;
                                  _canvasHeight = _myScrollElement.height;
                                  start();
                                  // add handlers
                                  _myScrollElement.addEventListener(MouseEvent.MOUSE_DOWN, on_mouse_down);
                                  _myScrollElement.addEventListener(Event.ENTER_FRAME, on_enter_frame);
                        private function on_enter_frame(e:Event):void {
                                  if ( started )
                                            // decay the velocity
                                            if(_mouseDown) _velocity *= MOUSE_DOWN_DECAY;
                                            else _velocity *= DECAY;
                                            // if not mouse down, then move the element with the velocity
                                            if (!_mouseDown)
                                                      var textHeight:Number = _myScrollElement.height;
                                                      var y:Number = _myScrollElement.y;
                                                      var bouncing:Number = 0;
                                                      // calculate a bouncing when the text moves over the canvas size
                                                      if (y > 0 || textHeight <= _canvasHeight) // textHeight <= _canvasHeight => when the item is smaller than the stage.height, align to the top
                                                                bouncing = -y * BOUNCING_SPRINGESS;
                                                      }else if( y + textHeight < _canvasHeight){
                                                                bouncing = (_canvasHeight - textHeight - y) * BOUNCING_SPRINGESS;
                                                      _myScrollElement.y = y + _velocity + bouncing;
                        // when mouse button up
            private function on_mouse_down(e:MouseEvent):void
                if (!_mouseDown)
                    // get some initial properties
                    _mouseDownPoint = new Point(e.stageX, e.stageY);
                    _lastMouseDownPoint = new Point(e.stageX, e.stageY);
                    _mouseDown = true;
                    _mouseDownY = _myScrollElement.y;
                                            // add some more mouse handlers
                    _stage.addEventListener(MouseEvent.MOUSE_UP, on_mouse_up);
                    _stage.addEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
            // when mouse is moving
            private function  on_mouse_move(e:MouseEvent):void
               if (_mouseDown)
                    // update the element position
                    var point:Point = new Point(e.stageX, e.stageY);
                    _myScrollElement.y = _mouseDownY + (point.y - _mouseDownPoint.y);
                    // update the velocity
                    _velocity += ((point.y - _lastMouseDownPoint.y) * SPEED_SPRINGNESS);
                    _lastMouseDownPoint = point;
            // clear everythign when mouse up
            private function  on_mouse_up(e:MouseEvent):void
                if (_mouseDown)
                    _mouseDown = false;
                    _stage.removeEventListener(MouseEvent.MOUSE_UP, on_mouse_up);
                    _stage.removeEventListener(MouseEvent.MOUSE_MOVE, on_mouse_move);
                        public function release():void
                                  _myScrollElement.removeEventListener(MouseEvent.MOUSE_DOWN, on_mouse_down);
                                  _myScrollElement.removeEventListener(Event.ENTER_FRAME, on_enter_frame);
                                  _myScrollElement = null;
    The highlighted part is working properly for less items but not for more number of items, lets say 200 movieclips in scroll lists.
    Please help me on this, thanks in advance.
    Vipul

    Hello.
    Look I have an idea, I donu2019t know if you already try it.
    Please give the format that you want percentage, decimals etc...
    In the Excel where the charts are being directed
    Then redirect de chart to the same cells, these with the porpoise of refreshing
    Now each serie have the format.
    Please let me now what happen with these

  • Mouse over event

    Hello,
    I have two objects. First object (1) has event listener
    MOUSE_OVER. On this object is another object (2) without listener.
    When I move with the mouse on second object, mouse over event on
    object 1 is not dispatched. I don't know why. How can I do it ??
    thanks

    If both objects are in a VBox, with the second object (no
    listener) overlapping the first object (has listener), when you
    hover over second object, if you have a listener on the container
    you should be able to see if the target for the event is the second
    object and then take action.
    This is because events first "cascade" down from the top of
    the display list, through all containers until they reach the
    target (targetting phase), and then they bubble back up to the top
    of the display list (bubling phase).

  • What are events in ALV report and explain how sorting is done  alv report

    events in alv report and sorting in alv report
    Moderator Message: Search before posting.
    Edited by: kishan P on Dec 21, 2011 11:13 AM

    Hi Raja,
    <<content and links removed by moderator>>
    PavanKumar.G
    Edited by: kishan P on Dec 21, 2011 11:12 AM

  • End-of-page event in alv report

    Hi all,
    I want to create end-of-page in alv report i have used event also
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' * "
       EXPORTING *
         i_callback_program                = sy-repid * "
         i_callback_user_command           = 'USER_COMMAND' * "
         i_callback_top_of_page            = 'TOP_OF_PAGE' * "
       I_STRUCTURE_NAME                  = * "
         it_fieldcat                       = fcat[] * "
         it_events                         = it_event[] * "
        TABLES
          t_outtab                          = gtbl_pohead * "
       EXCEPTIONS
         program_error                     = 1 * "
         OTHERS                            = 2 "
    FORM end_of_page.  *
      DATA:   listwidth TYPE i, *
              ld_pagepos(10) TYPE c, *
              ld_page(10)    TYPE c. *
      WRITE: sy-uline(50). "
      SKIP 3.
      WRITE:/40 'Page No',sy-pagno. "
    ENDFORM.                    "END_OF_PAGE "

    hi
    Search in SDN.You can find the solution for this.Before posting please search in SDN.
    You have to use this  FM 'REUSE_ALV_EVENTS_GET'
    [End-Of-Page|http://www.sapdev.co.uk/reporting/alv/alvgrid_events.htm]
    [Endo Of Page|http://www.sdn.sap.com/irj/scn/advancedsearch?query=alvend-of-pageevent+]

  • End of Page event in ALV report using SALV class[cl_salv_hierseq_table]

    Hi ,
    have been working on a ALV report using the class SALV cl_salv_hierseq_table
    I am facing few issues pertaining to two things:
    1. Displaying some subtotal text along with the subtotals.
    Example refer the standard demo example: SALV_DEMO_HIERSEQ_FORM_EVENTS
    Now instead of A 17 and A26 I would like to show text like Subtotal for the Carrid.for subtotals and grand totals
    Like   Subtotal for A 17 is :      XXXXXXX
              GrandTotal is         :      YYYYYY
    2. We have a page break and a new page for every purchasing group as in the standard example SALV_DEMO_HIERSEQ_FORM_EVENTS for CARRID.
    I need to display some variable values as number of documents ,total number of records etc at the end of each CARRID group before a new page starts for the next CARRID.Please note i do not want it on every page.it should only be diaplyed at the end of page whose next page would be for next CARRID.[basically at end of every carrid]Example:after displaying all details for AA need to display the number of records for that carrid at the end of the page[as page break is based on CARRID]/
    Thanks
    Jyotsna

    at end of page event, for CL_SALV_EVENTS_HIERSEQ, has some useful parameters allowing to know where you are at the time of event
    parameter VALUE is of type CL_SALV_FORM which contains public attribute IF_SALV_FORM~ACCDESCRIPTION; you can slo get contents of it
    about text of total/subtotal, this is normally set in the layout

  • Events in Alv Report

    Hi experts,
    Can anyone brief me about events which appears in an ALV report.
    I want the events only for Alv report not for any report program.
    Thanks
    Sanket sethi.

    Hi Sanket,
    <b>ALV is Application List viewer.</b>
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
    The report output can contain up to 90 columns in the display with the wide array of display options.
    The commonly used ALV functions used for this purpose are;
    <b>1. REUSE_ALV_VARIANT_DEFAULT_GET
    2. REUSE_ALV_VARIANT_F4
    3. REUSE_ALV_VARIANT_EXISTENCE
    4. REUSE_ALV_EVENTS_GET
    5. REUSE_ALV_COMMENTARY_WRITE
    6. REUSE_ALV_FIELDCATALOG_MERGE
    7. REUSE_ALV_LIST_DISPLAY
    8. REUSE_ALV_GRID_DISPLAY
    9. REUSE_ALV_POPUP_TO_SELECT</b>
    Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
    But either no.7 or No.8 is there in the Program.
    How you call this function in your report?
    After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
    Then use follwing function module.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM       = 'Prog.name'
                I_STRUCTURE_NAME         = 'I_ITAB'
                I_DEFAULT                = 'X'
                I_SAVE                   = 'A'
           TABLES
                T_OUTTAB                 = I_ITAB.
      IF SY-SUBRC <> 0.
        WRITE: 'SY-SUBRC: ', SY-SUBRC .
      ENDIF.
    ENDFORM.                    " GET_FINAL_DATA
    Sample ALV1:
    REPORT Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB .
    *Simple example to use ALV and to define the ALV data in an internal
    *table
    Martin Schlegel, BearingPoint, December 2004
    Thanks to Madhusudhan Sonee and Rama Krishna Kommineni for testing
    and feedback
    *For a very long time, people gave me the feeling that ALV is a
    *complicated tool that is difficult to understand and to use.
    *Lately I had to use it and I discovered that ALV is easy to use and
    *saves a lot of work:
    *ALV will generate the column headings on its own, so one does not need
    *to work on headlines and transalation.
    *ALV allows the user to select the columns he wants to see, so the user
    *does not need to contact a developer for every change he likes to have.
    *ALV allows the user to create his own sums, so …
    *ALV has a simple way to work with internal tables.
    *If you really want to save time, use ALV instead of write!
    *Please take 30 minutes to explore the following example and see how
    *easy it is to use ALV!
    *data definition
    tables:
    marav. "Table MARA and table MAKT
    Data to be displayed in ALV
    Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
                            " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
                            "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    Other data needed
    field to store report name
    data i_repid like sy-repid.
    field to check table length
    data i_lines like sy-tabix.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    read data into table imat
      select * from marav
      into corresponding fields of table imat
      where
      matnr in s_matnr.
    Check if material was found
      clear i_lines.
      describe table imat lines i_lines.
      if i_lines lt 1.
      Using hardcoded write here for easy upload
        write: /
        'No materials found.'.
        exit.
      endif.
    end-of-selection.
    Now, we start with ALV
    To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    The fieldcatalouge can be generated by FUNCTION
    'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    report source, including this report.
    The only problem one might have is that the report and table names
    need to be in capital letters. (I had it )
    Store report name
      i_repid = sy-repid.
    Create Fieldcatalogue from internal table
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = i_repid
                I_INTERNAL_TABNAME     = 'IMAT'  "capital letters!
                I_INCLNAME             = i_repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    *explanations:
       I_PROGRAM_NAME is the program which calls this function
       I_INTERNAL_TABNAME is the name of the internal table which you want
                          to display in ALV
       I_INCLNAME is the ABAP-source where the internal table is defined
                  (DATA....)
         CT_FIELDCAT contains the Fieldcatalouge that we need later for
         ALV display
      IF SY-SUBRC <> 0.
        write: /
        'Returncode',
        sy-subrc,
        'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
      ENDIF.
    *This was the fieldcatlogue
    And now, we are ready to display our list
    Call for ALV list display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
               I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'
                I_CALLBACK_PROGRAM = i_repid
                IT_FIELDCAT        = int_fcat
                I_SAVE             = 'A'
           TABLES
                T_OUTTAB           = imat
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
    *explanations:
       I_CALLBACK_PROGRAM is the program which calls this function
       IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains
                    now the data definition needed for display
       I_SAVE allows the user to save his own layouts
         T_OUTTAB contains the data to be displayed in ALV
      IF SY-SUBRC <> 0.
        write: /
        'Returncode',
        sy-subrc,
        'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
      ENDIF.
    Samle ALV2:
    *& Report  ZZ_22038_22098_002                                          *
    *& This is an Interactive ALV report, where on line slection we can see
    *&  the secondry list
    REPORT  ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
    MESSAGE-ID ZZ_9838                      .
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
          I_VARIANT1 TYPE DISVARIANT,
          I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
      V_REPID = SY-REPID.
      PERFORM BUILD_FIELDCATLOG.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATLOG
          Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'AEDAT'.
      WA_FIELDCAT-SELTEXT_M = 'DATE.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'LIFNR'.
      WA_FIELDCAT-NO_OUT    = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  EVENT_CALL
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    EXCEPTIONS
       LIST_TYPE_WRONG       = 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.
    ENDFORM.                    "EVENT_CALL
    *&      Form  POPULATE_EVENT
         Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    *&      Form  data_retrieval
      retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM.                    "data_retrieval
    *&      Form  bUild_listheader
          text
         -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
      DATA HLINE TYPE SLIS_LISTHEADER.
      HLINE-INFO = 'this is my first alv pgm'.
      HLINE-TYP = 'H'.
    ENDFORM.                    "build_listheader
    *&      Form  display_alv_report
          text
    FORM DISPLAY_ALV_REPORT.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_GRID_TITLE                      = I_TITLE_EKKO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         = ALV_LAYOUT
         IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
        i_default                         = 'ZLAY1'
         I_SAVE                            = 'A'
        is_variant                        = i_variant
         IT_EVENTS                         = V_EVENTS
        TABLES
          T_OUTTAB                          = IT_EKKO
    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.
    ENDFORM.                    "display_alv_report
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_EKPO
          text
    FORM BUILD_FIELDCATLOG_EKPO.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELP'.
      WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MENGE'.
      WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-SELTEXT_M = 'UOM'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'NETPR'.
      WA_FIELDCAT-SELTEXT_M = 'PRICE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
    *&      Form  event_call_ekpo
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
    ENDFORM.                    "event_call_ekpo
    *&      Form  POPULATE_EVENT
           Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      ENDFORM.                    "POPULATE_EVENT
    *&      Form  TOP_OF_PAGE
          text
    FORM F_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = I_TITLE_EKPO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         =
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = V_EVENTS
      TABLES
        T_OUTTAB                          = IT_EKPO
    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.
    ENDFORM.
    <b>Reward Points if Useful</b>
    Regards
    Gokul

  • About double click event in ALV report

    Hi all,
    I want to program a double-click event in ALV reprot.
    I am not suppose to use module pool approach for the same.
    If a user double clicks on the any of the row of ALV report, the transaction should get called.
    Again, I am using function 'REUSE_ALV_GRID_DISPLAY' for displaying ALV.
    Can you please help me to solve this?
    Thanks,
    -Siddhi

    Hi Sidhi,
    You can do it easily by using Reuse_ALV_GRID_DISPALY.
    The User Command subroutine which you pass to this function module in that you can check which field is selected and what is the value of that and also you can get the table index.
    I am giving you a code example where interactivity of ALV report is done .
    *& Report  ZRAIL_LOT_REPORT
    REPORT  zrail_lot_report.
    TABLES :qals,aufk.
    TYPE-POOLS:slis.
    TYPES:BEGIN OF x_lot,
          sel(1)   TYPE c,                    "SELECTION
          prueflos TYPE qals-prueflos,        "INSPECTION LOT NUMBER
          werk     TYPE qals-werk,            "PLANT
          losmenge TYPE qals-losmenge,        "LOT QUANTITY
          mengeneinh TYPE qals-mengeneinh,   "BASE UNIT OF MEASURE FOR THE INSPECTION LOT QUANTITY
          matnr   TYPE  qals-matnr,          " MATERIAL NO. ATTACHED TO ORDER
          zzequnr  TYPE qals-zzequnr,         "EQUIPMENT NO.
          zzassembly TYPE qals-zzassembly,    "ASSEMBLY
          herkunft  TYPE qals-herkunft,       "INSPECTION LOT ORIGIN
          aufnr     TYPE qals-aufnr,          "ORDER NO.
          sttxt     TYPE qals_d02-sttxt,      "LOT STATUS
          objnr     TYPE qals-objnr,          "OBJECT NUMBER
          enstehdat TYPE qals-enstehdat,      "lot creation date
          pruefer   TYPE qamr-pruefer,        "Name of the Inspector
          END OF x_lot.
    TYPES:BEGIN OF x_ordmat,
          aufnr TYPE aufk-aufnr,             "Order No.
          equnr TYPE afih-equnr,             "Equipment No. attached to Order
          zmatnr TYPE aufk-zmatnr,           "Material No. attached to Order
          bautl  TYPE afih-bautl,            "Assembly attached to Order
          END OF x_ordmat.
    TYPES:BEGIN OF x_status,
          objnr TYPE jest-objnr,
          stat  TYPE jest-stat,
          txt04 TYPE tj02t-txt04,
          END OF x_status.
    DATA:it_qals TYPE STANDARD TABLE OF x_lot,
         wa_qals TYPE x_lot.
    DATA:it_ordmat TYPE TABLE OF x_ordmat,
         wa_ordmat TYPE x_ordmat.
    DATA:it_status TYPE STANDARD TABLE OF x_status,
         wa_status TYPE x_status.
    DATA:mytabix TYPE sy-tabix.
    DATA: wa_layout   TYPE slis_layout_alv,
          wa_fieldcat TYPE slis_fieldcat_alv,
          it_fieldcat TYPE TABLE OF slis_fieldcat_alv,
          it_fcat TYPE TABLE OF slis_fieldcat_alv.
    DATA:mytabix1 TYPE sy-tabix.
    SELECTION-SCREEN BEGIN OF BLOCK  b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_werks FOR qals-werk,
                    s_zmatnr FOR aufk-zmatnr,
                    s_assbly FOR qals-zzassembly,
                    s_equnr FOR qals-zzequnr,
                    s_lotor FOR qals-herkunft,
                    s_lotdat FOR qals-enstehdat.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      s_lotdat-low = sy-datum - 7.
      s_lotdat-high = sy-datum.
      APPEND s_lotdat.
    START-OF-SELECTION.
      PERFORM get_data_qals.
      PERFORM build_fieldcat.
      PERFORM display_data.
      EXIT.
    END-OF-SELECTION.
    *&      Form  get_data_qals
          text
    -->  p1        text
    <--  p2        text
    FORM get_data_qals .
      IF it_qals[] IS INITIAL.
        SELECT a~prueflos
               a~werk
               a~losmenge
               a~mengeneinh
               a~zzequnr
               a~zzassembly
               a~herkunft
               a~aufnr
               a~objnr
               a~matnr
               a~enstehdat
               b~pruefer
               FROM qals AS a INNER JOIN qamr AS b
               ON aprueflos = bprueflos
               INTO CORRESPONDING FIELDS OF TABLE it_qals
               WHERE werk IN s_werks
               AND   zzassembly IN s_assbly
               AND   zzequnr    IN s_equnr
               AND   herkunft   IN s_lotor
               AND   enstehdat  IN s_lotdat.
      ENDIF.
      IF it_ordmat[] IS INITIAL.
        SELECT a~aufnr
               a~zmatnr
               b~bautl
               b~equnr
               FROM aufk AS a INNER JOIN afih AS b
               ON aaufnr = baufnr
               INTO CORRESPONDING FIELDS OF TABLE it_ordmat FOR ALL ENTRIES IN it_qals
               WHERE a~aufnr = it_qals-aufnr
                AND zmatnr IN s_zmatnr.
      ENDIF.
      IF it_status[] IS INITIAL.
        SELECT a~objnr
               a~stat
               b~txt04
               FROM  tj02t AS b
               INNER JOIN jest AS a ON bistat = astat
               INTO CORRESPONDING FIELDS OF TABLE it_status FOR ALL ENTRIES IN it_qals
               WHERE a~objnr = it_qals-objnr
               AND   b~spras = sy-langu
               AND   a~inact = space.
      ENDIF.
      LOOP AT it_qals INTO wa_qals.
        mytabix = sy-tabix.
        READ TABLE it_ordmat INTO wa_ordmat WITH KEY aufnr = wa_qals-aufnr.
        IF sy-subrc = 0.
          IF wa_qals-herkunft = '14'.
            wa_qals-matnr = wa_ordmat-zmatnr.
            wa_qals-zzequnr =  wa_ordmat-equnr.
            wa_qals-zzassembly = wa_ordmat-bautl.
            MODIFY it_qals FROM wa_qals INDEX  mytabix TRANSPORTING matnr zzassembly zzequnr.
          ENDIF.
        ENDIF.
        LOOP AT it_status INTO wa_status WHERE objnr = wa_qals-objnr.
          CONCATENATE wa_qals-sttxt wa_status-txt04 INTO wa_qals-sttxt SEPARATED BY space.
          CLEAR :wa_status.
        ENDLOOP.
        MODIFY it_qals FROM wa_qals INDEX  mytabix TRANSPORTING sttxt.
        CLEAR :wa_qals,wa_ordmat,mytabix.
      ENDLOOP.
      IF s_zmatnr[] IS NOT INITIAL.
        DELETE it_qals WHERE matnr IS INITIAL.
      ENDIF.
    ENDFORM.                    " get_data_qals
    *&      Form  build_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat .
      wa_layout-zebra = 'X'.
      wa_layout-colwidth_optimize = 'X'.
      wa_layout-box_fieldname = 'SEL'.
      wa_layout-box_tabname = 'IT_QALS'.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
        I_PROGRAM_NAME               =
          i_internal_tabname           = 'IT_QALS'
          i_structure_name             = 'QALS_D02'
        I_CLIENT_NEVER_DISPLAY       = 'X'
        I_INCLNAME                   =
        I_BYPASSING_BUFFER           =
        I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = it_fieldcat
      IF sy-subrc = 0.
        LOOP AT  it_fieldcat INTO wa_fieldcat.
          CASE  wa_fieldcat-fieldname .
            WHEN  'PRUEFLOS'.
              wa_fieldcat-col_pos = 1.
              wa_fieldcat-hotspot = 'X'.
              APPEND wa_fieldcat TO it_fcat.
            WHEN   'WERK'.
              wa_fieldcat-col_pos = 3.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'LOSMENGE'.
              wa_fieldcat-col_pos = 4.
              wa_fieldcat-no_out = ''.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'MENGENEINH'.
              wa_fieldcat-col_pos = 5.
              wa_fieldcat-no_out = ''.
              APPEND wa_fieldcat TO it_fcat.
            WHEN 'ZZEQUNR'.
              wa_fieldcat-col_pos = 6.
              wa_fieldcat-no_out = ''.
              wa_fieldcat-hotspot = 'X'.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'ZZASSEMBLY'.
              wa_fieldcat-col_pos = 7.
              wa_fieldcat-no_out = ''.
              wa_fieldcat-hotspot = 'X'.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'HERKUNFT'.
              wa_fieldcat-col_pos = 8.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'AUFNR'.
              wa_fieldcat-col_pos = 9.
              wa_fieldcat-hotspot = 'X'.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'ENSTEHDAT'."enstehdat
              wa_fieldcat-col_pos = 10.
              APPEND wa_fieldcat TO it_fcat.
            WHEN  'STTXT'.
              wa_fieldcat-col_pos = 12.
              wa_fieldcat-hotspot = 'X'.
              APPEND wa_fieldcat TO it_fcat.
            WHEN OTHERS.
          ENDCASE.
          CLEAR wa_fieldcat.
        ENDLOOP.
        wa_fieldcat-fieldname = 'MATNR'.
        wa_fieldcat-tabname  =  'IT_QALS'.
        wa_fieldcat-col_pos = 2.
        wa_fieldcat-ref_tabname = 'AUFK'.
        wa_fieldcat-hotspot = 'X'.
        wa_fieldcat-seltext_l = 'Material No.'.
        APPEND wa_fieldcat TO it_fcat.
        wa_fieldcat-fieldname = 'PRUEFER'.
        wa_fieldcat-tabname  =  'IT_QALS'.
        wa_fieldcat-col_pos = 11.
        wa_fieldcat-ref_tabname = 'QAMR'.
        wa_fieldcat-seltext_l = 'Name of the Inspector'.
        APPEND wa_fieldcat TO it_fcat.
      ENDIF.
    ENDFORM.                    " build_fieldcat
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
       i_callback_program                = 'ZRAIL_LOT_REPORT'
      I_CALLBACK_PF_STATUS_SET          = ' '
         i_callback_user_command           = 'USER_COMMAND'
         is_layout                         = wa_layout
          it_fieldcat                       = it_fcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
        TABLES
          t_outtab                          = it_qals
    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.
    ENDFORM.                    " display_data
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM user_command USING r_ucomm TYPE sy-ucomm  rs_selfield TYPE slis_selfield.
      CASE rs_selfield-fieldname  .
        WHEN 'PRUEFLOS'.
          SET PARAMETER ID 'QLS' FIELD rs_selfield-value.
          CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
        WHEN 'ZZEQUNR'.
          SET PARAMETER ID 'EQN' FIELD  rs_selfield-value.
          CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
        WHEN 'ZMATNR'.
          SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
          CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
        WHEN 'ZZASSEMBLY'.
          SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
          CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
        WHEN 'AUFNR'.
          SET PARAMETER ID 'ANR' FIELD rs_selfield-value.
          CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
        WHEN 'STTXT'.
          MOVE rs_selfield-tabindex TO mytabix1.
          PERFORM show_status.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    *&      Form  show_status
          text
    -->  p1        text
    <--  p2        text
    FORM show_status .
      DATA:it_systat TYPE TABLE OF bapi2045ss,
           wa_sysstat TYPE bapi2045ss,
           it_bapi2045us TYPE TABLE OF bapi2045us.
      DATA:it_fsys TYPE TABLE OF slis_fieldcat_alv.
      DATA:insplot TYPE bapi2045d_il0-insplot.
      DATA:language TYPE bapi2045la.
      CLEAR wa_qals.
      READ TABLE it_qals INTO wa_qals INDEX mytabix1.
      insplot = wa_qals-prueflos.
      language-langu = sy-langu.
      CALL FUNCTION 'BAPI_INSPLOT_GETSTATUS'
        EXPORTING
          number        = insplot
          language      = language
        TABLES
          system_status = it_systat
          user_status   = it_bapi2045us.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = 'ZRAIL_LOT_REPORT'
          i_internal_tabname = 'IT_SYSTAT'
          i_structure_name   = 'BAPI2045SS'
        CHANGING
          ct_fieldcat        = it_fsys.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZRAIL_LOT_REPORT'
          it_fieldcat        = it_fsys
        TABLES
          t_outtab           = it_systat.
    ENDFORM.                    " show_status
    IIn the subrouitne the User command the Parameter rs_selfield will give you the selected or clicked field and its value its record no .
    I hope this will help you.

  • Pop Up Text in an applet on mouse over event

    Can anyone help me to design a pop up text message to be displayed in an applet on moving your mouse over a particular control. Plz. Its urgent

    To show a pop-up use javax.swing.Popup. Add a mouse listener to button. When mouse enters the button pop-up shows and when mouse exited the button, pop-up disappears. This pop-up is capable of displaying simple message to any swing component. Sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * @author mrityunjoy_saha
    * @version 1.0
    public class AppletWithPopup extends JApplet {
        private Popup popup;
        private JButton button;
        private JLabel message;
        @Override
        public void init() {
            setLayout(new FlowLayout());
            button = new JButton("Hello");
            message = new JLabel("This is a JLabel. It can be any swing component.");
            button.addMouseListener(new MyMouseListener());
            add(button);
        private class MyMouseListener extends MouseAdapter {
            @Override
            public void mouseEntered(MouseEvent e) {
                System.out.println("Mouse entered.");
                PopupFactory factory = PopupFactory.getSharedInstance();
                popup = factory.getPopup(AppletWithPopup.this, message, (int) button.getLocationOnScreen().
                        getX() - 20, (int) button.getLocationOnScreen().getY() + 40);
                //popup = factory.getPopup(AppletWithPopup.this, message, 50, 10);
                popup.show();
            @Override
            public void mouseExited(MouseEvent e) {
                System.out.println("Mouse exited.");
                if (popup != null) {
                    popup.hide();
    }If you are talking about alert box (where some message can be displayed), in above example instead of javax.swing.Popup use javax.swing.JOptionPane. In case you are using JOptionPane, make it visible in mouseEntered() method and hide it in mouseExited() method.
    Thanks,
    Mrityunjoy

  • Mouse over event listener? in Flash CS4 (AS3)

    Hi,
    I was wondering if there is such a thing as a mouse over listener.
    So that it would execute code when the mouse rolls over(and maybe also execute code when the mouse moves away again)
    Thank you for any help.

    yes, there are mouseover and rollover events, as well as, their "out" events:
    MouseEvent.MOUSE_OVER
    MouseEvent.ROLL_OVER

Maybe you are looking for

  • IPC in Java

    Hi Guys, I am new to CRM ISA 7.0 and I need to learn how the pricing is done through Java. Could you please suggest me some documents & some practical guide with examples or something like that through which I can learn the IPC. I am using NWDS for t

  • Do I need to set AI colour profiles for use in ID?

    My previous set up: Mac CS2 (Illustrator, Photoshop, Bridge) Quark XPress 7 My new set up: PC (Win 7) CS5 (Illustrator, Photoshop, Bridge, InDesign) My problem: I work for a company that prints newspapers, but my dept also does work for glossy sheetf

  • Installing CCB 2.3.1 on Windows 2008 R2 Standards 64 bit Edition Error

    i Installed the Micro Focus Server v5.1 and java 1.6._23 build , Activer Perl 64 all are 64 bit software, all software are installed. When i run the CCB server i am getting the follwing Exception this is one Exceptio 1. C:\opt\MicroFocus\Bin\CBLJVM_S

  • 7.0 data flow to 3.x dataflow :(

    I'm curious to see if there are others who are in my situation and want to know how they are coping with it, I have been on 7.0 dataflow from 2005 as part of a ramp up customer and have been on it since then. Now I moved to a new project and this cus

  • GetFileNameBean for file adapters

    I've created a adapter module to get file name and to update o/p stream with this filename - as per How to create modules pdf file. I ran into this OSS note - 819761 which says the following "<b>Important: Please note that the file name information i