1 Introduction
In the abap querry condtion. there are not ‘between…and…’ and ‘eq’ and ‘in’ at the
same time.
2 Solution
SELECT
MARA~MATNR AFPO~DWERK
INTO CORRESPONDING FIELDS OF TABLE LT_GET_DATA
FROM AFKO
INNER JOIN AFPO
ON AFPO~AUFNR = AFKO~AUFNR
INNER JOIN MARA
ON MARA~MATNR = AFKO~PLNBEZ AND MARA~MTART = 'QY03'
WHERE AFKO~GSTRP BETWEEN LV_DATA AND LV_E_DATA
AND MARA~MATNR IN S_MATNR.
IF P_BUKRS IS NOT INITIAL.
DELETE LT_GET_DATA WHERE DWERK = S_MATNR.
ENDIF.