method GET_DATA .

DATA : lw_header TYPE YSTA_FARI_MM1,
       lv_counter TYPE i.

*Collect Master Material
  SELECT matnr matkl bismt meins
  INTO CORRESPONDING FIELDS OF TABLE DATA
  FROM mara
  WHERE matkl = gv_matkl
  OR matnr = gv_matnr.

*Get Other Requirement Information
  LOOP AT DATA INTO lw_header.
*Max ROW Checking
    ADD 1 TO lv_counter.
    IF lv_counter <= gv_max_row OR gv_max_row = 0.
      WRITE / lw_header-matkl.
      WRITE lw_header-matnr.
      WRITE lw_header-maktx.
      WRITE lw_header-bismt.
      WRITE lw_header-meins.
      WRITE lw_header-mseht.
    ENDIF.

  ENDLOOP.


endmethod.