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.

Similar Messages

  • How to pass select-option filed to Function Module Exporting Parameter

    Hi,
        How to pass select-option filed to Function Module Exporting Parameter.
    Thanks

    Hi,
    DATA: BEGIN OF ITAB5_WRK OCCURS 0,
            KUNNR     TYPE KNKK-KUNNR,  "CUSTOMER #
            SBGRP     TYPE KNKK-SBGRP,  "CREDIT REP
            KLIMK     TYPE KNKK-KLIMK,  "CREDIT LIMIT
            NAME1     TYPE KNA1-NAME1,  "CUSTOMER NAME
            SKFOR     TYPE KNKK-SKFOR,  "TOTAL A/R
            AMT1      TYPE KNKK-SKFOR,  "CURRENT
            AMT2      TYPE KNKK-SKFOR,                          "01-30
            AMT3      TYPE KNKK-SKFOR,                          "31-60
            AMT4      TYPE KNKK-SKFOR,                          "61-90
            AMT5      TYPE KNKK-SKFOR,                          "91-120
            AMT6      TYPE KNKK-SKFOR,                          "OVR 120
            BZIRK     TYPE KNVV-BZIRK,
          END OF ITAB5_WRK.
    SELECT-OPTIONS P_COMP     FOR  T001-BUKRS
      SELECT KUNNR SBGRP  FROM KNKK
             INTO TABLE ITAB5_WRK
             WHERE SBGRP IN P_REP
               AND KUNNR GE '0001000000'
               AND SKFOR NE 0.
      LOOP AT ITAB5_WRK.
        DELETE ADJACENT DUPLICATES FROM ITAB5_WRK COMPARING KUNNR.
      ENDLOOP.
      PERFORM GET_CREDIT_LIMITS.
    *=======================================================================
      IF P_DIST NE SPACE.
        LOOP AT ITAB5_WRK.
          SELECT SINGLE * FROM KNVV WHERE KUNNR EQ ITAB5_WRK-KUNNR
                                      AND VKORG EQ P_COMP
                                      AND VTWEG EQ '20'
                                      AND SPART EQ '10'
                                      AND BZIRK IN P_DIST.
          IF SY-SUBRC EQ 0.
            MOVE KNVV-BZIRK TO ITAB5_WRK-BZIRK.
            MODIFY ITAB5_WRK.
          ELSE.
            DELETE ITAB5_WRK.
          ENDIF.
        ENDLOOP.
      ENDIF.
    *==============================================================
      LOOP AT ITAB5_WRK.
        MOVE: 'F/S'            TO WRK-KKBER,
               ITAB5_WRK-KUNNR TO WRK-KUNNR.
        PERFORM AGING.
        ADD: W_SNFAE  TO ITAB5_WRK-AMT1,
             W_SFAE1  TO ITAB5_WRK-AMT2,
             W_SFAE2  TO ITAB5_WRK-AMT3,
             W_SFAE3  TO ITAB5_WRK-AMT4,
             W_SFAE4  TO ITAB5_WRK-AMT5,
             W_SFAE5  TO ITAB5_WRK-AMT6,
             W_SFAEL  TO ITAB5_WRK-SKFOR,
             W_SNFAE  TO ITAB5_WRK-SKFOR.
        MOVE: 'SPEC'            TO WRK-KKBER,
               ITAB5_WRK-KUNNR TO WRK-KUNNR.
        *PERFORM AGING.*
        ADD: W_SNFAE  TO ITAB5_WRK-AMT1,
             W_SFAE1  TO ITAB5_WRK-AMT2,
             W_SFAE2  TO ITAB5_WRK-AMT3,
             W_SFAE3  TO ITAB5_WRK-AMT4,
             W_SFAE4  TO ITAB5_WRK-AMT5,
             W_SFAE5  TO ITAB5_WRK-AMT6,
             W_SFAEL  TO ITAB5_WRK-SKFOR,
             W_SNFAE  TO ITAB5_WRK-SKFOR.
        MODIFY ITAB5_WRK.
      ENDLOOP.
    FORM AGING.
      *CALL FUNCTION 'CUSTOMER_DUE_DATE_ANALYSIS'* 
      EXPORTING
          BUKRS             = P_COMP           
          KKBER             = WRK-KKBER
          KUNNR             = WRK-KUNNR
          RASID             = 'FEND'
          KLIMP             = 'X'
        IMPORTING
          SFAE1             = W_SFAE1
          SFAE2             = W_SFAE2
          SFAE3             = W_SFAE3
          SFAE4             = W_SFAE4
          SFAE5             = W_SFAE5
          SFAE6             = W_SFAE6
          SFAEL             = W_SFAEL
          SNFA1             = W_SNFA1
          SNFA2             = W_SNFA2
          SNFA3             = W_SNFA3
          SNFA4             = W_SNFA4
          SNFA5             = W_SNFA5
          SNFA6             = W_SNFA6
          SNFAE             = W_SNFAE
        EXCEPTIONS
          NO-AGING_SCHEDULE = 1
          NO_TABLE_INPUT    = 2.
      CASE SY-SUBRC.
        WHEN 1.
          MESSAGE E999 WITH 'PLEASE ENTER AGING SCHEDULE'.
        WHEN 2.
          MESSAGE E999 WITH 'DO NOTHING ??'.
      ENDCASE.
    ENDFORM.                    "AGING
    Thanks

  • 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.

  • How to Pass Select-options Single values as Parameter value to Method ?

    Hi Friends,
    I need to pass select-options values(single values) for s_arbpl to the method "process_percent_planned". Now all single values are in internal table s_arbpl-low field. I need to pass this internal table(s_arbpl-low) values to the method where i will run query based on these single values.In my below code i am passing value through variable w_arbpl. I have defined this parameter in the method.But here only one value is passed to method. I want multiple single values (in s_arbpl-low) should be passed. Please let me know how to correct code.
    Tables: crhd.
    Data: ktext type auftext,
    w_arbpl type arbpl.
    select-options: s_arbpl for crhd-arbpl.
    ktext = 'Test'
    create object obj_plan.
    call method obj_plan->process_percent_planned
    exporting
    ktext = ktext
    w_arbpl = s_arbpl-low.
    Thanks

    hi ,
    when you want to pass  S_ARBPL AS PARAMETER IN SELEC OPTION
    ARBPL SUCH AS  
       WIN002
      WIN003
      WIN004
      WIN005
      WIN006
      WIN007
    IN MULTIPLE SELECTION  S_ARBPL
    THEN
    USE  
    Tables: crhd.
    Data: ktext type auftext,
    w_arbpl type arbpl.
    select-options: s_arbpl for crhd-arbpl.
    ktext = 'Test'
    LOOP AT S_ARBPL .
    create object obj_plan.
    call method obj_plan->process_percent_planned
    exporting
    ktext = ktext
    w_arbpl = s_arbpl-low.
    ENDLOOP.
    REGARDS
    dEEPAK .
       THEN SELECT THAT
    call method obj_plan->process_percent_planned
    exporting
    ktext = ktext
    w_arbpl = s_arbpl-low.

  • How to pass select-option variable in function

    hi ,
    select-option : s_akont for KNB1-akont OBLIGATORY.
    i have to pass s_akont in function without using
    s_akont-low & s_akont-high.
    rightnow i am passing like s_akont but it is giving me a error :
    s_akont is followed by niether by an internal table nor by a value list.
    what should i write.
    regards
    raj

    Hello Raj
    I assume that you want to import your select-options into your function module(s). Since select-options are, by default, itabs with header lines you have to pass your select-options as following:
    CALL FUNCTION 'Z_...'
      TABLES
        it_selopt = s_akont[].
    The TABLES parameter it_selopt could be of type ANY or better of type <b>TABLE</b>.
    If you want to use generic select-option structure you can use <b>RSDSSELOPT</b> and the table type <b>TT_RSDSSELOPT</b>. In this case you would need to copy your select-options from s_akont to a generic type s_generic (of type RSDSSELOPT).
    Regards
      Uwe

  • Passing select option parameter to a procedure

    Hello, i need to know pass a select option parameter to a procedure. I tried the following
    For eg if i have a select option called so_belnr & i call the procedure using the following
    PERFORM VALIDATE_DOCUMENT TABLES SO_BELNR USING GJAHR BUKRS  , i still cannot use the
    select option paramter in the called procedure.
    Pls help.

    Hi,
    in topinclude...
    data: lr_belnr type RNG_BELNR.
    at start-of-sel.....
    move so to range..
    refresh: lr_belnr.
    lr_belnr[] = so_belnr[].
    PERFORM VALIDATE_DOCUMENT TABLES lr_belnr USING GJAHR BUKRS .
    in form:
    ...   tables lr_belnr like structure of RNG_BELNR.
    reason(my definietion): perfom doesn´t know if the select-options is availible.....
    bestreg
    Robert

  • 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 to pass select-options variable to a form.

    I have a select-options variable smatnr. I need to pass this select-options variable to a form by
    perform using smatnr changing svar.
    form cond_types using pmatnr changing svar.
    IT gives an error saying imcompatible types been passed between smatnr and pmatnr.
    Any ideas, what is wrong. How do I pass a select-option variable into a form the right way.
    Thanks
    Ram

    Try like this:
    TABLES: vbak.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    START-OF-SELECTION.
      PERFORM get_data USING s_vbeln[].
    *&      Form  get_Data
    FORM get_data  USING  p_s_vbeln LIKE s_vbeln[].
    ENDFORM.                    " get_Data
    Regards,
    Naimesh Patel

  • How to pass select-options to the Adobe Form?

    Hello Experts,
    I am facing an issue on passing the SELECT-OPTIONS from driver program to Adobe Form .I created a structure which holds sign,Option,Low and High fields, assigned to the  table type and passed to the form,Its going dump can anyone resolve the issue.
    Regards,
    Girish Kumar vedurupaka.

    Hello simi ,
    Using se11 created a structure for select-options the created a table type for that structure. I pass that table type to the importing parameter in the form interface.
    in the Global data:
       IT-MARA TYPE TY_MARA.
    IN TYPES :
    TYPES :BEGIN OF ty_mara1,
             MARA TYPE MARA,
             ERSDA TYPE  ERSDA,
             ERNAM  TYPE ERNAM,
             LAEDA  TYPE LAEDA,
            END OF TY_MARA1.
      TYPES TY_MARA TYPE TABLE OF TY_MARA1.
    IN CODE  INITIALIZATION  I WRITE THE SELECT STATEMENT.
    SELECT MATNR ERSDA ERNAM FROM MARA INTO TABLE IT_MARA
    WHERE MATNR IN S_MATNR.
    in the driver program exported the S_MATNR to the the form.
    when i am executing the program and giving the range in S_MATNR values are not importing and and going to dump.  

  • How to pass select-options in key while using Read Statement.

    Hi SAP gurus,
    I was using a select stmt. with were clause of Select-options it was working fine,
    now my scenerio is changed i need to read an internal table
    with key of select-options....
    how to read internal table with key S_MATNR (Select-options).

    Hi,
    We can certainly do this.
    We need to loop the internal table with select-options condition.
    Example  :
    LOOP AT ITAB WHERE FIELD =  S_FIELD.
    ENDLOOP.
    This should solve your problem.
    Plz reward if useful.
    Thanks,
    Dhanashri.

  • 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

  • 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-option to Function Module

    Hi ,
         I want to pass a select-option directly to the function Module tables parameter . Can anyone highlight on how i can declare the table in Function module side .
    Thanks & Regards,
    Raj

    Hi.
    In the TABLES tab of the specific FM ,
    give the parameter name ( which u have defined as Select options ). Since select options is like an Internal Table with values sign,option,low and high , u can give it here.
    Also give the ref. type and type specification.
    Pl try this.
    Thanks,
    Maheshwari.V

  • How to transfer select options variable

    Hello:
    I can pass parameter to parameter id such as p_fikrs, but how to transfer select options parameter to parameter id such s_fictr.
    SET PARAMETER ID 'FIK' FIELD p_fikrs.
    SET PARAMETER ID 'FIS' FIELD s_fictr.
    SET PARAMETER ID 'FPS' FIELD s_fipex.
    SET PARAMETER ID 'GJR' FIELD p_year.
    CALL TRANSACTION 'FMRP_RFFMEP1BX' AND SKIP FIRST SCREEN.
    Thank you very much!

    Use SUBMIT with the following option
    SUBMIT... USING SELECTION-SCREEN scr
    Effect
    When you execute the report, the system uses the selection screen number that you specify in the scr field. This must be a selection screen defined using the SELECT-OPTIONS, PARAMETERS and SELECTION-SCREEN statements.If you omit the addition, the system uses the standard selection screen 1000.
    This addition allows you to start the same report in different situations, using a different selection screen each time.
    Notes
    The addition VIA SELECTION SCREEN determines whether the report is processed in the foreground or the background.
    What happens if the required screen does not exist or is not a selection screen?
    Screen 1000:
    If you want to use the standard selection screen (... USING SELECTION-SCREEN 1000 or do not specify a ... USING SELECTION-SCREEN) addition, the system does not process a selection screen.
    Other selection screens:
    The system triggers a runtime error.
    Hope dis helps,
    Reward if it does

Maybe you are looking for

  • Printing problem with emails - scaling issue

    Hi everyone, I'm having a printing problem when I print out my emails. Under the email preferences, the scaling is set to 100%, but the actual printouts look to be about 30%. I have no other problems with any other applications (documents, web pages,

  • Cannot find Fiori Backend Role

    Dear expert, I'm implementing Fiori wave 2 Leave Request Approval and Purchase Order Approval for customer. The customer is using ERP EHP6, thus we installed GBAPP002 and GBHCM003 on the backend. Both the components are at the latest patch. However c

  • Best approach for adding configurations to deployed system

    I have been using Property Loader steps to accomplish three things on a deployed system: Define equipment ID,s calibration, slots, etc. for the hardware of the deployed system Define behavior for the deployed system station (paths, test multiple vers

  • Full optimize with Compress DB throws error

    Hi, We are using SAP BPC 7.0 MS version... We have an SSIS package scheduled every morning for a Full Optimize with Compress DB. For the past few days this package had been failing after running for 2 hours, with the following error message : [Error]

  • Rule BNK_STR_BATCH_RULE_ATTRIB not found -- Error - SEPA Direct Debit --

    Hi All, I am trying SEPA Direct Debit. I created payment run through F110, and in the log there is a message "Payment run 09/29/2010 ZABK is intended for cross-payment run payment media". So I ran program SAPFPAYM_MERGE, I got the message *Rule BNK_S