Application Development 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: 

Regarding Select Statement

Former Member
0 Kudos

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.]

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

Try this ..

SELECT ... WHERE F1 BETWEEN P1 AND P2.

F1 - DATABASE TABLE FIELD

P1 & P2 - ARE PARAMTERS.

regards

  • Dj

reward all helpful answers.

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

The RANGE process would be better in performance.

Always remember to APPEND your range when you fill it

Cheers,

Leeza

0 Kudos

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