REPORT ZSM_MBLR.
TABLES: MKPF, MSEG.
PARAMETERS: mblnr TYPE mkpf-mblnr,
mjahr TYPE mkpf-mjahr.
TYPES: BEGIN OF str,
mblnr TYPE mkpf-mblnr,
mjahr TYPE mkpf-mjahr,
vgart TYPE mkpf-vgart,
blart TYPE mkpf-blart,
matnr TYPE mseg-matnr,
werks TYPE mseg-werks,
END OF str.
DATA: it TYPE TABLE OF str.
SELECT m1~mblnr, m1~mjahr, m1~vgart, m1~blart, m2~matnr, m2~werks
INTO CORRESPONDING FIELDS OF TABLE @it
FROM mkpf AS m1
INNER JOIN mseg AS m2 ON m1~mblnr = m2~mblnr AND m1~mjahr = m2~mjahr
WHERE m1~mblnr = @mblnr
AND m1~mjahr = @mjahr.
LOOP AT it INTO DATA(str).
WRITE: / str-mblnr, str-mjahr, str-vgart,
str-blart, str-matnr, str-werks.
ENDLOOP.
0 Comments