Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Ploblem while using ranges

Former Member
0 Likes
430

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

3 REPLIES 3
Read only

Former Member
0 Likes
415

Hi Manoj,

For ranges 'LIKE' can not be used....use 'IN' statement

as you inserted % in ranges.

Regds,

Read only

0 Likes
415

Hi,

In function module it's not allowing to use IN. But it's permitted in reports.

regards,

Manoj

Read only

0 Likes
415

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