AI Knowledge Center
Org KBZ-ObjectsZSALES_ORDER_REPORT

ZSALES_ORDER_REPORT

SD

Custom sales order report with enhanced filtering

ZSALES_ORDER_REPORT.abap lines
*----------------------------------------------------------------------*
* Z-Object: ZSALES_ORDER_REPORT
* Description: Custom sales order report with enhanced filtering
* Module: SD
*----------------------------------------------------------------------*
REPORT ZSALES_ORDER_REPORT.

DATA: lv_matnr TYPE matnr,
      lt_mara  TYPE TABLE OF mara,
      ls_mara  TYPE mara.

* Selection Screen
PARAMETERS: p_werks TYPE werks_d OBLIGATORY.

START-OF-SELECTION.
  SELECT * FROM mara INTO TABLE lt_mara
    WHERE mtart = 'FERT'.
  
  LOOP AT lt_mara INTO ls_mara.
    WRITE: / ls_mara-matnr, ls_mara-maktx.
  ENDLOOP.