‎2007 Aug 22 3:12 PM
Hi Experts,
I have two feilds where these two feilds will be populated in runtime of my program
let the two feilds be BUKRS1 and BUKRS2 .I want to retrive the company codes in between these two and including those also. How do i write the select condition.
[I need the values in between BUKRS1 and BUKRS2 and including thoso also.]
‎2007 Aug 22 3:14 PM
set up a range.
ranges: r_bukrs for vbrk-bukrs.
r_bukrs-option = 'BT'.
r_bukrs-sign = 'I'.
r_bukrs-low = bukrs1.
r_bukrs-high = bukrs2.
append r_bukrs
then use this range on the select statement.
‎2007 Aug 22 3:14 PM
set up a range.
ranges: r_bukrs for vbrk-bukrs.
r_bukrs-option = 'BT'.
r_bukrs-sign = 'I'.
r_bukrs-low = bukrs1.
r_bukrs-high = bukrs2.
append r_bukrs
then use this range on the select statement.
‎2007 Aug 22 3:20 PM
Hi,
Try this ..
SELECT ... WHERE F1 BETWEEN P1 AND P2.
F1 - DATABASE TABLE FIELD
P1 & P2 - ARE PARAMTERS.
regards
Dj
reward all helpful answers.
‎2007 Aug 22 3:22 PM
Hi,
Try this.
Create a range and put these values in the range and use it in selectg
ranges: r_bukrs for vbrk-bukrs.
r_bukrs-option = 'I'.
r_bukrs-sign = 'BT'.
r_bukrs-low = bukrs1.
r_bukrs-high = bukrs2.
append r_bukrs.
select * from <DBTABLE> into table itab where bukrs in r_bukrs.
thanks
Mahesh
‎2007 Aug 22 3:31 PM
Hi All,
Thanks Martin, Dj and Mahesh....
I know both these answers are right and will get required results for fetching data from a range of selection criteria.
but which one of these would be better in performance point of view. I guess using range would be better,
please let me know. Thank You.
Regards
Venkat
‎2007 Aug 22 3:44 PM
Hi,
The RANGE process would be better in performance.
Always remember to APPEND your range when you fill it
Cheers,
Leeza
‎2007 Aug 22 3:57 PM
Hi Leeza,
Thanks for your reply. This is very helpful answer.
I can"t allot points as I am not the initator for this question, however I apprecaite your time and efforts.
regards
venkat