请提供SAP输出物料分类的程序
时间: 2023-05-25 18:06:47 浏览: 178
SAP BOM展开 完整有注释
4星 · 用户满意度95%
以下是SAP输出物料分类的示例程序:
REPORT Z_MM_MAT_CLASS.
TABLES: MARA, T179T.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
WGBEZ LIKE T179T-WGBEZ,
END OF ITAB.
SELECT-OPTIONS:
S_MATNR FOR MARA-MATNR,
S_MATKL FOR MARA-MATKL.
START-OF-SELECTION.
SELECT MARA~MATNR MARA~MATKL T179T~WGBEZ INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM MARA INNER JOIN T179T ON MARA~MTART = T179T~MTART
WHERE MARA~MATNR IN S_MATNR
AND MARA~MATKL IN S_MATKL.
IF ITAB[] IS NOT INITIAL.
WRITE: / 'MATERIAL', 20 'MATERIAL CLASS', 40 'MATERIAL CLASS DESCRIPTION'.
LOOP AT ITAB INTO WA.
WRITE: / WA-MATNR, 20 WA-MATKL, 40 WA-WGBEZ.
ENDLOOP.
ELSE.
WRITE: 'NO DATA FOUND'.
ENDIF.
END-OF-SELECTION.
阅读全文