‎2007 Oct 04 9:34 AM
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'.
‎2007 Oct 04 9:35 AM
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 =.
‎2007 Oct 04 9:42 AM
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
‎2007 Oct 04 9:38 AM
da prob lies in OR
auart = 'ZIQT' OR
AUART = 'ZUQT' OR
AUART = 'ZUQW'.
wat is ur selection criteria...expalin in words