Using selection options in functions..

Hi,
I have written abap program in which there are 3 selection options.. I want to pass these selection options to a function.  so I want to know how to define or refer selection options in functions which is called by some other abap program ?
Regards,
Santosh

The select options are basically just tables with a specific structure. One option would be to specify them as TABLES parameters, e.g. check out function module BAPI_MATERIAL_GETLIST and you can see for example a call via function IAC_SHMA_MATERIALS_SELECT (or check dictionary table type SHP_MATNR_RANGE_T in SE11).
Cheers, harald

Similar Messages

  • Using select option and function module in single view

    Hi All,
    I Have a requirment ,using service call i get a function module and bind to specified UI elements with low and high attributes to input fileds  which i designed in my view . And i have to keep range for input values using select options for those input values  and clicking on submit i have to display data in VC but it's going to dump
    the bug is
    Adapter error in INPUT_FIELD "SALEDOC_TXT" of view "ZSD_ORDERSTATUS.MAIN": Context binding of property VALUE cannot be resolved: Node COMPONENTCONTROLLER.1.ZSD_ORDER_STATUS.1.CHANGING.1.S_VBELN does not contain any elements
    can any one get me out of this.
    Thank U,
    Madhan

    Hi,
    Call FM using CALL FUNCTION, if you want to pass selectoptions type values to FM..
    Try like this...
      DATA : delivery TYPE TABLE OF RVBELN,
             wa_delivery TYPE RVBELN,
      wa_delivery-sign   = 'E'.
      wa_delivery-option = 'BT'.
      wa_delivery-low    = lv_FROM_DELIVERYNO.
      wa_delivery-high   = lv_TO_DELIVERYNO.
      APPEND wa_delivery to delivery.
      CLEAR wa_delivery.
    Pass Delivery to FM.
    Cheers,
    Kris.

  • 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

  • Total funcnality of select options in function module

    Dear ABAPers
    i am using structure and  ranges  to meet the functionality of select-options in function module3
    but unlike reports if i leave it blank rather than selecting all the data it comes blank.
    how can i do that
    coz my select query uses 8 selection criteria and user may enter one two or three as per his need.
    in that case the output comes out to be blank.
    how this can be resolved
    Thanks and Regards
    Luthra, Deep.

    You have to maintain conditions for all your possibilities.
    Something like this.
      IF ( post_dt_from IS INITIAL AND post_dt_to IS INITIAL AND
       doc_dt_from IS INITIAL AND doc_dt_to IS INITIAL ) OR
         ( post_dt_from IS INITIAL AND post_dt_to IS NOT INITIAL AND
       doc_dt_from IS NOT INITIAL AND doc_dt_to IS NOT INITIAL ) OR
         ( post_dt_from IS NOT INITIAL AND post_dt_to IS INITIAL AND
       doc_dt_from IS NOT INITIAL AND doc_dt_to IS NOT INITIAL ) OR
         ( post_dt_from IS NOT INITIAL AND post_dt_to IS NOT INITIAL AND
       doc_dt_from IS INITIAL AND doc_dt_to IS NOT INITIAL ) OR
         ( post_dt_from IS NOT INITIAL AND post_dt_to IS NOT INITIAL AND
       doc_dt_from IS NOT INITIAL AND doc_dt_to IS INITIAL ) OR
       ( post_dt_from IS NOT INITIAL AND post_dt_to IS INITIAL AND
       doc_dt_from IS INITIAL AND doc_dt_to IS INITIAL ) OR
         ( post_dt_from IS INITIAL AND post_dt_to IS NOT INITIAL AND
       doc_dt_from IS INITIAL AND doc_dt_to IS INITIAL ) OR
         ( post_dt_from IS INITIAL AND post_dt_to IS INITIAL AND
       doc_dt_from IS NOT INITIAL AND doc_dt_to IS INITIAL ) OR
         ( post_dt_from IS INITIAL AND post_dt_to IS INITIAL AND
       doc_dt_from IS INITIAL AND doc_dt_to IS NOT INITIAL ) OR
        ( ( post_dt_from IS NOT INITIAL AND post_dt_to IS NOT INITIAL ) AND
         ( doc_dt_from IS NOT INITIAL AND doc_dt_to IS NOT INITIAL ) ).

  • Listbox using select options

    hi all,
             Can i give a listbox (drop down list) using select options?
    thanks
    nayan

    Hi
    use two parameters one for low and one for high
    TYPE-POOLS: VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST.
    DATA: NAME1  TYPE VRM_ID,
          LIST1  TYPE VRM_VALUES,
          VALUE1 LIKE LINE OF LIST.
    PARAMETERS: PS_LOW(10) TYPE N .
    PARAMETERS: PS_HIGH(10) TYPE N .
    AT SELECTION-SCREEN OUTPUT.
    NAME = 'PS_LOW'.
    VALUE-KEY = '1'.
    VALUE-TEXT = 'JANUARY'.
    APPEND VALUE TO LIST.
    VALUE-KEY = '2'.
    VALUE-TEXT = 'FEBRUARY'.
    APPEND VALUE TO LIST.
    ETC.....
    FOR SECOND ONE
    NAME1 = 'PS_HIGH'.
    VALUE1-KEY = '1'.
    VALUE1-TEXT = 'JANUARY'.
    APPEND VALUE1 TO LIST1.
    VALUE1-KEY = '2'.
    VALUE1-TEXT = 'FEBRUARY'.
    APPEND VALUE1 TO LIST1.
    ETC.....
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME1 VALUES = LIST1.
    reward points to all helpful answers
    kiran.M

  • Can we use select options in smartform

    can we use select options in smartform if so can any one send me a sample code...
    Thanks
    bhaskhar

    Hi ,
    Can u explain why u want to use select options in smartforms . U can try it in program lines .
    Its better to use select options in the driver program and fetch data accordingly in the driver program or passing the selected values from select options to the smatfrom and fdetching the data there in smartform .
    Regards

  • Search help is not coming while using select-options?

    Hi All,
    I am using select options in my selection screen, i used wdr_select_options, also i coded some parameter values also
    ( non select-options ). For that field i am not getting search help. If i create as normal i am getting? Suggestions pelase?
    Thanks,
    Venkat.

    HI
    what kind of search help is associated with the field.
    ADD_SELECTION_FIELD method has some specific parametrs for value_help
    give the input there and try again.
    these parameters are
    I_VALUE_HELP_TYPE
    I_VALUE_HELP_ID
    I_VALUE_HELP_MODE
    I_VALUE_HELP_STRUCTURE
    thanks
    sarbjeet dingh

  • 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

  • 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

  • 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

  • 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

  • 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

  • ABAP WD application using Select Options  & Adobe form :Don't see form data

    Hi,
    I am trying to get multiple PDF forms by passing multiple order numbers.I was able to get one PDF form successfully and now I am enhancing this application.
    For doing this I have created nested WD Context .
    1) Created a Node for Selections. ND_SELECT  ,
    Cardinality: 1..n ,
    Selection: 1..n ,
    Intialization lead Selection : Checked ,
    Singleton : Checked
    2) Created a Node for Output Structures ADOBE_DATA
    Properties same as above
    3) As we need Nesting Under ADOBE_DATA node I have created a subnode for Header: HEADER
    Properties same as above
    4) Under HEADER node I have created a items Node : ITEM
    Properties same as above
    As I have used Select-options and I am getting both header and Item data in to button search method .
    DATA lo_nd_adobe_data TYPE REF TO if_wd_context_node.
      DATA lo_nd_header TYPE REF TO if_wd_context_node.
      DATA lo_el_header TYPE REF TO if_wd_context_element.
      DATA ls_header TYPE wd_this->element_header.
    * navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
      lo_nd_adobe_data = wd_context->get_child_node( name = wd_this->wdctx_adobe_data ).
    * navigate from <ADOBE_DATA> to <HEADER> via lead selection
      lo_nd_header = lo_nd_adobe_data->get_child_node( name = wd_this->wdctx_header ).
      lo_nd_header->bind_table( new_items = it_header  set_initial_elements = abap_true ).
      DATA lo_nd_item TYPE REF TO if_wd_context_node.
      DATA lo_el_item TYPE REF TO if_wd_context_element.
      DATA ls_item TYPE wd_this->element_item.
    * navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
      lo_nd_adobe_data = wd_context->get_child_node( name = wd_this->wdctx_adobe_data ).
    * navigate from <ADOBE_DATA> to <HEADER> via lead selection
      lo_nd_header = lo_nd_adobe_data->get_child_node( name = wd_this->wdctx_header ).
    * navigate from <HEADER> to <ITEM> via lead selection
      lo_nd_item = lo_nd_header->get_child_node( name = wd_this->wdctx_item ).
    lo_nd_item->bind_table( new_items = it_item  set_initial_elements = abap_true ).
    Could you please tell me where I am doing wrong?
    In adobe form
    Created one MainForm  and its properties are
    Binding : $record.HEADER.DATA[*]
    Repeat subform for each data item Checked , Min Count: 1
    Subform Content : Flowed ,Western Text , Allow page breaks withing Content Checked
    Accessibility /Subform Role: None
    Inside this Mainform I have created a small table ITEMTABLE  with 3 fields and mapped it item data.
    Itemtable properties
    Binding : ITEM
    Uncheck Repeat table for Each Data item.
    I have Itemtablerow inside Itemtable  and its properties are:
    Binding : DATA[*]
    Repeat row for each data item Checked ,Min count: 1
    Accesibility:/Subform Role: Body row
    Row: body row, Check Allow page breaks within content
    Still donu2019t see data on form.here is what i have in Hierarchy tab.
    ADOBE_DATA (no Caption)
    - (Master pages)(no caption)
             Page1
                      Untitled Content Area(no caption)
    - Mainform(no Caption)
                       PSPID {PSPID}
              -ItemTable (No caption)
                      - ItemtableRow (no Caption)
                                   PSPID(no Caption)
                                    CJTDAT(no Caption)
                                    CPERCO(no Caption)
    What could be going wrong ?
    Rgds
    Vara

    Hi John,
    In the WD4A view, there is a button "Show/Hide Layout Preview".
    Click on that button to be able to see the Layout.
    Note that this button is next to the Pretty Print button.
    regards,
    Reema.

  • 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

Maybe you are looking for

  • ITunes 7.5 and old iPOD? iPOD will not update to 1.5 and no longer syncs

    Hi, I'm new to updating Macs, and I think i may have installed something that won't work with old stuff. I have the following: A PowerBook G4 (2002) just updated to Leopard (never had any updates before!) A touchwheel 10 GB iPOD (2nd gen) never updat

  • Sql query from plsql type or temp variable

    Hi, I have no rights to create or drop table in the production But I want to see the data after processing this is multi record data which may need to store in the table or plsql type variable. What should I do In this case ? For ex. I will pass My n

  • Connecting Macbook to printer in wireless network

    I recently got a Macbook. I have a pc downstairs that is connected to an HP officejet printer, and one upstairs connected to the same printer via the wireless network. My Macbook uses the same wireless network but I don't know how to find and connect

  • The search for a perfect design pattern

    The search for a perfect design pattern I am searching tip to upgrade a labview program used. I am looking for the best approach to make my program more robust and scalable.Software and hardware.  Today the system consists of : GPS, weather station,

  • Sunpci2 with solaris 10

    Hello everybody! I have following question please: I am working on a Sun Blade 100 with Solaris 10. In this blade a SUNpci2 card exists. So, is it possible to use this card? I tried SUNWspci2 (2.3), but I got some errors. I tried to patch it, but it