Parameters V/s Select Options

Hi Friends,
I would like to ask one reason while executing the select option & parameters option.
Suppose I declare one field lifnr as parameters as well as select option.
i.e.
parameters: p_lifnr like lfa1-lifnr.
select-options: s_lifnr for lfa1-lifnr.
If i execute the report in which I m using parameter option in selection screen, if I will not enter any value in selection screen & execute the report then it will not display any output.
But if I execute the same report in which I m using select-options in selection screen & if I will not enter any value in selection screen & execute the report then it will display the records.
Anybody will tell me what is the reason for this??

Parameter is a single value and when you dont enter any value means its blank value ie initial. so now when you select data from table where lifnr is empty... it does not return any value as LIFNR is never empty in the table LFA1.
Where as select options is a set of values from __ to __
ie it can be any starting number to any ending number, so now when you query on this it will consider all the values and will return you some records in your internal table
hope this is clear
Regards
Gopi

Similar Messages

  • Select-options and Parameters, when to use what?

    Hi gurus,
    I have been using Parameters for long. Now I want to choose a range of values, which I need to retrieve from database.
    I tried using select-options. Can't I use 2 parameters that is parameter1 and parameter2 and mention query BETWEEN para1 AND
    para2, and when I use NO INTERVALS and NO EXTENSION together, it behaves same like parameter, then why did SAP gave these
    extensions.

    Hi friend,
    Simple differences between Select-options and parameters.
    Select-Options Uses keyword 'for'                         
    Parameters Uses keywords 'like', 'type'     
    Select-Options  Uses operator 'in'                         
    Parameters Uses operator '='
    Select-Options  Provides ranges for selection     
    Parameters  No ranges only single value
    Select-Options Creates selection table                              
    Parameters No selection table
    Select-Options  When i/p blank all records selected          
    Parameters   When i/p blank none is selected
    Note:
    Select options can act as parameters by using 'no-extension' 'no intervals', but all records will be selected when i/p is blank unlike parameters.
    Might be helpful..
    Thanks...
    Edited by: Guest77 on Feb 10, 2009 5:44 AM

  • SELECT-OPTION initialization

    Hi everybody,
    I have an ABAP program which has 3 SELECT-OPTIONS parameters. When the user fills one of them, inside the program there is a FORM that fills the other 2 becuase they are needed in the SELECT clause.
    The point is that when the user finishes looking ALV result and press BACK button to the parameters screen, the SELECT-OPTIONS that was not filled by him/her are also with data. The user wants to see parameters as he/she fills: if she fills 1 the other 2 must be empty.
    I try with INITIALIZATION event bus it doesn't work. Any other idea?
    Thanks & many kind regards.

    Rob,
    I remember the comment by JB
    The ponits system creates rivalry in the forums and people in competition against each other. They also attack each other publicly, or irritate each other intentionally. They report each other in the Abuse Reports asking moderators to remove ponits from each other
    In suggestion & comments forum this thread will have more importance.
    I get satisfied if the OP's question was answered , never mind WHO solved it. I look for HOW it was solved.
    Personally i say the competitive attitude is not good

  • Parameters and Select Option in ABAP OO

    Hi all,
    it's possible to build an application starts with a method of a class thats declares parameters and select-option or I have to do it custom creating a dynpro and some input field as parameters?
    thanks
    enzo

    Just to add detail: the function module RS_REFRESH_FROM_SELECTOPTIONS returns a table of TYPE RSPARAMS_TT.
    The structure of this table is:
    SELNAME
    RSSCR_NAME
    KIND
    RSSCR_KIND
    SIGN
    TVARV_SIGN
    OPTION
    TVARV_OPTI
    LOW
    TVARV_VAL
    HIGH
    TVARV_VAL
    the first field is the name of the selection parameter, the others have the same structure obtained declaring a range with:
    TYPES|DATA <rangetab> TYPE RANGE OF <type>.
    see the help topic http://help.sap.com/saphelp_470/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htm

  • Mix of Parameters & Select Options in a Selection screen in WD4A

    Hi All.
    I just created my first selection screen in WD4A couple of days back.
    Now, we have to mix up some parameters and select-options just like in normal ABAP.
    But I could only find a way to insert a "Range" into the WD4A screens via "Create_Range_table".
    Supposing I have 2 select-options, then 2 parameters - i.e. no Pattern or range or intervals options (simple = option); then again 2 select-options.
    Can't we make a simple Parameter option in WD4A selection screen? I know we can make no_extension and no_intervals as true so that it does look like a parameter. But still user can enter a pattern search in it like a select-option.
    Hope my query is clear.
    Another question is : As far as I understood, we ALWAYS need a IT_RESULT table in the method ADD_SELECTION_FIELD. Then why is it not mandatory in the method? 
    Thanks in adv.

    Hi Aishi,
    In an early version of SelectOptions, the parameter it_result was mandatory. Some time later, a developer contacted me and showed me an example where it was benefitial to first create the field and to pass in the range table at a later point in his algorithm. This can be done by calling set_range_table_of_sel_field( ). Hence, the parameter has become optional. Of course, a range table needs to be specified before the page gets rendered.
    Best regards,
    Thomas

  • Parameters & select-options

    What will happen if we execute a report without giving any value in parameter in selection screen ?
    What will happen if we execute a report without giving any value in select-options in selection screen ?

    Hi Swapna,
    Here you go..Use this code and find the differennce
    *--   2) Difference between Parameters and Select options with
    *--    No-Intervals and No-extension
    Explanation: -
    1) If u dont enter any value in parameter, the system consider it as a initial value and dont retrive any records. If u dont enter any value in select-options, the system selects all values from the database.
    2) The other difference is You can check a value againist a Entries against a check table with Parameter option by as " VALUE CHECK ". However it is recommended to use this only when the parameter is obligatory becuase it checks for blank entries also. This option( VALUE CHECK ) cannot be used in SELECT-OPTIONS.
    ( Eg:- p_matnr like mara-matnr OBLIGATORY VALUE CHECK. )
    TABLES: MARA.
    DATA: p_count TYPE i,
          s_count TYPE i.
    PARAMETERS: p_mtart like mara-mtart.
    SELECT-OPTIONS: s_mtart FOR mara-mtart NO INTERVALS NO-EXTENSION.
    SELECT count(*) FROM
       MARA into p_count
       WHERE matnr = p_mtart.
    SELECT count(*) FROM
       MARA into s_count
       WHERE matnr IN s_mtart.
    WRITE:/ p_count,
            s_count.
    In this output, p_count = 0.
                and s_count will be total no. of records in database.
    Reward points if this code is helpful.
    Thanks.
    Hari krishna

  • Select-options and parameters

    hi,
    In How many ways we can define select-options and parameters.

    hi uday,
    Usually we use PARAMETERS for single value input and
    SELECT-OPTIONS is used to give a range of input values for a single field
    SELECT-OPTIONS implicitly consists of internal table with fields
    OPTIONS
    LOW
    HIGH
    SIGN
    eg:
          DATA: G_VBELN TYPE VBAK-VBELN.
          SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
          PARAMETERS : P_VBELN LIKE VBAK-VBELN.
          SELECT-OPTIONS: S_VBELN FOR G_VBELN.
          SELECTION-SCREEN END OF BLOCK B1.
       o/p:
              P_VBELN: _________________.
             S_VBELN:___________ TO  ____________.
    reward if helpful
    regards.
    shashikanth naram.

  • Parameters has to act as select-options in module pool.

    Hi Folks,
    I have to make material number parameters as select-options in Tcode = CS15.
    & I have to add one more fileld as select-options in the same screen.
    It's in modulpool. Shall i use SCREEN-EXITS for this? what will be the preferable solutions?

    Better not to modify standard SAP code. Check for screen exits/ BADI's for this transaction
    Check these badis
                                                                                    BOM_EXIT             BOM User Exit                                                
    BOM_UPDATE           Maintain BOMS                                                
    CEWB_BOM_CUS_FIELDS  EWB: Customer Fields with BOM Header (Screen Enhancement)    
    CEWB_BOM_UPDATE      Check Bill of Material on Saving                             
    CEWB_ITM_CUS_FIELDS  EWB: Customer Fields with BOM Item (Screen Enhancement)
    and these enhancements
    PCSD0001  Applications development R/3 BOMS                           
    PCSD0002  BOMs: Customer fields in item                               
    PCSD0003  BOMs: Customer fields in header                             
    PCSD0004  BOM comparison                                              
    PCSD0005  BOMs: component check for material items                    
    PCSD0006  Mass changes user exit                                      
    PCSD0007  Check changes in STKO                                       
    PCSD0008  WBS BOM: Customer-specific explosion for creating           
    PCSD0009  Order/WBS BOM, determine URL page                           
    PCSD0010  Order/WBS BOM, determine explosion date                     
    PCSD0011  Knowledge-based order BOM, parallel update                  
    PCSD0012  Customer - Mat. number/mat. number during material exchange 
    PCSD0013  Customer-specific processing of an explosion for BOM browser
    PCSD0014  Knowledge-Based Order BOM: Status
    Edited by: abap on Jan 8, 2009 8:43 AM

  • Parameters will it work like Select-Option is there any chance

    Hi Every One
    I am using Parameters to do selection .but in one case i need to get  some data for the whole month .i have the values in 2 different variables .(If we use select-option then we can use sign,option,low,high .).but how to do here . Any idea is please do let me know.
    Sravya

    Hi,
    <li>Define range table.
       DATA:r_data TYPE RANGE OF datum,
            w_data LIKE LINE OF r_data.
    <li>Build range table
       w_data-low  = parameter1.
       w_data-high = parameter2.
       w_data-sign  = 'I'.
       w_data-option  = 'BT'.
       APPEND w_data TO r_data.
       CLEAR  w_data.
    <li>Use that in SELECT statement.
    SELECT * FROM <db_tab> INTO TABLE <it_tab> WHERE <date_field> IN r_data.
    Thanks
    venkat.O

  • Selection screen Parameters  - Select -options  values  populated from ITAB

    PARAMETERS  : PLANT
    SELECT-OPTIONS : MATERIAL
    My Selection Screen contents of  should  change   as  the PLANT changes ..
    and i want  to populate the  contents of  SELECT-OPTIONS  from an ITAB  how can i do that .
    wen  plant changes  its  corresponding  materials should  reflect  inthe Select -options.   this is my need .
    please solve..
    thanks, .
    Aslam.

    Srry Raj u misundersttod me ...
    I was not saying ur solution is not gud ...my question was different .....may be this is not the right forum to ask what i want to know ....
    just bear with me moderators plz ...
    i just wanted to understand the interview process...since I have not appreared for any interview ( I started my carreer with a company and I am still with it ..wuld luv to continue [:d])
    I believe , if you would have asked me the same question probably i would not have given u the best possible solution...as u r also admitting for ur particular scenario ur solution is better than max's .....
    as an inteviewer will u expect the best solution from me .....( which might not come to my mind ( nd I am sure will not ..I luv abap debugger ) or u just wanna check if I know how to use difference selection screen events .
    If u wanted to hear only the better solution ...( I am rejected ............now I will have to continue sticking to my current job [:d], not bcoz i prefer but bcoz I cant switch )
    if u want to test if i know how to use selection screen events then ( I am selected ...but now I would like to stick to my current job ...bcoz I want to )
    Now I realize I cannot do ABAP without Debugger.

  • How to create a selection option or parameters in a subarea of the screen

    Hi Experts,
        My program have a screen 1001 and it is splited into two parts: the first is a Subarea for selection option, and the last is a table control. Now I want to create some selection option and parameters in the first subarea just like we do in screen 1000. Do we have any convenient way to do that?
    Thanks in advance
    Joe

    Hi Joe,
    Yes ,it can be done like below code:
    TABLES : mara.
    SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    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 1001.
    DATA: number(4) TYPE n VALUE '1001'.
    START-OF-SELECTION.
      CALL SCREEN 100.
    in screen flow logic .write below statements.
    first declare the subscreen area  'AREA' in screen.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    CALL SUBSCREEN area INCLUDING sy-repid number.
    PROCESS AFTER INPUT.
    CALL SUBSCREEN area.
    MODULE USER_COMMAND_0100.
    Reward if useful,
    Regards,
    Talwinder

  • Passing select-options parameters type to the class

    Hi All,
    I am creating one class and I want to pass the select-options parameters directly to it like s_plant,s_mtart etc .
    So while specifying these as paramters what type I should give them?
    Rgds,
    Madhuri

    Whatever you finally decide upon, you must have a Data Dictionary definition. So either create one for each type (bukrs, vkorg, etc.) or use a general one like RSELOPTION. However with the general one you have to put extra code in the class to convert back from a CHAR 45 field to your special field.
    Anyway, using the Data Dictionary is fun! So go create as many new tables as you need. In the long term, the work you do in the Data Dictionary is never wasted and it may save you time in the future when you need that structure / table again for a different program.
    Creating these structures and tables is easy if you use shortcuts. For example in local definitions in your program you can code...
    data range1 type range of bukrs.
    or
    data wa_bukrs type bukrs.
    ranges range1 for wa_bukrs.
    either of these gives you the structure... no need to manually type sign, option, low, high...
    What about Global (data dictionary) definitions? yes, there are also shortcuts...
    start transaction SE11, enter range table name in the 'Data' field (e.g. ZMYRANGETAB), Hit Create, choose to create a Table Type... now you are on the blank new Maintain Table Type screen. enter a short text for your new table, then choose
    Edit->Define as ranges table type
    next enter your data element (e.g. BUKRS) under 'data element', hit Save and activate. You just created your range table without manually entering sign, option, low, high...
    But wait there's more... on the same screen you can now (after saving the range table) also enter a structure name such as ZMYRANGE in the field 'structured row type'. Hit Create and you are taken to the Maintain Structure screen where the sign, option, low and high are already populated... add a short description and save and activate... you just created a workarea for your range table.
    You just created a table type ZMYRANGETAB and a structure ZMYRANGE with minimal effort.

  • Symaltaneous use of select-option and parameters in smartforms .

    hello Abaper,
    I am design a smartforms . we have given some input. when we use only parameters it works properly. as same when we use select-option only its works .
       But when i use both parameter and select option at that time error generate .
      Actually call function is not works .
    So please give me proper idea how to solve this problem .
    Regards
    kamal kishore

    Hi ,
    Still problem is not solved.
    i want to call following fields but function modules show run time error. IF separately i call only parameter its run properly.
    in the same way if i call only select option is runs properly.
    please suggest me how can i call both the things.
    PARAMETERS: P_BUKRS   TYPE BSEG-BUKRS        OBLIGATORY,
                P_GJAHR   TYPE BSEG-GJAHR        OBLIGATORY.
    parameters: P_SECCO type  SECCODE-SECCODE   OBLIGATORY.
    *SELECT-OPTIONS :  P_SECCO FOR  SECCODE-SECCODE   OBLIGATORY.
    PARAMETERS: P_QSCOD   TYPE J_1IEWTNUMGR-QSCOD OBLIGATORY.
    SELECT-OPTIONS: P_BUDAT FOR BKPF-BUDAT        OBLIGATORY,
                P_BLART   FOR BKPF-BLART,
                P_J_HLN   FOR J_1IEWTCHLN-J_1IEXTCHLN,
                P_J_HDT   FOR J_1IEWTCHLN-J_1IEXTCHDT OBLIGATORY,
                P_LIFNR   FOR LFB1-LIFNR.
    regards
    kamal
    Edited by: kamal_kishore_sah on Apr 12, 2011 7:44 AM

  • How to assing parameters to select-options

    hi all
    thanks in advance
    how to assign parameter value to select-option
    date
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
      select-options    s_budat     FOR mkpf-budat  OBLIGATORY,
                              s_budat1     FOR mkpf-budat.
       parameters cperiod like mkpf-budat.
      SELECTION-SCREEN:END OF BLOCK B1.
    cperiod assign to s_budat-low
      or dummy s_budat1  and how give selection criteria
    thanks all

    Hi,
    I think you want to set some default values in select options.
    so following is code...
    TABLES:MKPF.
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_BUDAT FOR MKPF-BUDAT OBLIGATORY,
                    S_BUDAT1 FOR MKPF-BUDAT.
    PARAMETERS CPERIOD LIKE MKPF-BUDAT.
    SELECTION-SCREEN:END OF BLOCK B1.
    AT SELECTION-SCREEN OUTPUT.
      S_BUDAT-LOW = SY-DATUM.
      append s_budat.
    hope it will help you...
    Award points if useful...

  • HI major diffrence in select-options and parameters

    Hi,
      Can any one explain me the major diffrence between select options and parameters.
    I know that in select options we can give a range of values and in parameter one value.
    Thanks

    Hello Hari,
    I would see following differences:
    1. As you have mentioned, many values/ranges can be given in the SELECT-OPTIONS. However, the parameter can hold only one value.
    2. In the run time, we see the data w.r.t a select option as an Internal table and Parameter may be accessed as a global variable.
    3. Consider following statements:
       a. select-options: s_matnr for mara-matnr no-extension no intervals.
       b. parameters: P_MATNR like mara-matnr.
    Both the statements look same on the selection screen.
    consider the SQLs:
    <b>select * into corresponding fields of table g_t_mara
    from mara
    where
    matnr in s_matnr.</b>
    and
    <b>select * into corresponding fields of table g_t_mara
    from mara
    where
    matnr eq p_matnr.</b>
    both the SQLs give the same output if the user gives a material number on Selection screen.
    If the user does NOT give any input in selection screen, the first SQL will fetch all data from DB, whereas the SQL with the PARAMETER will fail.
    So I think we should keep in mind the requirement and code accordingly.
    I hope this helps you.
    Best Regards,
    Murugesh AS

Maybe you are looking for

  • After upgrading to iOS7 I have no controls for the voice memo

    Help

  • Problem using XML function in procedures (internal error )

    Hi all, I use the XML function in a stored procedures but when i compile these i have this error PLS-00801: internal error (74806). The strangeness is that the single instruction launched from sql plus type SELECT XMLElement("? xml",xmlattributes('1.

  • Copy Sales Order from existing

    Hi Experts, Can i copy a sales order from existing ones? I am not referring to create by reference. Just create the new sales order which has the same information as the existing. Thanks

  • How do I remove a podcast episode

    I can't figure out how to remove old episodes of podcasts from my shuffle.  I've done all the syncing and resyncing I can think of and I've looked everywhere for a "delete" option.  Please help if you can!!!!   Thanks.

  • I cannot monitor trunk traffic

    I have two trunk port  over Metroethernet contains several VLAN. And  Cisco 3550 is meeting point for 2 trunk. I wanna monitor those trunk (far sites) traffic. I try several SPAN on cisco 3550 switch but i didn’t get  a source-destination traffic . H