Code: Alles auswählen.
TYPES: BEGIN OF kd_preise2,
HIENR TYPE kunnr,
name1 TYPE name1,
kunnr TYPE kunnr,
nameh TYPE name1,
matnr TYPE matnr,
maktx TYPE maktx,
kbetr LIKE konp-kbetr,
kpein TYPE kpein,
kmein TYPE kmein,
meins TYPE meins,
END OF kd_preise2.
DATA: zkdp2_s TYPE kd_preise2,
zkdp2_t TYPE TABLE OF kd_preise2.
SELECT A065~MATNR KNA1~NAME1 KONP~KBETR KONP~KMEIN KONP~KPEIN MARA~MEINS A065~HIENR MAKT~MAKTX KNVH~KUNNR KNVH~HKUNNR KNA_H~NAME1 as NAMEH INTO CORRESPONDING FIELDS OF TABLE ZKDP2_T
FROM A065
INNER JOIN KONP on KONP~KNUMH = A065~KNUMH
INNER JOIN KONH on KONH~KNUMH = A065~KNUMH
INNER JOIN MARA on A065~MATNR = MARA~MATNR
INNER JOIN MAKT ON A065~MATNR = MAKT~MATNR
INNER JOIN KNA1 ON A065~HIENR = KNA1~KUNNR
INNER JOIN KNVH on A065~HIENR = KNVH~HKUNNR
INNER JOIN KNA1 as KNA_H ON KNVH~KUNNR = KNA1~KUNNR
WHERE A065~KAPPL = 'V'
AND A065~KSCHL = 'PR00'
AND KONP~loevm_ko = ''
AND MARA~LVORM = ''
AND A065~DATAB <= sy-datum
AND A065~DATBI => sy-datum.
Code: Alles auswählen.
SELECT A065~MATNR, KNA1~NAME1, KONP~KBETR, KONP~KMEIN, KONP~KPEIN, MARA~MEINS, A065~HIENR, MAKT~MAKTX, KNVH~KUNNR, KNVH~HKUNNR, KNA_H~NAME1 as NAMEH
INTO CORRESPONDING FIELDS OF TABLE @ZKDP2_T
FROM A065
INNER JOIN KONP on KONP~KNUMH = A065~KNUMH
INNER JOIN KONH on KONH~KNUMH = A065~KNUMH
INNER JOIN MARA on A065~MATNR = MARA~MATNR
INNER JOIN MAKT ON A065~MATNR = MAKT~MATNR
INNER JOIN KNA1 ON A065~HIENR = KNA1~KUNNR
INNER JOIN KNVH on A065~HIENR = KNVH~HKUNNR
INNER JOIN KNA1 as KNA_H ON KNVH~KUNNR = KNA1~KUNNR
WHERE A065~KAPPL = 'V'
AND A065~KSCHL = 'PR00'
AND KONP~loevm_ko = ''
AND MARA~LVORM = ''
AND A065~DATAB <= @sy-datum
AND A065~DATBI => @sy-datum.