Select option as parameter in FM.

Ho to pass select options as a parameters in function module.

There are ways to do it...
In the Function module using the Table parameter you can do it.
Have a table parameter to hold the select option , Don't type refer to any DDIC structure or field.
In the implementation of the function module you can do some thing like this,.
"example you want to pass matnr select option
data: r_selopt type range of matnr.
data: wa_opt like line of r_selopt.
r_selopt = table_param[].
in the call function side you pass the select option directly to the table parameter directly.
call function 'ZTEST_FUNCTION_SLECTOPTION'
tables
table_param = s_matnr.

Similar Messages

  • Select-option or parameter with display mode

    hai experts,
    i need to give select-option or parameter with display mode in selection-screen.
    my requirement is.......
    to give last print out time in selection screen with display mode mean user cant able to change the time......
    reward avail for hope ful answer.....
    thanks in advance...
    regards,
    jai.m

    Hi jaya,
    write the following code.
    parameters: p1 type c.
    initialization.
    p1 = 'c'.
    at  selection-screeen output.
    loop at screen.
           if screen-name = 'P1'.
              screen-input = '0'.
              modify screen.
           endif.
    endloop.
    regards,
    Santosh Thorat

  • 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

  • Select options and parameter

    We have a parameter and select option in Selection Screen, by using the parameter and select option in the select query, with out passing the any values to the Parameter and SO, how we will get the records?

    hi check this..
    if the parameter is empty if will not work in the select statement..you can get the values for the select options with empty structures..
    check this..
    tables:mara .
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab .
    parameters:p_matnr like mara-matnr.
    select matnr  from mara into table itab
    where matnr  = p_matnr.
    loop at itab.
    write:/ itab-matnr.
    endloop.
    it will not fetch data..
    for select-options
    tables:mara .
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab .
    select-options:s_matnr for mara-matnr.
    select matnr  from mara into table itab
    where matnr  in s_matnr.
    loop at itab.
    write:/ itab-matnr.
    endloop.
    it will fetch data..
    regards,
    venkat

  • Select option and parameter.

    I have select options and parameters in my selection screen. While extracting the data I am using both the select option and a parameter in where condition.  But that select statement is not returning any data. Could any body tell me what might be the reason.
    Thanks,
    bsv.

    Hi,
      See this example code it works.
    tables spfli.
    parameters p_carrid type spfli-carrid obligatory.
    select-options s_connid for spfli-connid.
    data itab type table of spfli with header line.
    select *
       from spfli into table itab
    where carrid eq p_carrid
       and connid in s_connid.
    loop at itab.
      write: / itab-carrid,
               itab-connid.
    endloop.
    Note : Dont leave blank for parameters because it take as space and when you select from table it is unsuccessful.
    Plzz Reward if it is useful,
    Mahi.

  • If checkbox is checked, put values in select-options and parameter...

    Hello Experts,
    Based on my selection-screen below, How do I fill p_eindt and p_monat with values if
    the user clicked on the checkbox p_end? Below is my selection-screen:
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
    PARAMETER: p_bukrs TYPE bukrs OBLIGATORY.
    SELECT-OPTIONS: p_werks FOR wa_ekpo-werks OBLIGATORY NO INTERVALS,
                    p_bsart FOR ekko-bsart OBLIGATORY NO INTERVALS,
                    p_eindt FOR eket-eindt OBLIGATORY,
                    p_ebeln FOR ekko-ebeln.
    PARAMETER: p_monat TYPE monat OBLIGATORY,
               p_gjahr TYPE gjahr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK 1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETER: p_end AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN END OF BLOCK b2.
    Hope you can help me guys.Thank you and take care!

    Hi,
      For F4 help for any input value in selection screen u can use:
    Ex:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_eidnt-LOW.
      SELECT DISTINCT edint INTO TABLE IT_ab FROM <tablename>..
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
    DDIC_STRUCTURE         =
         RETFIELD               = 'eindt'
        PVALKEY                = ' '
         DYNPPROG               = W_REPID
          DYNPNR                 = W_DYNNR
         DYNPROFIELD            = 'p_eindt-LOW'
        STEPL                  = 0
          WINDOW_TITLE           = 'Plant'
        VALUE                  = ' '
          VALUE_ORG              = 'S'
        MULTIPLE_CHOICE        = 'X'
        DISPLAY                = ' '
        CALLBACK_PROGRAM       = ' '
        CALLBACK_FORM          = ' '
        MARK_TAB               = 'X'
      IMPORTING
        USER_RESET             =
        TABLES
        VALUE_TAB              = it_abc
        FIELD_TAB              =
        RETURN_TAB             = IT_RETURN
        DYNPFLD_MAPPING        =
    EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 2
       OTHERS                 = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Try this.
    Regards,
    Vani.

  • Dynamic select-options using parameter

    Hi experts,
    It the user selects one value from dropdown list, it should generate one select-option using that name. Is it possible?
    for example, (pls see my code).
    If user selects 'Malek' from parameter, <b>and press 'ENTER'</b>
    <b>select-option should display with that name</b> like
    Malek      malek-low  malek-high
    And if user selects some other like 'Amran'. It should generate(and append)
    Malek      malek-low  malek-high
    amran      amran-low amran-high
    and so on....
    report c.
    data: t_return like ddshretval occurs 0 with header line.
    data: begin of t_names occurs 0,
           name like usr01-bname,
          end of t_names.
    parameters : i_inspec like usr01-bname.
    at selection-screen on value-request for i_inspec.
      perform get_names.
    form get_names.
      t_names-name = 'Malek'.
      append t_names.
      t_names-name = 'Amran'.
      append t_names.
      t_names-name = 'Ow CC'.
      append t_names.
      t_names-name = 'titbit'.
      append t_names.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          retfield    = 'T_NAMES-NAME'
          dynpprog    = sy-cprog
          dynpnr      = sy-dynnr
          dynprofield = 'I_INSPEC'
          value_org   = 'S'
        tables
          value_tab   = t_names.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno with
        sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      read table t_return index   1.
    endform.                    "GET_NAMES
    Reward guaranteed,
    thanks
    kaki

    Use At selection-screen output,use screen internal table..
    User Dynamic Selection
    at selection-screen output.
      select single * from t000md.
      loop at screen.
        case screen-group1.
          when 'REL'.
            if not  p_old is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'BEL'.
            if not p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'ARB'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'MTA'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
        endcase.
      endloop.

  • Pass select option and parameter with submit

    Hello,
    I have two programs and what i have to do is to use the selection screen information from program A and submit it to program B so that this second program will generate a report with this information.
    After program B is executed it creates some files in a server, which i will have to use later in program A. I cannot modify the program B since its not part of the requirement.
    But the thing is that i am having problems when submiting a select option and a parameter together.
    It would be really useful if someone could give some examples of this.
    Example of what i want to do:
    SUBMIT PROGRAM_B
    WITH S_MATNR EQ S_MATNR      ->pass all the values from a select option.
    WITH P_WERKS EQ P_WERKS    ->pass a single value from a parameter.
    AND RETURN
    Regards,
    Roberto

    Hi,
    Try this for select-options:
    SUBMIT PROGRAM_B
    WITH S_MATNR *IN* S_MATNR ->pass all the values from a select option.
    WITH P_WERKS EQ P_WERKS ->pass a single value from a parameter.
    AND RETURN
    Hope it helps.
    Regards,
    Gilberto Li
    Edited by: Gilberto Li on Feb 2, 2009 10:24 PM
    Edited by: Gilberto Li on Feb 2, 2009 10:33 PM
    Edited by: Gilberto Li on Feb 2, 2009 10:33 PM

  • Convert Select-options into Parameter at runtime.

    Dear Friends,
    In my selection screen, i have declared select-option, now if i choose the radio button then select option shhould be work like parameter. It means without use of no inervals and no-extension in select option, it will work like no intervals and no-extension.
    Can anybody suggest me that is it possible or not???
    Thanking you,

    HI Aakash,
    Copy and paste the following code.
    PARAMETERS:
              p_selopt RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND d001,
              p_parm RADIOBUTTON GROUP grp1.
    SELECT-OPTIONS:
             s_date  FOR  sy-datum.
    PARAMETERS :
    p_date LIKE sy-datum.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-name CS 'P_DATE'.
          screen-invisible = '1'.
          screen-active = '0'.
          MODIFY SCREEN.
        ELSEIF screen-name CS 'S_DATE'.
          screen-invisible = '0'.
          screen-active = '1'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    AT SELECTION-SCREEN OUTPUT.
      IF p_parm = 'X'.
        LOOP AT SCREEN.
          IF screen-name CS 'S_DATE'.
            screen-invisible = '1'.
            screen-active = '0'.
            MODIFY SCREEN.
          ELSEIF screen-name CS 'P_DATE'.
            screen-invisible = '0'.
            screen-active = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF p_selopt = 'X'.
        LOOP AT SCREEN.
          IF screen-name CS 'P_DATE'.
            screen-invisible = '1'.
            screen-active = '0'.
            MODIFY SCREEN.
          ELSEIF screen-name CS 'S_DATE'.
            screen-invisible = '0'.
            screen-active = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Hope you got the required output.
    Thanks,
    Susmitha

  • Reading all select-option and parameter fields

    Hello All,
        I have a reaquire ment like ' i Will take a report name as input from user , and i  need to read all the fields declared with PARAMETERS and SELECT-OPTIONS. '
         one thing i can read the program and go line by line or scan the program.
    apart from this is there any other way to get all such fields declared with PARAMETERS and SELECT-OPTIONS
    Thanks & Regards
    Amarender Reddy B

    Hi,
      You can fetch it from table TVARV
    Regards,
    Prashant

  • Parameter to select-option conversion

    Hello Friends,
    I have a parameter field on selection screen and it is optional.
    If user enters any data on parameter, then I have to retrieve only corresponding value to the parameter from table.
    If user does not enter any data in parameter, then I have to fetch all the records.
    I want to convert this to selection-option.
    please let me know....

    Hi,
    Instead of converting why cant you do like this ,
    if P_field is initial.
    select * from <table>
    into table itab.
    else.
    select * from <table >
    into table itab
    where field  = p_field.
    endif.
    You can use select-option as parameter in this way,
    Select-options : s_field for wa-field no intervals no-extension.
    Regads,
    Raghava Channooru

  • How to modify a select option without range and mutiple selection??

    hi all,
    i need to modify a select option by removing the range and option for multiple entry. i other words i need to make select option as parameter.( because i cannot use parameter in my program due to some constraints.)
    is it possible to change the select option as per my requirement if yes please let me know how is it possible.
    Thanks in advance.
    Sreekanth.

    hi,
            Yes u can use code like following way..
    select-options : s_matnr for mara-matnr no-extension no intervals.
    Reward if helpful.
    Regards
    Gagan

  • Select options -restricting the operator value options.

    Hi,
    In selection screen for the  select options or parameter declarations  I need to restrict the operator options , like when they click for any select options it will give options to select = , #, <, <= , > , >=
    all these options right.
    I would like to restrict the user  to select only > and >=  while passing values.
    Can anyone give me idea how I can approach this?
    Thanks in advance.

    Hi,
    use this FM...
    SELECT_OPTIONS_RESTRICT can be use to supress options available with a SELECT-OPTIONS on a selection screen.
    jusy copy the code and execute it....It will give the exact output what u want.....
    TYPE-POOLS sscr.
    TABLES : marc.
    *Define the object to be passed to the RESTRICTION parameter
    DATA restrict TYPE sscr_restrict.
    *Auxiliary objects for filling RESTRICT
    DATA : optlist TYPE sscr_opt_list,
    *** TYPE sscr_***.
    *Defining the selection-screen
    SELECT-OPTIONS : s_matnr FOR marc-matnr,
    s_werks FOR marc-werks.
    INITIALIZATION.
    *Restricting the MATNR selection to only EQ and 'BT'.
    optlist-name = 'OBJECTKEY1'.
    optlist-options-eq = 'X'.
    optlist-options-bt = 'X'.
    APPEND optlist TO restrict-opt_list_tab.
    ***-kind = 'S'.
    ***-name = 'S_MATNR'.
    ***-sg_main = 'I'.
    ***-sg_addy = space.
    ***-op_main = 'OBJECTKEY1'.
    APPEND *** TO restrict-***_tab.
    *Restricting the WERKS selection to CP, GE, LT, NE.
    optlist-name = 'OBJECTKEY2'.
    optlist-options-cp = 'X'.
    optlist-options-ge = 'X'.
    optlist-options-lt = 'X'.
    optlist-options-ne = 'X'.
    APPEND optlist TO restrict-opt_list_tab.
    ***-kind = 'S'.
    ***-name = 'S_WERKS'.
    ***-sg_main = 'I'.
    ***-sg_addy = space.
    ***-op_main = 'OBJECTKEY2'.
    APPEND *** TO restrict-***_tab.
    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
    restriction = restrict
    EXCEPTIONS
    too_late = 1
    repeated = 2
    selopt_without_options = 3
    selopt_without_signs = 4
    invalid_sign = 5
    empty_option_list = 6
    invalid_kind = 7
    repeated_kind_a = 8
    OTHERS = 9.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards
    Kiran

  • Select Option header cleared after FM call

    Hi
    I'm calling an FM in the AT SELECTION SCREEN event in which I'm using some FMs to validate the values entered by the user. However on returning from the FM the header of the select option gets cleared. And the value you entered on the select option thereby also is gone. (However it can be seen in the multiple selection options)
    I export nothing to the FM and only import tyhe name of the select-option/parameter (like s_matnr-low or p_ernam).
    Why is this happening and what could be done about it?
    Pushpraj
    Edited by: Pushpraj Singh on Sep 24, 2009 7:40 PM

    Here's the thing:
    I made an FM which is called in the AT SELECTION SCREEN event of a report.
    This FM is supposed to validate the entries made by the user (whether they belong to the domain of the fields or not).
    It exports the name of the select-option or parameter which is incorrectly filled.
    Now say there is one select-option and one parameter on the selection screen.; and I put a valid value in the select-option and an invalid one in the parameter.
    The FM now returns the name of the parameter (say p_ernam) but also clears the header of the select-option table (not the body). If the FM does not return anything the header is not cleared. However any value in the return parameter makes the header disappear.
    Pushpraj

  • How to set the parameter selection *optional* for each subreport?

    Hi,
    I am using Crystal Reprots 11.
    I create 10 subreports, and each subreport contains a Parameters Field.
    The 10 subreports are put in 10 footer sections in increasing order, i.e. subreport1, subreport2, subreport3, ..., subreport10.
    When I use "Print Preview" to take a look at the whole report, CR prompts a "Edit Values" window for selecting parameter values for all 10 subreports.
    For example, if I only select parameter values for subreport1 and click "OK", 9 error messages on the "Edit Values" window come out above the selection list box of every other subreports (i.e. subreport2 ~ subreport10) showing that: 'The value is not valid'.
    Sometimes, I just want to review some specific subreports but not all.
    How should I do to set the parameter selection optional (not mandatory) for each subreport?
    Thank you in adavance.
    Edited by: Holdup on Feb 17, 2012 3:44 PM

    Hi,
    Here's how you can make the prompts optional (Assuming you're using CR 2008 or higher):
    1) Go into each subreport
    2) You should see the parameter in the Field Explorer. Right-click the name and select Edit > Look for an option called 'Optional Prompt'. Set it to true
    3) If you have a record selection in the subreport, then you need to modify the selection formula to something like this:
    if not(hasvalue({?Parameter_Name})) then True else = {?Parameter_Name}
    Hope this helps!
    -Abhilash

Maybe you are looking for