SELECT * INTO GS_MARA FROM MARA WHERE ERSDA = '20150701'.
APPEND GS_MARA TO GT_MARA.
ENDSELECT.
SELECT * INTO CORRESPONDING FIELDS OF TABLE GT_MARA
FROM MARA WHERE ERSDA = '20150701'.
SELECT MARA~MATNR MAKT~MAKTX INTO CORRESPONDING FIELDS OF TABLE GT_MARA
FROM MARA [INNER JOIN MAKT|LEFT OUTER JOIN|RIGTH OUTER JOIN] ON MARA~MATNR = MAKT~MATNR
WHERE MARA~ERSDA = '20150701'.
IF GT_MARA[] IS NOT INITIAL.//如果不判断并且内表为空,则下面的SQL会将所有的数据查询出来
SELECT MAKTX INTO CORRESPONDING FIELDS OF TABLE GT_MAKT
FROM MAKT FOR ALL ENTRIES IN GT_MARA
WHERE MATNR = GT_MARA-MATNR.
ENDIF.
|