Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

alv grid double click

Hi;

I am using alv grid in my reports.

And when I double click to alv gird line , I wanna go to next screen or I wanna doing new query then it must go to the next screen.

How can I do this process?

My program type Reports , not moduler program.

Thanks.

Tags:
Former Member
Former Member replied

<b>U need to define User Command for this as follows</b>

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_PF_STATUS_SET       = 'STATUS'
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
        IS_LAYOUT                      = L_LAYOUT
        IT_FIELDCAT                    = IT_FIELDCAT_VBRK
*       IT_EVENTS                      =

       TABLES
         T_OUTTAB                       = IT_VBRK

      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.

    CLEAR GRID.

  ENDIF.


ENDFORM.                    "FIRST_SCREEN_DISPLAY

*&--------------------------------------------------------------------*
*&      Form  STATUS
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->P_EXTAB    text
*---------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.

  SET PF-STATUS 'STATUS' EXCLUDING P_EXTAB.

ENDFORM.                    "STATUS

*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*

FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.

  CASE R_UCOMM.

    WHEN 'BACK' OR 'CANC' OR 'EXIT'.

      LEAVE TO SCREEN 0.

    WHEN '&IC1'.

      IF RS_SELFIELD-FIELDNAME = 'VBELN'.

      LEAVE TO SCREEN 2.


      ENDIF.

  ENDCASE.

ENDFORM.                    "USER_COMMAND

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question