Select options values pass to function module

Hi all,
        I want to pass the values entered in the select options to the function module. How should my function module interface be declared for passing the select options
I tried declaring like
t_range type data in the tables tab.  But this throws error. 
Please let me know how to pass select option values back to function modules.
Thanks,

Hi,
Check this code.
data: node_flights type ref to if_wd_context_node.
data: rt_carrid type ref to data.
data: rt_connid type ref to data.
data: isflight type table of sflight.
data: wsflight type sflight.
field-symbols: <fs_carrid> type table,
<fs_connid> type table.
Retrieve the data from the select option
rt_carrid = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'S_CARR_ID' ).
if rs_carrid is not initial.   Here you can check that if rs_carrid is no initial then assign value of field symbol
Assign it to a field symbol
assign rt_carrid->* to <fs_carrid>.
endif.
Retrieve the data from the select option
rt_connid = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'S_CONN_ID' ).
if rt_connid is not initial. Here you can check that if  rt_connid is no initial then assign value of field symbol
Assign it to a field symbol
assign rt_connid->* to <fs_connid>.
endif.
if  <fs_connid> is not initial and <fs_carrid> is not initial.
Retrieve that data from the database. Normally it is suggested to
encapsulate the data retrieval in a separate class.
For simplicity, the SELECT statement has been implemented here.
clear isflight. refresh isflight.
select * into corresponding fields of table isflight from sflight
where carrid in <fs_carrid>
and connid in <fs_connid>.
endif.
Bind the data to the context
node_flights = wd_context->get_child_node( name = `FLIGHTS` ).
node_flights->bind_elements( isflight ).
Hopes this will helps you.
Regard
Manoj Kumar
Edited by: Manoj Kumar on Mar 16, 2009 10:41 AM

Similar Messages

  • Select-option parameter passed to function module

    hi,
    I have passed the select-option parameter as a table to my function module,
    suppose i have passed it as date(it contains field date-high and date-low)
    In my function module while i am looping the table and selecting the data according to date_low,it is going to select only the data according to date_low.
    since the table contains only one row.
    loop at date.
    select the data according to date_low.
    date_low = date_low +1.
    modify date_low.
    endloop.
    how can i select all the data from date_low and date_high?

    Hi,
    there is issue  design of ur FM .
    You have to put 2 table parametrs or 2 import paremeters in the FM ,after that with in the Function module fill the internal table of type ranges (say itab).
    After filling the ranges internal table, this can be used in ur select stament just as select option ( select ...where podat in itab)
    revrt back if any issues.
    regards,
    Naveen

  • HOW  TO PASS SELECT-OPTIONS PARAMETER TO A FUNCTION MODULE.

    Hi friends.
    HOW DO U PASS A SELECT-OPTIONS PARAMTER TO A FUNCTION MODULE AS ITS IMPORT PARAMETER(IN MY CASE rfc fM) .
    Really urgent!!!
    thanks to one and all

    Hi,
    If you are passing a single value, its better you take it from s_option-low or s_option-high (select options).
    Else if you are passing values to the FM in a loop for all select option values, then better you declare an internal table with type <b>WSELKUNNR</b>.
    get low & high fields from each row & pass them.
    It will make you clear when you check out your select options in debug mode by entering different combinations of inputs.

  • Passing Select-options as parameter to function module

    I need to pass a select-option as a parameter to a function module. Is this possible?
    There is an option of passing all the values of the select-option to an internal table, passing that internal table as parameter to the function module, and then adding it manually again to a select-option in the function module.
    But is there any direct way to do this?

    Hi,
    I have a similar problem: I have RFC function module to which I want to pass select options. Therefore I defined table parameters as follows:
    IT_RUNID     TYPE     EFG_TAB_RANGES
    IT_PERNR      TYPE     EFG_TAB_RANGES
    IT_REINR     TYPE     EFG_TAB_RANGES
    I can successfully pass my values to the module, but if I try to check these parameters
    using
    CHECK IT_TRIPS-RUNID IN IT_RUNID.
        CHECK IT_TRIPS-PERNR IN IT_PERNR.
        CHECK IT_TRIPS-REINR IN IT_REINR.
    the check always fails, I guess because there are leading zeros in the ranges. Is there a way to solve this problem?
    Thanks and regards,
    Martin

  • Enabling Select-options in an RFC function module

    Hi Abaper's,
    I am using BAdi definition NOTIF_EVENT_SAVE for sending mail notification to user.
    Under CHANGE_DATA_AT_SAVE method I have called an RFC enabled function module and written code here for mail notification.I used cl_bcs class for sending file.On executing this I am getting a mail box wherein we can enter user id and send mail.But I don't want to use cl_bcs for sending mail now.So I modified the code by including SO_NEW_DOCUMENT_SEND_API1 function.
    My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master.On activating I am getting following error:
    Local SELECT-OPTIONS are not allowed (FORM routine or GET event is active).
    Can any one help me how to resolve this error?
    I am using this customized function module for mail notification.If I hardcode mail id,notification is working properly.
    Regards,
    Sam

    sam24 wrote:>
    > My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master
    Hi Sam,
    in the function groups TOP include, you can define a selection-screen:
    SELECTION-SCREEN BEGIN OF SCREEN 9786 [TITLE title].
    select-options: s_uname for ...
    SELECTION-SCREEN END OF SCREEN 9786.
    and in the function use
    CALL SELECTION-SCREEN dynnr
                          [STARTING AT col1 lin1
                          [ENDING   AT col2 lin2]]
    Everything declared in the function body source code is local.
    But you must make sure that CHANGE_DATA_AT_SAVE is not processed in update task.
    Regards,
    Clemens
    Edited by: Clemens Li on Jan 16, 2011 7:36 PM

  • Passing SELECT-OPTIONS value to Function Module

    Hi,
    I need to pass select-options value to a function module.
    Code is like the following:
    SELECT-OPTIONS seltab FOR object-type.
    CALL FUNCTION 'Z_MY_FM'
          EXPORTING
            sel_tab         = seltab
         IMPORTING
            result_tab     = it_result
    I have found a similar problem in the SDN forum: How to pass select-options parameter to FM?
    However, that could not help me much in solving my problem.
    So far I have tried to created a structure in DDIC with the following components for the select-options:
    SIGN - BAPISIGN
    OPTION - BAPIOPTION
    LOW - ZBWOBJECTTYPE (my type)
    HIGH - ZBWOBJECTTYPE (my type)
    and subsequently a table type for this structure which is specified in the "Import" tab of my function module.
    Unfortunately, when I ran the program a runtime exception occured (CALL_FUNCTION_CONFLICT_TYPE).
    Could anyone please help me on this issue?
    Thanks in advance.
    Regards,
    Joon Meng

    Hello Joon,
    CALL FUNCTION 'Z_MY_FM'
          EXPORTING
            sel_tab         = seltab
         IMPORTING
            result_tab     = it_result
    You have defined SELTAB as a SELECT-OPTION.
    So when you pass only SELTAB, the header line is transferred to the FM. When you pass SELTAB[] the whole table(range) is passed.
    It is similar to the concept of an internal table with header line.
    Hope i am clear.
    Anyways how have you defined result_tab and sel_tab ?
    BR,
    Suhas

  • Select option how to pass in Function Module

    Hi  Friends
    how to pass direct select-option values in a Function Module and  later how to retrive the values from FM as well ?
    Regards
    Meeta

    Hello Meeta
    You may use a generic table type like RSELOPTION or RSDSSELOPT_T. However, this requires that you shuffle the data from twice from your specific select-options to this generic select-option and vice versa.
    A much simpler way is to import the name of the report from which you want to retrieve its select-options into the function module and within the fm just call fm RS_REFRESH_FROM_SELECTOPTIONS.
    Regards
      Uwe

  • How to pass select option value to function module while using service call

    Hi,
    I have select-option in my WD application. To collect data based on user input im using service call. How to pass this select option values to my RFC.
    rgds
    sudhanshu

    Hi,
    Thank s for your reply. In fact im doing similar with following variation:
    i) collected range values using get_range* method.
    ii) separate low and high values as: 
    read table <field2> index 1 into wa_range.
    vert2_low = wa_range-low.
    vert2_high = wa_range-high.
    (Please note that in RFC I have taken two importing parameter as s_vert_lo and s_vert_hi)
    iii) Now setting these RFC attribute as:
    lo_el_importing->set_attribute(
        EXPORTING
          name =  `S_VERT_LO`
          value = vert2_low ).
    and
    lo_el_importing->set_attribute(
        EXPORTING
          name =  `S_VERT_HI`
          value = vert2_high ).
    iv) In RFC im having my query as :
    select <fld list> from BUT000 into table itab where vertical in r_vert.
    Here, r_vert is a range defined as:
    ranges r_vert for <fld refrence>
    r_vert-sign = 'I'.
    r_vert-option = 'BT'.
    r_vert-low = S_VERT_LO.
    r_vert-high = S_VERT_HI.
    append r_vert.
    Issue here is with ranges. if im passing both low and high values it is fine but if only low value being passed it is not giving me any record.
    Please suggest.
    Rgds
    Sudhanshu

  • How can we pass the select-option value to modulepool program?

    hi,
      how can we pass the select-option value to modulepool program ?
      Because if i declared select-options in executable program and i used SSCRFIELDS to define push buttons in selection screen.
               My requirement if enter the values to select-options and press UPDATE pussbotton then i want call screen which contains tablecontrol.
               How i get select-option values to PAI of call screen for getting the data from database table to my internal table?

    Oh I thought that you have selection-screen and again you are working on dialog programming.
    if you want to use select-option directly in module pool then it is not possible.
    but you can do other way.
    create two varaiables
    data : v_kun_low like kna1-kunnr,
             v_kun_high like kna1-kunnr.
    use these two variables in layout ,let user knows that he can not give options like gt,lt,eq ,it will be always BT.
    and also when you see normal report program,you can use multiple values in either low or high,but here it is not possibel.
    use can enter only low value and high value.
    when you come to program point of view
    declare one range
    ranges r_kunnr for kna1-kunnr.
    do the coding like
    r_kunnr-low = v_kun_low.
    r_kunnr-high = v_kun_high.
    r_kunnr-options = 'BT'.
    r_kunnr-sign = 'I'.
    append r_kunnr.
    now you can use r_kunnr in select query ,it will work like select-option.
    other than this there is no option.
    Thanks
    Seshu

  • Passing select-options value in method

    How to pass select-options value in method ?
    Example:
    Select-options: carrid for spfli-carrid.
    class cl_myclass implementation.
    select  carrid connid from
    spfli where carrid in carrid.
    endclass.
    Thanks

    Hello Anee
    The coding of this functionality is quite simple:
    REPORT zmy_report.
    DATA:  go_myclass   TYPE REF TO zcl_myclass,
               gd_repid         TYPE syst-repid.
    PARAMETERS:
      p_bukrs   ...
    SELECT-OPTIONS:
      o_kunnr  ...
    START-OF-SELECTION.
      gd_repid = syst-repid.
      CREATE OBJECT go_myclass
        EXPORTING
          id_calling_program = gd_repid.
    And that's how your CONSTRUCTOR method should look like:
    METHOD constructor.  " IMPORTING parameter id_calling_program
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
      EXPORTING
        CURR_REPORT = id_calling_report
      TABLES
        SELECTION_TABLE = me->mt_selopts.
    " NOTE: define mt_selopts as instance attribute of table type RSPARAMS_TT
    ENDMETHOD.
    Finally you have to extract the parameter and select-options from MT_SELOPTS.
    Regards
      Uwe

  • Passing select-options values using call transaction method

    Hi Experts,
    I have a scenario in which i have three fields BUKRS,WERKS and MATKL in an internal table i_tab and I have MATNR as a selection-option.
    After this I have to use call transaction <tcode> for all the line items in the internal table and the MATNR select-option values I have to pass directly for each line of i_tab using call transaction method.
    TYPES:  BEGIN OF t_tab,
              bukrs TYPE bukrs,
              werks TYPE werks_d,
              matkl TYPE matkl,
            END OF t_tab.
    DATA:  w_tab TYPE t_tab,
                i_tab      TYPE STANDARD TABLE OF t_tab.
    SELECT-OPTIONS: s_matnr FOR marc-matnr.
    Now I am putting a loop at i_tab and have to use CALL TRANSACTION <TCODE> for each line with the SELECT-OPTIONS for MATNR.
    Please tell me whether we can pass multiple ranges for MATNR using call transcation method.
    for example there can be multiple single values/multiple ranges/excluded ranges for MATNR. so please suggest me how tho achieve this sceanrio using CALL transaction method of BDC.
    Thanks a lot.
    Regards,
    Krishan

    Hi Krishan,
    For the Call transaction TCODE there is extension ....OPTIONS from OPT. Just Check it out. I think it is possible like this.
    ... OPTIONS FROM opt
    *Effect*
    This addition gives you control using the values of the components of the structure opt, which must be of the Dictionary type CTU_PARAMS. The components have the following meaning:
    DISMODE
    Processing mode (comparable with the MODE addition)
    UPDMODE
    Update mode (comparable with the UPDATE addition)
    CATTMODE
    CATT mode (controlling a CATT procedure)
    The CATT mode can have the following values:
    ' ' No CATT procedure active
    'N' CATT procedure without single screen control
    'A' CATT procedure with single screen control
    DEFSIZE
    Use standard window size
    RACOMMIT
    COMMIT WORK does not end CATT procedure
    NOBINPT
    No batch input mode, that s SY-BINPT = SPACE.
    NOBIEND
    No batch input mode after BDC data has been read
    The components DEFSIZE , RACOMMIT, NOBINPT, NOBIEND always take the following values:
    'X' Yes
    ' ' No
    If the OPTIONS addition is omitted, the following settings are valid for the control parameters:
    DISMODE from the MODE addition
    UPDMODE
    from the UPDATE addition
    CATTMODE
    No CATT procedure active
    DEFSIZE
    Do not use standard window size
    RACOMMIT
    COMMIT WORK ends procedure successfully
    NOBINPT
    Batch input mode, that is SY-BINPT =X.
    NOBIEND
    Batch input mode also active after BDC data has been read
    Regards,
    Swapna.

  • Query in passing value to a function module

    Hi All ,
    I have a small query in the below code about the way i have passed value into a function module :
    CALL FUNCTION 'AUTHORITY_CHECK'
      EXPORTING
      USER                      = SY-UNAME
        OBJECT                    = 'E_INVOICE'
        FIELD1                    = 'BEGRU'
      VALUE1                    = ' '
       FIELD2                    = 'BUKRS'
       VALUE2                    = '$BUKRS'
       FIELD3                    = 'ISU_ACTIVT'
       VALUE3                    = '1,2,5,6'
       FIELD4                    = 'VKTYP_KK'
      VALUE4                    = ' '
    EXCEPTIONS
       USER_DONT_EXIST           = 1
       USER_IS_AUTHORIZED        = 2
       USER_NOT_AUTHORIZED       = 3
       USER_IS_LOCKED            = 4
       OTHERS                    = 5
    IF SY-SUBRC <> 0.
    MESSAGE 'User doesnt have sufficient authorizations' TYPE 'E'.
    EXIT.
    The query is on the field  VALUE3                    = '1,2,5,6' , is the format correct. If this is not right could someone please suggest the correct approach.
    thanks

    Hi Balaji,
    as that is parameter you can use at a time only one value..
    if you check in that FM we have other parameters VALUE1 to VALUE10..
    why don't you use those...
    Thanks!

  • Select option value

    Hi all,
    I need to pass select-option field value to a function module and get the output for each value present in selection screen.
    selection options can contain for more the one value,i need to pass those all one bye one to the function module.
    Please suggest on that.
    Thanks
    Mohit

    Hi,
    What Function Module are you calling ?
    You can loop at select option like:
    loop at s_variable.
    *--here you have values form s_variable-low and s_variable-high
    *--call FM here
    endloop.
    Thanks & Regards,
    Navneeth K.

  • Select-option value is not getting captured in at selection-screen on value

    In Selection screen , we have Select-option and  a parameter.
    Based on the values given in Select-option, the values of Parameter should get populate.
    To achieve this functionality,
    I  used  At selection u2013screen  on value request  for <parameter>  EVENT and 'F4IF_INT_TABLE_VALUE_REQUEST' Function Module.
    But the Select-option values are not getting captured in this event,unless u press Enter key.
    Is there any other way to achieve this functionality.
    Please Guide me.

    When you call function 'F4IF_INT_TABLE_VALUE_REQUEST'. make sure you send it the name of the screen variable - the F4IF_INT_TABLE_VALUE_REQUEST function calls DYNP_VALUES_READ itself if you tell it the name of your report, screen number, and the variable name... snippet below.
    Jonathan
      data:
        l_repid             type syrepid.
      l_repid = sy-repid.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          dynpprog         = l_repid
          dynpnr           = '1000'
          dynprofield      = 'S_FIELD-LOW'  "Select options - low value
    * etc

  • Wt parameters to pass in  function module for particular kunnr fld

    wt parameters to pass in  function module f4if_int_table_value_request which is mostly preferred in reports instead of search help
    for eg i use select-options s_kunnr for kna1-kunnr & prepare i internal table it_kna1.
    den how 2 pass s_kunnr fld & it_kna1 in dat above FM for creating f4 functionality for particular s_kunnr fld on selection-screen.
    plz send me d code urgently

    Check below code....
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.

Maybe you are looking for

  • Custom Formatting using narratives

    Hi, I am tying to create a report that will display a "quote" based on data from an opportunity. I am using narrative sections that contain custom HTML to handle the layout of the report. This method works fine when viewing the report on line but if

  • Display resolution issues

    i have a mac mini and have a problem with the display resolution but if i use the guest account it works fine any help would be appreciate   thanks...

  • Best way to acquire data from both serial port and D/A board in real time?

    In my experiment, I have 2 kinds of data: analog and digital. Now, I have to write a programme to acquire both data not only in real time but also in sychronicity. My colleague tried to write a program for this purpose. However, the digital part was

  • Preview slow down

    I am creating 200 page documents by collecting pages from various pdfs. The file size is 100MB. I upgraded my RAM to 16GB with no significant change. Preview stops my ability to scroll through the pages as I get to making the document larger. Any sug

  • Should i ask for a replacement

    I only get about 9 hours total out of the 12 60%brightness,using safari listening to pandora, scrolling through facebook, and plenty of time idling (the screen is left on a page, for example pandora.com while i do homework, screen is still on but use