Code: Alles auswählen.
TYPES: BEGIN OF ty_outtab,
matnr TYPE v_mara_makt-matnr, "Materialnummer
matkl TYPE v_mara_makt-matkl, "Warengruppe
mtart TYPE v_mara_makt-mtart, "Materialart
maktx TYPE v_mara_makt-maktx, "Materialkurztext
meins TYPE v_mara_makt-meins, "Mengeninhalt
werks TYPE marc-werks, "Werk
ekgrp TYPE marc-ekgrp, "Einkaufsgruppe
lbkum TYPE mbew-lbkum, "Gesamter Bestand des Werkes
berid TYPE mdlg-berid, "Dispobereich
period TYPE sy-datum, "Periode für die Bestandsentwicklung
dtnum TYPE mdkp-dtnum, "Nummer Dispoliste
requr TYPE i, "Zugänge
aquis TYPE i, "Abgänge
preis TYPE mbew-verpr, "Preis
netpr TYPE ekpo-netpr, "Höchster Nettopreis (periodenbezogen)
peinh TYPE ekpo-peinh, "Preiseinheit
eomstk TYPE mbew-lbkum, "Bestand Ende des Monats
salk3 TYPE mbew-salk3, "Bestandswert
END OF ty_outtab.
DATA: ls_outtab TYPE ty_outtab,
lt_outtab TYPE TABLE OF ty_outtab,
ls_marc TYPE marc,
lt_marc TYPE TABLE of marc.
*At Selection-screen
SELECTION-SCREEN BEGIN OF BLOCK start WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: so_matnr FOR ls_marc-matnr DEFAULT '30660'.
SELECT-OPTIONS: so_werks FOR ls_marc-werks DEFAULT '2200'.
SELECTION-SCREEN END OF BLOCK start.
*Start of Selection
SELECT matnr, werks, ekgrp FROM marc INTO @ls_outtab
WHERE matnr IN @so_matnr
AND werks IN @so_werks.
ENDSELECT.
SELECT lbkum FROM mbew INTO CORRESPONDING FIELDS OF @ls_outtab
WHERE matnr IN @so_matnr
AND bwkey IN @so_werks.
ENDSELECT.
APPEND ls_outtab TO lt_outtab.
cl_demo_output=>display( lt_outtab ).
Code: Alles auswählen.
*Start of Selection
SELECT matnr werks ekgrp FROM marc INTO CORRESPONDING FIELDS OF ls_outtab
WHERE matnr IN so_matnr
AND werks IN so_werks.
ENDSELECT.
SELECT maktx FROM makt INTO CORRESPONDING FIELDS OF ls_outtab
WHERE matnr IN so_matnr
AND spras = sy-langu.
ENDSELECT.
SELECT lbkum FROM mbew INTO CORRESPONDING FIELDS OF ls_outtab
WHERE matnr IN so_matnr
AND bwkey IN so_werks.
ENDSELECT.
APPEND ls_outtab TO lt_outtab.