How to use select options whitout ranges ie like parameter

how to use select options whitout ranges ie like parameter and pls send me the code on that
thanks
raja.

hi,
SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b>
eg: code
<b>SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b></b>
data: itab type table of kna1 with header line.
select * from kna1 into table itab where kunnr IN s_kunnr.
rgds
Anver

Similar Messages

  • How will use Select-Options in Read table Concept.

    Hi All,
                  How will use Select-Options in Read table. For  example,
          Select-Options : test for bseg-prctr.
           Select * from bseg into table ITAB.
    Read table ITAB with key prctr in test.
    Last line is showing error. If any way to read ITAB as conditions given per select options.
    Thankx Advance,,,

    HI,
    you cannot use " IN " with read statement , read statement is used as:
    READ TABLE it_collect  ASSIGNING <fs_collect>
                      WITH KEY   rbpl = <fs_wkdet>-arbpl
                                 ufnr = <fs_wkdet>-aufnr.
    anyways you can use  loop at statement before read to use  " into "  statement as:
    LOOP AT it_master INTO l_master
                                           WHERE werks       = l_werks
    hope it will help you
    regards
    rahul
    Edited by: RAHUL SHARMA on Dec 30, 2008 9:14 AM

  • How to use select-options in the function module of import parameter ?

    Hi ...
       I have created a BAPI and tested in SWO1 tcode , by giving the single value for an company code ( BUKRS ) , it executed properly .
    Same thing is working after implementing in a program .
    so now it is working for fetching a single company code details .
    My requirement is : I want to use select-options in program as well as in function module IN IMPORT PARAMETER.
    Program :
    REPORT  ZTEST.
    TABLES : T001 , ZBAPI_STR .
    TYPES : BEGIN OF TY_ITEM  .
              INCLUDE STRUCTURE ZBAPI_STR .
    TYPES : END OF TY_ITEM .
    DATA :WA_ITEM TYPE TY_ITEM ,
          ITEM LIKE STANDARD TABLE OF WA_ITEM INITIAL SIZE 0 .
    PARAMETER : BUKRS TYPE ZBAPI_STR-BUKRS.
    call function 'ZBAPI_FMT001'
      exporting
        bukrs         =  BUKRS
    IMPORTING
      RETURN        =
      tables
        itemtab       = ITEM
    IF ITEM IS NOT INITIAL .
      LOOP AT ITEM INTO WA_ITEM .
        WRITE : / WA_ITEM-BUKRS , WA_ITEM-BUTXT , WA_ITEM-ORT01 , WA_ITEM-LAND1 .
      ENDLOOP.
    ENDIF.
    FUNCTION MODULE :
    FUNCTION ZBAPI_FMT001.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(BUKRS) TYPE  EFG_TAB_RANGES
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRET2
    *"  TABLES
    *"      ITEMTAB STRUCTURE  ZBAPI_STR
    SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE ITEMTAB WHERE BUKRS = BUKRS .
    ENDFUNCTION.
    Regards
    Deepa.

    I have given a similiar example which i did
    Declare a
    Table type:Z_TT_PONUM             
    Short text  :  Select options  PO Number
    in SE11 tcode with row type eg: Z_ST_PONUM
    create a structure (this will be the row type)
    Structure          Z_ST_PONUM            
    Short text         Select Options Field PO number
    Compenent  Compent type
    SIGN       BAPISIGN      Inclusion/exclusion criterion SIGN for range tables
    OPTION       BAPIOPTION      Selection operator OPTION for range tables
    LOW       EBELN                      Purchasing Document Number
    HIGH       EBELN                      Purchasing Document Number
    In the function module import
    give as
    I_PO_NUM     TYPE     Z_TT_PONUM     opt  pass value Select options  PO Number
    Hope this is exactly what you want to know.
    So you create a structure simliar to mine but the low an high whould be your component
    then a table type  and then include that in the BAPI.
    Then pass your select-option value to this BAPI when you call this BAPI in the program

  • Limitation of using select-options or ranges

    Hi
    I have the following code to fill the select-option AUFNR with the orders from SEL_TAB table, which I have to submit to another report to get a result set.
    LOOP AT SEL_TAB.
       MOVE: 'I'   TO AUFNR-SIGN,
             'EQ'  TO AUFNR-OPTION,
             SEL_TAB-AUFNR TO AUFNR-LOW.
      APPEND AUFNR.
    ENDLOOP.
    I know that we can use the RANGES option also for the above scenario since I don't display the select-option AUFNR in my selection screen.
    My question is, is there any limitation to how many number of values the RANGES or SELECT-OPTIONS can hold? Is it 200 or 256? I am not sure of this figure, can anyone give the exact number?
    Thanks,
    Bala.

    Hi Bala,
      there's not SAP limitations for range dimension but there is a limitation about native SQL statement size.
    In fact an open SQL statement (in ABAP language) will be translated in native SQL .
    For example:
    select * from mara where matnr in r_mara
    will be translated in
    SELECT ... FROM MARA WHERE MATNR = value1 OR MATNR = value2 etc...
    So if your range is too large, the native SQL will exceed the maximum length (and short dump will occur).
    with the following simple trick you can bypass the problem:
    describe table rng_ebeln_marc lines i.
    if i > 0.
      if i <= max_rng_rows.   "MAX NUMBER OF RANGE LINES
        select *
          from ekbe
          into table tekbe
         where ebeln in rng_ebeln_marc.
      else.
        from_i = 1.
        to_i = max_rng_rows.
        clear new_ebeln_marc.
        do.
          if i < from_i.
            exit.
          endif.
          append lines of rng_matnr_mara from from_i to to_i to new_ebeln_marc.
          select *
            from ekbe
       appending table tekbe
           where ebeln in new_ebeln_marc.
           clear: new_ebeln_marc, new_ebeln_marc[].
           from_i = from_i + max_rng_rows.
          to_i = to_i + max_rng_rows.
        enddo.
      endif.
      sort tekbe by ebeln ebelp zekkn vgabe gjahr belnr buzei.
    endif.
    This will split the sql statement into more (and shorter) statements. The result will be joined.
    Let me know if you need further infos.
    Kind Regards, Manuel

  • How to use "Select options" in Webdynpro Java ?

    HI experts ,
    I want know if can be implemented "select options" like the ones used in R3 - ABAP in a webdynpro Java.
    And in case of being possible, how to implemented using Adaptive RFC or BAPI with a R3 backend system?
    Our Portal is EP6.0 SP18 ,J2EE 6.40 .
    Thanks & Regards,
    Jianguo Chen

    Hi Jianguo,
    check these links:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/5f/e5de3f68d48f15e10000000a155106/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/5f/e5de3f68d48f15e10000000a155106/frameset.htm</a>
    You may use 2 EVS to simulate your select option.
    Regards,
    Gianluca Barile

  • Using Select option in Native SQL

    Hi,
    Can any one tell me, how to use select option value in native SQL.
    ie.,
    I want to use select option in where condition. Need to select all the records from table(non-SAP) where date in given range.
    Please suggest.
    Thanks,
    Amal

    Hi
    No!
    U need to find a way to convert a range of select-option to a range for Native SQL, probably it should be better doesn't use a select-option for the date but two parameters: one for date from and one for date to.
    Max

  • Problem with table-indexes when using select-options in select

    Hello experts,
    is it right that table-indexes will not be used if you take select-options to select data from the database?
    in detail:
    i have build up an table-index for one of our db-tables and test it via an test-programm. The first test with '=' comparisons worked fine. Every key of the index was used; checked via ST05!
    e.g.:    SELECT * FROM TABLEA INTO ITAB WHERE keya = '1' AND keyb = '2' AND keyc = '3'.
    Now i startet the test with select-options
    e.g.:   SELECT * FROM TABLEA INTO ITAB WHERE keya IN seltabA  AND keyb IN seltabB AND keyc IN seltabC.
    First of all i just filled the seltabs with only 1 value:    eg:  seltabA=      SIGN = 'I'   OPTION = 'EQ'   LOW = '1'     etc.
    Everything worked fine. Every key of the index was used.
    But now, I putted more than one entries in the seltabs e.g.
    seltabA:      SIGN = 'I'   OPTION = 'EQ'   LOW = '1'
                       SIGN = 'I'   OPTION = 'EQ'   LOW = '2'   
                       SIGN = 'I'   OPTION = 'EQ'   LOW = '3'
    From now on, the indexed was not used completely (with all keys).
    Isn't that strange? How can i use select-options or sel-ranges with using the complete table-indexes?
    Thanks a lot,
    Marcel

    Hi Hermann,
    i hope this helps:
    this is the first one, which uses the complete index:
    SELECT                                                                     
      "KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,   
      "GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,    
      "HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,      
      "TERDAT"                                                                 
    FROM                                                                       
      "/dbcon/01_con"                                                       
    WHERE                                                                      
      "MANDT" = ? AND "LIFNR" = ? AND "ORGID" = ? AND "KOART_BASIS" = ? AND    
      "STATUS" = ? AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR "STATUS" = ? OR
      "STATUS" = ? )  WITH UR                 
    RESULT: 5 IXSCAN /dbcon/01_con05 #key columns:  4
    And the second one, which does not use the complete index! The 3 ranges are filled each with 2 values. Remember; when i fill them each with only one value, the result is the same as you can see above(/dbcon/01_con05 #key columns:  4):
    SELECT                                                                     
      "KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,   
      "GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,    
      "HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,      
      "TERDAT"                                                                 
    FROM                                                                       
      "/dbcon/01_con"                                                       
    WHERE                                                                      
      "MANDT" = ? AND "LIFNR" IN ( ? , ? ) AND "ORGID" IN ( ? , ? ) AND        
      "KOART_BASIS" IN ( ? , ? ) AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR 
      "STATUS" = ? OR "STATUS" = ? )  WITH UR                                  
    and here the access-plan
       0 SELECT STATEMENT ( Estimated Costs =  5,139E+01 [timerons] )                                                                               
    5     1 RETURN                                                                               
    5     2 NLJOIN                                                                               
    5     3 [O] TBSCAN                                                                               
    5     4 SORT                                                                               
    5 TBSCAN GENROW                                                                               
    5     6 <i> FETCH /dbcon/01_con                                                                               
    7 IXSCAN /dbcon/01_con05 #key columns:  2   
    As you can see, only 2 keys were taken for indexed selection!
    Any idea?
    Kind regards,
    MArcel
    Edited by: Marcel Ebert on Jul 28, 2009 5:25 PM

  • Select-options and ranges

    Hi all,
    Belated Happy Holi.
    Can u  explain me the difference between
    Select-options and ranges?
    When, where and how to use them ?
    I know the basic differences, but i need to know in deep .
    could u give me the informatin with a scenario please ?
    Thanks in advance
    Ravi

    HI
    <u>SELECT-OPTIONS:</u> Declare an internal table that is also linked to input fields on a selection screen
    <u>RANGES:</u> Declare an internal table with the same structure as in select-options, but without linking it to a selection screen.
    FOR FURTHER DOCUMENTATION PLEASE GO THROUGH THE LINK
    <a href="http://72.14.203.104/search?q=cache:btyoj86smhEJ:www.sap-img.com/abap/difference-between-select-options-ranges.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=1">Difference Between Select-Options & Ranges</a>
    <a href="http://72.14.203.104/search?q=cache:EJgiHLpghDEJ:help.sap.com/saphelp_nw04/helpdata/en/fc/eb3034358411d1829f0000e829fbfe/content.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=4">Statical Declaration</a>
    <a href="http://72.14.203.104/search?q=cache:VWS1erlabRIJ:help.sap.com/saphelp_nw04/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=5">Selection tables</a>
    REGARDS
    ANOOP
    Message was edited by: ANOOP R.S

  • How to use selection creteria in Trial Balance ???....

    Dear all,
    Redefining my question in another thread,
    How to use selection creteria in Trial balance to get closing balance of previous fiscal year as
    opening balance of current fiscal year(01.04.09 to till date) ?
    Since Revenue,Expenditure account get zeroed on YEC procedure,
    My question is concerend with Balance sheet accounts
    Note : YEC is performed on 31.03.09.
    Expecting ur valuable replies.
    Jeyakanthan

    Hi Jey
    You tried this ?
    What is the result are u getting ?
    choose  Financials  Financial Reports  Financial  Trial Balance .  Under Selection criteria
    Opening Balance for Period u2013 Select this option when you need to differentiate between the balance of the selected posting period and that of the previous periods. When a date range of a current posting period is selected, you can select this checkbox to display the bookkeeping balance prior to the selected date range in a separate column: OB.
    As default, the checkbox is cleared. Selecting it displays the following options:
    OB from Start of Company Activity u2013 Displays the opening balance accumulated since the companyu2019s activity started.
    OB from Start of Fiscal Year u2013 Displays the opening balance accumulated from the start of the current fiscal year.
    Presently i dont have that enviroment to check.
    Ashish Gupte

  • How to creat select-option on module pool screen???

    Hi All,
       please tell me how to creat select-option on module pool screen???
    Regards
    Deepak

    Hi Deepak Kumar Sharma,
    There are Two ways to achieve it...
    1) How to create a select-options in a module pool screen.
    Method 1
    a) Create a subscreen area in your screen layout where you want to create the select options.
    b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    select-options s_matnr for mara-matnr.
    SELECTION-SCREEN END OF SCREEN.
    c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
    CALL SUBCREEN sub_area INCLUDING <program> <screen>
    This call subscreen statement is necessary for transport of values between screen and program.
    Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
    Method 2
    a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
    struc_tab_and_field-fieldname = con_cust. " 'KUNNR'
    struc_tab_and_field-tablename = con_kna1. " 'KNA1'.
    CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
    TITLE = ' '
    text = g_titl1 " 'Customers'
    tab_and_field = struc_tab_and_field
    TABLES
    RANGE = rng_kunnr
    EXCEPTIONS
    NO_RANGE_TAB = 1
    CANCELLED = 2
    INTERNAL_ERROR = 3
    INVALID_FIELDNAME = 4
    OTHERS = 5.
    IF NOT rng_kunnr[] IS INITIAL.
    Read the very first entry of the range table and pass it to
    dynpro screen field
    READ TABLE rng_kunnr INDEX 1.
    IF sy-subrc = 0.
    g_cust = rng_kunnr-low.
    ENDIF.
    You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.
    Also have a look on below threads
    how to make select option in module pool
    select option in module pool program
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • How to get select-options type fields in module programming

    i need to get ranges type of fields ( like we use select-options in reports) in module prgrming..im only gettin single entry field (like we use in paramenters)...how to get it like this
    field1  ___  to  ___    ->
    field2  ___  to  ___    ->
    Thanx,
    Naveen Vishal

    Hi,
    report zrich_0006 .
    tables: mara.
    Custom Selection Screen 1010
    selection-screen begin of screen 1010 as subscreen.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_rad1 radiobutton group grp1 default 'X',
    p_rad2 radiobutton group grp1,
    p_rad3 radiobutton group grp1.
    select-options: s_matnr for mara-matnr,
    s_matkl for mara-matkl,
    s_mtart for mara-mtart.
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    start-of-selection.
    call screen 100.
    *& Module STATUS_0100 OUTPUT
    module status_0100 output.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    endmodule.
    *& Module USER_COMMAND_0100 INPUT
    module user_command_0100 input.
    endmodule.
    Create Screen 100 with a subscreen area called "subscreen_1010"
    Screen Flow Logic follows
    *process before output.
    module status_0100.
    call subscreen subscreen_1010 including sy-repid '1010'.
    *process after input.
    call subscreen subscreen_1010 .
    module user_command_0100.

  • HOW TO PASS SELECT-OPTIONS AS IMPORT PARAMETER TO A CLASS

    Hi experts,how to pass select options value as a export parameters to a zclass.
    can  give me some idea.
    Thanks
    sai

    As Sachin already said, selection options are stored in an internal table. You can reconstruct the table type without the corresponding input fields using the type addition RANGE OF.
    So - assuming you have the following in your program:
    DATA: wa TYPE sflight.
            SELECT-OPTIONS so_car FOR sflight-carrid.
    you can create a publically-visible type in your class using direct type entry and the code
    TYPES: my_selectoption TYPE RANGE OF sflight-carrid.
    and use this to define the importing parameter of the method.
    The only other thing you have to remember is that select-options generates an internal table with header line. Thereore, to pass the table to the method, you would use (in the above example) so_car[], and not just the name of the select-option.
    Hope this helps.
    Regards
    Jon.

  • Error while using selection option variable in the selection screen

    Hi All,
    I am facing an issue while using selection option variable in the selection screen for one of my reports.
    Scenario: For the field "Region From" we need to have wild card logic () in tes selection screen, for example if we put "BE" in the selection screen for the field Region From then the query should be executed only for those "Region From" values which begin from "BE".
    Approach: For the above requirement I have made a selection option variable for "Region From". This allows use wild card
    But when the report is executed we get the following error:
    "System error in program CL_RSR_REQUEST. Invalid filter on ETVRGNFR".
    (ETVRGNFR is technical name of the info object Region From)
    Though the report is executed it displays all the values for the field "Region From" irrespective of the selection given in the selection screen.
    Please give suggestions / alternate solutions to crack this issue.
    Thanks in advance
    Regards
    Priyanka.

    Hi,
    Try to use a variable of type Customer Exit and do the validation inside the exit to display according to your request.
    This is just my view, i am not sure if u are already using this or Char. Variable.
    Cheers.
    Ranga.

  • Using select-option in webdynpro for ABAP where I have two separate pages

    Hi Experts,
             I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
    Second page is opened on the clicking the 'Submit' button in first page.
    How to design a ABAP webdynpro component for this scenario?
    How to pass select-option values to the next page?
    What nodes/attributes should I have to create in component controller?
    Please provide me the step by step info.
    I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    But it has only one page. So I am not able to recreate my scenario based on this.
    Thanks
    Gopal

    Hi Experts,
             I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
    Second page is opened on the clicking the 'Submit' button in first page.
    How to design a ABAP webdynpro component for this scenario?
    How to pass select-option values to the next page?
    What nodes/attributes should I have to create in component controller?
    Please provide me the step by step info.
    I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    But it has only one page. So I am not able to recreate my scenario based on this.
    Thanks
    Gopal

  • Using Select-options

    Hi All,
    Does any one how to handel select-options in web dynpro.
    thanks,

    Check out this weblog.
    /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    Regards,
    Rich Heilman

Maybe you are looking for

  • Exchange Rate Change in Invoice (LIV)

    Hi All, Can we change Exchange rate at the time of LIV . We see field Currency and Exch Rate is grayed in MIRO / Details Tab. How can I activate these two field in MIRO. Thanks Sanjay Sharma

  • How do you correct text entered on a flat pdf

    I added text to a flat pdf to fill in lined blanks using the "add text" command and then saved it. I needed to go back in to correct some of the text entries I made; however, common sense told me to go to Tools and then Edit text. This would only let

  • CM 13 / Infomaker / generatepdf.exe question

    Hey All, We're moving the database location of our CM13 app and we're having a problem with printing/print preview. It's my understanding that parameters are sent to the generatepdf.exe program when previewing and I can see these parameters in the .x

  • Freight Report

    Hi I have an issue in which I need to see the total freight amount for a particular material. I have added material and Purchasing document as special field in Line Line Item Display. So for a combination of material and  profit center, I am able to

  • Can we create external table from an existing database table ?

    Hi everyone, As i understand, its possible to create a new table based on an existing table without copying any values from it, using the following command; CREATE TABLE newtable AS (SELECT * FROM oldtable WHERE 1=2); I would like to know whether we