‎2007 Sep 20 5:42 AM
Hi Guys,
Whats wrong in my select statement.,
SELECT lifnr
xblnr
bukrs
inv_date
invr_date
zterm
dmbtr
waers
kursf
status FROM zinv_reg INTO TABLE lt_reg
WHERE status EQ 'CL'
AND bukrs EQ p_ccode
OR ( lifnr EQ p_vendor OR lifnr EQ ' ' )
OR ( invr_date GE so_date-low and
invr_date LE so_date-high ).
Here I need to pick only records where the data in between so_date-low and so_date-high, but with this select statement it is picking all the records.,
Can and one tell me how to do it.,
Regards,
Line
‎2007 Sep 20 5:46 AM
Hi,
Instead of using OR operator, use IN operator. Refer the syntax for it and use. Bcoz., of OR operator it is taking all records I suppose.
Reward if useful.
‎2007 Sep 20 5:47 AM
SELECT lifnr
xblnr
bukrs
inv_date
invr_date
zterm
dmbtr
waers
kursf
status FROM zinv_reg INTO TABLE lt_reg
WHERE status EQ 'CL'
AND bukrs EQ p_ccode
AND ( lifnr EQ p_vendor OR lifnr EQ ' ' ) " change OR to AND
AND invr_date GE so_date-low " change OR to AND
AND invr_date LE so_date-high .This should work.
Regards
Gopi
‎2007 Sep 20 5:55 AM
Hi
I changed the code accordingly But I am unable to get the output., No records are picking with the select statement now.
Regards,
Line
‎2007 Sep 20 6:01 AM
Hi Line ,
Please check my response to the same question you have posted in the other post.
Regards
Arun
‎2007 Sep 20 6:16 AM
Hi,
Try this
SELECT lifnr
xblnr
bukrs
inv_date
invr_date
zterm
dmbtr
waers
kursf
status FROM zinv_reg INTO TABLE lt_reg
WHERE status EQ 'CL'
AND bukrs EQ p_ccode
AND ( lifnr EQ p_vendor OR lifnr EQ ' ' ) " change OR to AND
AND invr_date in so_date
Regards,
Aruna