Skip to Content
avatar image
Former Member

How to get all values in the range of select option into internal table?

Hi,

I need to capture all entries coming in the range of select option into one internal table.

How to do get that?

For E.g

select-options: matnr for mara-matnr.(select option)

IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value

and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?

Regards,

Mrunal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Jun 23, 2009 at 11:34 AM

    Hi,

    Just SELECT the materials from MARA using the select-options by matching the MATNR field.

    Regards,

    Ankur Parab

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2009 at 11:35 AM

    select matnr from mara into corresponding fields of itab where matnr in so_matnr.

    This shd give u all the materials which are a part of selection range u have specified from low to high.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2009 at 11:36 AM

    'define ranges

    r_matnr for mara-matnr.

    'fill the range

    r_matnr-low = s_matnr-low.

    r_matnr-high = s_matnr-high.

    r_matnr-sign = 'I'.

    r_matnr-option = 'BT'.

    'Now select

    select * from MARA into table IT_MARA

    where matnr IN R_MATNR.

    Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2009 at 11:37 AM

    select-options: s_matnr for mara-matnr.(select option)

    SELECT matnr FROM MARA into table i_mara
                                             where matnr in s_matnr.
    

    Hope it helps......

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Mrunal Mhaskar ,

      What i understand you can do one thing go in debug mode

      Try this code : -

      LOOP AT s_matnr_ex.

      IF s_matnr_ex-low IS NOT INITIAL.

      i_matnr-matnr = s_matnr_ex-low.

      i_matnr-option = s_matnr_ex-option.

      APPEND i_matnr.

      CLEAR : i_matnr.

      ENDIF.

      ENDLOOP.

      LOOP AT s_matnr_ex.

      IF s_matnr_ex-high IS NOT INITIAL.

      i_matnr-matnr = s_matnr_ex-high.

      i_matnr-option = s_matnr_ex-option.

      APPEND i_matnr.

      CLEAR : i_matnr.

      ENDIF.

      ENDLOOP.

      In the i_matnr table high and low values are there.

      Regards,

      Vandana.

  • avatar image
    Former Member
    Jun 23, 2009 at 11:45 AM

    Hi .

    use

    SELECT matnr FROM MARA into table i_mara

    where matnr in s_matnr.

    Hope this works.

    Please let me know if you still have any issues on this.

    Thanks and regards,

    Rajeshwar.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 10, 2014 at 06:29 AM

    Get data from the database using select options.

    now loop over the range table. Prepare a list respecting the Option value. 'BT', 'EQ', ...... We can start incrementing the LOW value until the High value.

    Loop over the list and read the records that are already drawn from the database. We have the invalid records.

    Regards,

    Add comment
    10|10000 characters needed characters exceeded