Pages

Tuesday, 30 April 2013

ALV POPUP DISPLAY REPO

*&---------------------------------------------------------------------*
*& Report  ZR_ALV_POPUP
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZR_ALV_POPUP.
TABLESVBAP.
TYPE-POOLSSLIS.

DATABEGIN OF IT_VBAP OCCURS 10,
     VBELN TYPE VBAP-VBELN,
     POSNR TYPE VBAP-VBELN,
     END OF IT_VBAP.
DATAFC TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

PARAMETERSP_VBELN TYPE VBAP-VBELN.

SELECT FROM VBAP INTO CORRESPONDING FIELDS OF TABLE IT_VBAP WHERE VBELN P_VBELN.

PERFORM FIELDCAT.
PERFORM DISPLAY.

*&---------------------------------------------------------------------*
*&      Form  fieldcat
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM FIELDCAT.

  FC-FIELDNAME 'VBELN'.
  FC-SELTEXT_L 'salse doc no'.
  APPEND FC.
  CLEAR FC.

  FC-FIELDNAME 'POSNR'.
  FC-SELTEXT_L 'salse doc ITEM'.
  APPEND FC.
  CLEAR FC.

ENDFORM.                    "fieldcat

*&---------------------------------------------------------------------*
*&      Form  DISPLAY
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM DISPLAY.
  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
    EXPORTING
*     I_TITLE                       =
*     I_SELECTION                   = 'X'
*     I_ALLOW_NO_SELECTION          =
     I_ZEBRA                       'X'
*     I_SCREEN_START_COLUMN         = 0
*     I_SCREEN_START_LINE           = 0
*     I_SCREEN_END_COLUMN           = 0
*     I_SCREEN_END_LINE             = 0
*     I_CHECKBOX_FIELDNAME          =
*     I_LINEMARK_FIELDNAME          =
*     I_SCROLL_TO_SEL_LINE          = 'X'
      I_TABNAME                     'IT_VBAP'
*     I_STRUCTURE_NAME              =
     IT_FIELDCAT                   FC[]
*     IT_EXCLUDING                  =
*     I_CALLBACK_PROGRAM            =
*     I_CALLBACK_USER_COMMAND       =
*     IS_PRIVATE                    =
*   IMPORTING
*     ES_SELFIELD                   =
*     E_EXIT                        =
    TABLES
      T_OUTTAB                      IT_VBAP
*   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


RESULT:



No comments:

Post a Comment