Code: Alles auswählen.
TYPES: BEGIN OF gt_mard.
INCLUDE STRUCTURE mard.
TYPES:
maktx TYPE makt-maktx,
END OF gt_mard.
DATA: gt_tabmard TYPE TABLE OF gt_mard,
gs_tabmard TYPE gt_mard.
SELECT mard~werks mard~lgort mard~matnr makt~maktx mard~labst
INTO CORRESPONDING FIELDS OF TABLE gt_tabmard
FROM mard JOIN makt ON mard~matnr = makt~matnr.
PARAMETERS: werk TYPE mard-werks,
lager TYPE mard-lgort,
mat-nr TYPE mard-matnr.
WRITE: 'Werk', 20 'Lager', 40 'Mat-Nr.', 60 'Material', 90 'Bestand'.
SKIP.
LOOP AT gt_tabmard INTO gs_tabmard.
WRITE:/ gs_tabmard-werks, 20 gs_tabmard-lgort, 40 gs_tabmard-matnr, 60 gs_tabmard-maktx , 90 gs_tabmard-labst LEFT-JUSTIFIED.
AT NEW matnr.
NEW-LINE.
ENDAT.
AT END OF matnr.
SUM.
NEW-LINE.
WRITE: 60 'Lagerbestand:' , 90 gs_tabmard-labst LEFT-JUSTIFIED.
ENDAT.
ENDLOOP.
Code: Alles auswählen.
makt~spras = sy-langu
Code: Alles auswählen.
WHERE mard~werks = werk
AND mard~lgort = lager
*-- usw
Code: Alles auswählen.
START-OF-SELECTION.