REPORT  ZALV1                                   .

DATA: ITAB LIKE MARD OCCURS 1 WITH HEADER LINE.

PARAMETERS: P_MATNR LIKE MARA-MATNR.

START-OF-SELECTION.
  PERFORM GET_dATA.


END-OF-SELECTION.
  PERFORM SHOW_GRID.

FORM GET_dATA .
  SELECT *
    FROM MARD
    INTO TABLE ITAB
    WHERE MATNR = P_MATNR.
ENDFORM.                    " GET_dATA

FORM SHOW_GRID .

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = 'ZALV1'
      I_STRUCTURE_NAME   = 'MARD'
      I_GRID_TITLE       = 'Material Str Loc Details'
    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.

ENDFORM.                    " SHOW_GRID
 
 
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com