‎2009 Apr 27 3:38 PM
Hi Friends ,
I am having a problem in the following select query , its not giving any syntax error but it is not picking the values as per the condition :
SELECT GPART VKONT KTOKL ZPRINTALLOW FROM FKKVKP
INTO TABLE GT_FKKVKP
WHERE KOFIZ_SD = '03' OR
KOFIZ_SD = '04' AND
KTOKL = '0005' AND
GPART IN SEL_BP.
Can someone pls help me out in this.
Thanks
‎2009 Apr 27 3:48 PM
Total Posts: 46
Total Questions: 25 (10 unresolved)
Please clean up your old posts.
See if this helps:
SELECT gpart vkont ktokl zprintallow FROM fkkvkp
INTO TABLE gt_fkkvkp
WHERE ( kofiz_sd = '03' OR
kofiz_sd = '04' ) AND
ktokl = '0005' AND
gpart IN sel_bp.Rob
Edited by: Rob Burbank on Apr 27, 2009 10:49 AM
‎2009 Apr 27 3:45 PM
Hi Krishna moorthy,
write the code in the below format..
SELECT GPART VKONT KTOKL ZPRINTALLOW FROM FKKVKP
INTO TABLE GT_FKKVKP
WHERE KOFIZ_SD in ( '03' , '04' ) "write this way
AND ktokl = '0005'
AND GPART IN SEL_BP.
regards,
Prabhudas
‎2009 Apr 27 3:46 PM
Check out whether the condition is wrong in condition.
You code:
KOFIZ_SD = 03 OR 04 AND 005.
Check out it should be ( 03 OR 04 ) AND 0005
‎2009 Apr 27 3:48 PM
Hello,
Or try to use brackets in your where-statement to make sure it selects what you exspect it to select.
The hierarchy for logical expressions is:
1. AND
2. OR
That may be the cause why the result isn't what you exspected.
regards
‎2009 Apr 27 3:48 PM
Total Posts: 46
Total Questions: 25 (10 unresolved)
Please clean up your old posts.
See if this helps:
SELECT gpart vkont ktokl zprintallow FROM fkkvkp
INTO TABLE gt_fkkvkp
WHERE ( kofiz_sd = '03' OR
kofiz_sd = '04' ) AND
ktokl = '0005' AND
gpart IN sel_bp.Rob
Edited by: Rob Burbank on Apr 27, 2009 10:49 AM
‎2009 Apr 27 3:53 PM
Hi Prabhudas,
KTOKL = '0005' check this you have written as KOFIZ_SD .
and Select do one thing
First put kozid_sd = '03' and check then again another...its genrally beacause of the length problem...at one point you may catch easily check it out !!if not so revert back ...Best of luck
Regards
sas
‎2009 Apr 27 4:39 PM
‎2009 Apr 27 4:39 PM