Skip to Content
avatar image
Former Member

Select entries present in an internal table using a range of key values

Hi guys,

I have an internal table tb_bseg.

It contains the vendor code (lifnr), document number (belnr) and other fields.

How can I select values so that it may follow my (lifnr) range values in the selection screen?

SELECT belnr lifnr gsber mwskz hwbas wrbtr anln1 aufnr prctr projk nplnr kostl FROM bseg INTO TABLE tb_bseg

WHERE bukrs = pa_bukrs

AND belnr = tb_bkpf-belnr

AND gjahr = tb_bkpf-gjahr.

  • AND lifnr IN cd_lifnr. ??? can I use something like this?

Please guide me regarding this.

Best regards,

Reymar

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 11:48 AM

    Hi Reymar,

    You are right . You can use that way. So your select query will be

    SELECT belnr lifnr gsber mwskz hwbas wrbtr anln1 aufnr prctr projk nplnr kostl FROM bseg INTO TABLE tb_bseg

    WHERE bukrs = pa_bukrs

    AND belnr = tb_bkpf-belnr

    AND gjahr = tb_bkpf-gjahr

    AND lifnr IN cd_lifnr.

    where cd_lifnr is the selection screen field.

    declare it as

    SELECT-OPTIONS :

    CD_LIFNR FOR BSEG-LIFNR.

    Regards,

    Swapna.

    Edited by: NagaSwapna Thota on Sep 4, 2008 5:19 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 11:47 AM

    Hi,

    Put them in the where condition.

    For performance use for all entries option.

    Regards,

    Rama.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2008 at 11:46 AM

    exactly what you are doing, however performance wise you should not expect too much...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 11:46 AM

    Hi,

    Yep. Thats right!

    Regards,

    Ramya

    Add comment
    10|10000 characters needed characters exceeded