Select options , Parameters

Guy , if I write N* in a parameter or select option field , and I want the system to bring  me all coincidences with N in a select , How can I do that ?. How it works , thank you.

Hi
U should obtain automatically what you need for select-options, for parameters u should replace * with % before doing the select.
PARAMETERS: P_PARAM(10).
REPLACE '*' WITH '%' INTO P_PARAM.
IF SY-SUBRC = 0.
  SELECT * FROM <TABLE> WHERE <FIELD> LIKE P_PARAM
ELSE.
  SELECT * FROM <TABLE> WHERE <FIELD> = P_PARAM
Max

Similar Messages

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

  • 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

  • Passing selection-options to standard PROG

    Hi All,
         i want to  submit a standard program into zprogram , in standard program there are 3 select-options . i need to pass  zselect-options into these 3 select-options in standard program.
    if u have any code please pass to me.
    please help me.
    Many Thanks
    Naren

    check this
    Syntax Diagram
    SUBMIT
    Basic forms:
    1. SUBMIT rep.
    2. SUBMIT (name).
    Extras:
    1. ... LINE-SIZE col
    2. ... LINE-COUNT line
    3. ... TO SAP-SPOOL List output to the SAP spool database
    4. ... USING SELECTION-SCREEN scr
    5. ... VIA SELECTION-SCREEN
    6. ... AND RETURN
    7. ... EXPORTING LIST TO MEMORY
    8. ... USER user VIA JOB job NUMBER n
    9. ...Various additions for passing parameters to rep
    10. ... USING SELECTION-SETS OF PROGRAM prog
    Effect
    Calls report rep.
    The system leaves the active program and starts the new report rep. In basic form 2, you can specify the name of the report in the field name. You must specify the name in uppercase, otherwise a runtime error occurs.
    Note
    You can only start programs with type '1' using SUBMIT. If the program has a different type, the system triggers a runtime error.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... LINE-SIZE col
    Effect
    The list generated by the report has the line width col.
    Addition 2
    ... LINE-COUNT line
    Effect
    The list generated by the report has line lines per page.
    Addition 4
    ... 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.
    Addition 5
    ... VIA SELECTION-SCREEN
    Effect
    The selection screen is displayed. In this case, the selection screen is displayed again after the report list has been displayed. The values entered by the user remain displayed.
    Addition 6
    ... AND RETURN
    Effect
    Returns to the calling transaction or program after the called program has been executed. SUBMIT ... AND RETURN creates a new internal session.
    Addition 7
    ... EXPORTING LIST TO MEMORY
    Effect
    Does not display the output list of the called report, but saves it in ABAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. In addition, you must not assign a function code to the ENTER key in the current GUI status. The saved list is read from the SAP memory using the function module 'LIST_FROM_MEMORY' and can then be saved to the database using EXPORT, for example. You can process this list further with the function modules 'WRITE_LIST', 'DISPLAY_LIST' ... of the function group "SLST".
    Addition 8
    ... USER user VIA JOB job NUMBER n
    Effect
    Schedules the specified report in the job specified by the job name job and the job number n. The job runs under the user name user and you can omit the addition USER user. The assignment of the job number occurs via the function module JOB_OPEN (see also the documentation for the function modules JOB_CLOSE and JOB_SUBMIT). This addition can only be used with the addition ...AND RETURN.
    Note
    When scheduling a report with the SUBMIT ... VIA JOB job NUMBER n statement, you should always use the addition ...TO SAP-SPOOL to pass print and/or archive parameters. Otherwise, default values are used to generate the list and this disturbs operations in a production environment.
    SY-SUBRC = 0:
    Job scheduled successfully
    SY-SUBRC = 4:
    Job scheduling terminated by user
    SY-SUBRC = 8:
    Error in job scheduling (JOB_SUBMIT)
    SY-SUBRC = 12:
    Error in internal number assignment
    Addition 10
    ... USING SELECTION-SETS OF PROGRAM prog
    Effect
    Uses variants of the program prog when executing the program rep.
    Note
    Important
    The programs prog and rep must have the same SELECT-OPTIONS and PARAMETERs. Otherwise, variants of the program prog may be destroyed.
    Note
    When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari. On the other hand, all variant-related actions on the selection screen of rep (Get, Save as variant, Display, Delete) refer to the variants of prog.
    Example
    SUBMIT REPORT01
           VIA SELECTION-SCREEN
           USING SELECTION-SET 'VARIANT1'
           USING SELECTION-SETS OF PROGRAM 'REPORT00'
           AND RETURN.
    Effect
    Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00.
    Exceptions
    Non-Catchable Exceptions
    Cause: The specified program was not found.
    Runtime Error: LOAD_PROGRAM_NOT_FOUND
    Cause: Invalid value passed to a selection with SIGN.
    Runtime Error: SUBMIT_WRONG_SIGN
    Cause: The specified program is not a report.
    Runtime Error: SUBMIT_WRONG_TYPE
    Cause: More than one value passed to a report parameter.
    Runtime Error: SUBMIT_IMPORT_ONLY_PARAMETER
    Cause: Table passed to a selection with WITH sel IN itab that has an unexpected structure.
    Runtime Error: SUBMIT_IN_ITAB_ILL_STRUCTURE
    Additional help
    Starting Executable Programs (Reports)
    Regards
    Prabhu

  • 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

  • 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

  • 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

  • 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

  • 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

Maybe you are looking for

  • Multiple I Tunes accounts on one computer?

    I have three IPODS in the family. How do I create 3 different accounts with different music on each from the same computer?

  • Need help for Count function in XSLT Mapping

    Hi All, We have a requirement in our project,to do the xslt mapping from OAGIS 9.0 to EDI XML.In the EDI XML we have a SE tag whose value is the count of the no. of complex elements that will be generated in the EDIXML file( which is the target). Ple

  • How to lock  (protect) a cell

    I've a cell with a formula, that i want to be locked just to give the result, but i don't find that option. can anyone help me? Thanks

  • Expected Sales Volume in Pipeline Performance Management

    Hello,        I have created a few opportunities for my sales team with the closing dates in a particular quarter and specified the values for 'Expected Sales Volume' maintained for each opportunity as required. However, when I view the peipeline per

  • E 90 connecting to hotmail

    I have a E 90. How do i connect it to my hotmail account. I do not the incomming server name. Can anybody help me ?