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

select-options in SELECT query - syntax error

madhu_reddy22
Participant
0 Likes
1,205

Hi all,

I get the error below when I try to use the select options in a SELECT query . Please help me.

"The IN operator with "SO_AWART" is followed neither by an internal

table nor by a value list."

The code i have used(Logical database PNP is used):

TABLES: pernr,

catsdb.

INCLUDE ztime_cwtr_top. " global Data

INCLUDE ztime_cwtr_f01.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.

PARAMETERS P_THRES TYPE I.

SELECTION-SCREEN END OF BLOCK B1.

  • Get data from CATSDB table. Workdates within the date interval are considered.

SELECT pernr workdate awart catsquantity beguz enduz status

FROM catsdb

INTO TABLE it_catsdb

WHERE pernr = pernr-pernr AND

workdate GE pn-begda AND

workdate LE pn-endda AND

status IN ('20', '30') AND

awart IN so_awart .

  • awart IN ('1100', '1137', '1138', '1139', '1140',

  • '1147', '1148', '1149', '1157', '2003' ).

when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.

I have tried different options like using only the select-options in the where condition.

Thanks in advance.....

Madhu

4 REPLIES 4
Read only

Former Member
0 Likes
596

Hi madhu,

Use NO INTERVALS for AWART as follows.

SELECT-OPTIONS SO_AWART FOR CATSDB-AWART NO INTERVALS.

Hope your query works now.

Regards,

Anand.

Read only

GauthamV
Active Contributor
0 Likes
596

hi,

you remove in operator for status and replace with =.

Read only

Former Member
0 Likes
596

Include CATSDB in tables statement.

Thanks

Kiran

Read only

madhu_reddy22
Participant
0 Likes
596

Solved.

Code with syntax error:

include z...top .

include z...fo1.

select-options: xxxxxxx

Code with no syntax error:

select-options: xxxxxxx

include z...top .

include z...fo1.

Thanks for all your help,

Madhu