Skip to Content
author's profile photo Former Member
Former Member

SELECT-OPTION to internal table


I need to convert the select-option values into an internal table.

For example, if there is a select-option S_WERKS... i need all the values entered for S_WERKS into the internal table. The internal table structure contains only WERKS.

My actual requirement is, for the given plant values as select-option, i need to fetch all details of the plants. And I should not use any SELECT statements at any stage. Only through function module/ BAPI/BADI/Class methods.

I found one function module T001W_READ, but i need to pass the plant for that.

Please suggest.

Thanks in advance.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2004 at 10:20 AM
    tables: t001w.
    select-options: s_werks for t001w-werks.
    types: begin of ty_werks,
             werks type t001w-werks,
           end of ty_werks.
    data: wa_werks type ty_werks.
    data: lt_werks type ty_werks.
    loop at s_werks where option = 'EQ' and sign ='I'.
      wa_werks-werks = s_werks-low.
      append wa_werks to lt_werks


    Subramanian V.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2004 at 10:34 AM

    Hello Kishore,

    The requirement that you cannot use any SELECT statements in your program is a little....uncommon.

    So you will not be able to convert your select-options into an internal table. Not unless with some restrictions. Since the select-options allows a user to enter any combination of complex entries, you must restrict the select-options so that the user can only enter multiple single values. You can use the Function Module SELECT_OPTIONS_RESTRICT for achieving the same. this FM is very well documented.

    Please let us know if this will be a suitable solution in your case.


    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 22, 2004 at 10:26 AM

    You just need to loop at your select-option field and take the values from low and high fields.

    for. e.g

    loop at s_werks .

    move:s_werks-low to <your itab>

    if not s_werks-high is initial .

    move: s_werks-high to <youritab>

    endif .

    append <your itab>

    endloop .

    Hope its clear



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Kishore

      Why can't you use any SELECTs? If it is so required why not writing your own FM to select them? You can pass your select-option via a generic parameter and assign it to a range at the beginning of your FM. Or you can assign it to a select-option-like table (you can find structure names of similar type from DDIC)


      TABLES t001w .
      RANGES s_werks for t001w-werks .
      DATA: BEGIN OF lt_werks ,
              werks LIKE t001w-werks ,
            END OF lt_werks .
      s_werks[] = it_werks_so[] .
      SELECT werks FROM t001w
             INTO lt_werks
             WHERE werks IN s_werks .

      As another thing, let me introduce you the SDN Forums pointing system: You can assign points to posts which you find helpful while solving your problem. You can reward points by pressing the yellow star icon at header of each post. You can assign;

      - one 10 points (solved)

      - two 6 points (very helpful answer)

      - many 2 points (helpful answer)


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.