0% found this document useful (0 votes)
60 views2 pages

Report

This document defines a report that selects and displays data from the MARA table. It defines data types for MARA, allows selection of materials via a selection screen, retrieves matching MARA records into an internal table using a SELECT statement, and outputs the material number, effective date, and created by fields if any records are found. If no records match the selection, an error message is displayed.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views2 pages

Report

This document defines a report that selects and displays data from the MARA table. It defines data types for MARA, allows selection of materials via a selection screen, retrieves matching MARA records into an internal table using a SELECT statement, and outputs the material number, effective date, and created by fields if any records are found. If no records match the selection, an error message is displayed.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

*&---------------------------------------------------------------------

*
*& Report  ZSELECT
*&
*&---------------------------------------------------------------------
*
*&
*&
*&---------------------------------------------------------------------
*

REPORT  ztest.
tables: mara.
TYPES: BEGIN OF ty_mara,
       matnr TYPE matnr,
       ersda TYPE ersda,
       ernam TYPE ernam,
       END OF ty_mara.
types: BEGIN OF ty_mara1,
        matnr TYPE mara-matnr,
        ersda TYPE mara-ersda,
        ernam TYPE mara-ernam,
      END OF ty_mara1.
data: it_mara type STANDARD TABLE OF ty_mara1 INITIAL SIZE 0,
      wa_mara type ty_mara1.

SELECTION-SCREEN: begin of block b1 with frame title text-001.
select-OPTIONS: s_matnr for mara-matnr.
SELECTION-SCREEN: end of block b1.

start-OF-SELECTION.
perform get_data_mara.
end-of-selection.
perform print.

*&---------------------------------------------------------------------
*
*&      Form  get_data_mara
*&---------------------------------------------------------------------
*
*       text
*----------------------------------------------------------------------
*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------
*
form get_data_mara .
select matnr
       ersda
       ernam from mara into table it_mara
       where matnr in s_matnr.
if sy-subrc <> 0.
  message i208(00) with 'No data exist in mara'.
   leave list-processing.
endif.
endform.                    " get_data_mara
*&---------------------------------------------------------------------
*
*&      Form  print
*&---------------------------------------------------------------------
*
*       text
*----------------------------------------------------------------------
*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------
*
form print .
write:/ 'MATNR', '             ERSDA', '     ERNAM'.
loop at it_mara into wa_mara.
write:/ wa_mara-MATNR, wa_mara-ERSDA, wa_mara-ERNAM.
endloop.

endform.                    " print

You might also like