‎2007 Dec 06 9:53 AM
Hi everyone,
Is it possible to use ranges in function module. If so, how to use it in Select statement.
For example, i want to exclude some datas while fetching.
if P_S_AREA is initial.
r_btrtl-low = '%'.
append r_btrtl.
clear r_btrtl.
ELSE.
r_btrtl-low = P_S_AREA.
append r_btrtl.
clear r_btrtl.
ENDIF.
when i pass this range in my select statement its not fetching the data.
SELECT A~PERNR INTO CORRESPONDING FIELDS OF TABLE IT_EMP
FROM PA0000 AS A INNER JOIN PA0001 AS B ON APERNR = BPERNR
WHERE A~PERNR LIKE WK_EMP_NO
AND B~BUKRS LIKE WK_BUKRS
AND B~WERKS LIKE WK_WERKS
AND B~BTRTL LIKE r_btrtl
AND A~ENDDA = '99991231'
AND A~STAT2 LIKE WK_STATUS
AND B~ENDDA = '99991231'
AND A~AEDTM LIKE WK_DATE
AND B~AEDTM LIKE WK_DATE.
How to solve this problem, its very urgent
regards,
Manoj
‎2007 Dec 06 10:01 AM
Hi Manoj,
For ranges 'LIKE' can not be used....use 'IN' statement
as you inserted % in ranges.
Regds,
‎2007 Dec 06 10:05 AM
Hi,
In function module it's not allowing to use IN. But it's permitted in reports.
regards,
Manoj
‎2007 Dec 06 10:48 AM
I am not sure y FM is not allowing IN syntax..if thats the case..u can always use a PERFORM and write select statements in includes...
Regds,
suman