Skip to Content
avatar image
Former Member

Regarding Select Statement

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 22, 2007 at 02: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 02: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 02: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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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