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 query

anupam_srivastava2
Participant
0 Likes
448

Hi all

I am using 4.6c version, i have written a query, which needs to select data which has been selected from selection screen eg sal_org which is sales org, divi which is division and sal_off which is sales office and quot_date which is quotaion date.

but the select query selects all the records even i have used the where clause.......any suggestions

select * from vbak into TABLE sal_doc_H where

VKORG = sal_org AND

SPART = divi AND

VKBUR = sal_off AND

ERDAT GE QUT_DATE-LOW AND ERDAT LE qut_date-high OR

auart = 'ZIQT' OR

AUART = 'ZUQT' OR

AUART = 'ZUQW'.

3 REPLIES 3
Read only

Former Member
0 Likes
421

select * from vbak into TABLE sal_doc_H where

VKORG <b>IN</b> sal_org AND

SPART <b>IN</b> divi AND

VKBUR <b>IN</b> sal_off AND

ERDAT GE QUT_DATE-LOW AND ERDAT LE qut_date-high OR

auart = 'ZIQT' OR

AUART = 'ZUQT' OR

AUART = 'ZUQW'.

For select option you should use IN instead of =.

Read only

0 Likes
421

select * from vbak into TABLE sal_doc_H where

VKORG IN sal_org AND

SPART IN divi AND

VKBUR IN sal_off AND

ERDAT GE QUT_DATE-LOW AND ERDAT LE qut_date-high

<b>AND (

auart = 'ZIQT' OR

AUART = 'ZUQT' OR

AUART = 'ZUQW' ).</b>

As far as i can understand i think this is what you want.

Khusro habib

Read only

former_member188827
Active Contributor
0 Likes
421

da prob lies in OR

auart = 'ZIQT' OR

AUART = 'ZUQT' OR

AUART = 'ZUQW'.

wat is ur selection criteria...expalin in words