SELECT-OPTIONS and data collection

Hi All,
I have one inputfield (say users) via SELECT-OPTIONS and it goes to an internal table called "userlist" with values USER1, USER2 etc...(Example)
Now, when I query the database with "userlist" as the input, I'm not able to do so because SELECT-OPTIONS contains an Internal table with values LOW, HIGH etc...
So my input value goes like this IEQUSER1, IEQUSER2 etc......
Could anyone tell me what should I do in order to get USER1, USER2 etc.
Thanks in advance,
Pradeep

Hi All,
Sorry. I'm getting the error: 'Line structure of table USERLIST is incorrect'.
My coding is as follows:
  tables : usr02.
data: begin of users,
    users type XUBNAME,
end of users.
  data : it_usr02 like table of usr02.
  data : l_userlist type xubname,    "This is a data elemnt thats already in the system of type BNAME
         p_userlist like l_userlist.
  select-options: userlist for users.
  loop at userlist into l_userlist.
    select * from usr02 into corresponding fields of table it_usr02 where bname in userlist.
  endloop.
ENDFUNCTION.
Could you please help?
Thanks and Regards, Pradeep

Similar Messages

  • Select-options for date field.

    Hi all,
    i need to give select options for Date field.How can i give that.
    Thanks & Regards
    Ravi.

    Hi Ravi,
    Use the Component WDR_SELECT_OPTIONS to include select options in Web Dynpro ABAP. Follow these steps:
    1. In your Component , "Used Componet" tab add Component WDR_SELECT_OPTIONS . Component Use can be any name that you want to give, eg SELECT_OPTIONS
    2. Go to the View where you want to include the Date Select Options. I am assuming that you already have an Attribute of Type DATS in your context.
    3. View: Properties Tab:Create Controller Usage and select
    SELECT_OPTIONS     WDR_SELECT_OPTIONS                   
    SELECT_OPTIONS     WDR_SELECT_OPTIONS     INTERFACECONTROLLER
    4. View Layout Tab:Include a View Container. In this view container we will show the Date Select Options.
    5. View Attributes Tab: Create Following two attributes:
    M_HANDLER type IF_WD_SELECT_OPTIONS
    M_WD_SELECT_OPTIONS type IWCI_WDR_SELECT_OPTIONS
    6: View Methods Tab: Create a method eg CREATE_SELECTION_SCREEN. Call this method in the WDDOINIT of the view.
    7:CREATE_SELECTION_SCREEN: Write following Code:
    * Data Declaration
      data:
            lt_range_table TYPE REF TO DATA.
      data:
            lr_componentcontroller TYPE REF TO IG_COMPONENTCONTROLLER,
            lr_componentusage TYPE REF TO IF_WD_COMPONENT_USAGE.
    * Execution
    *  Create Used Component
      lr_componentusage = wd_this->wd_cpuse_select_options( ).
      if LR_COMPONENTUSAGE->HAS_ACTIVE_COMPONENT( ) is initial.
        lr_componentusage->create_component( ).
      endif.
    *  Get pointer to interface controller of select options
      wd_this->M_WD_SELECT_OPTIONS = wd_this->wd_cpifc_select_options( ).
    * initialize selction screen
      wd_this->M_HANDLER = wd_this->M_WD_SELECT_OPTIONS->init_selection_screen( ).
    *  Create Range Table for: Date
      CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
        EXPORTING
          I_TYPENAME     = 'DATS'
        RECEIVING
          RT_RANGE_TABLE = lt_range_table.
    * Add Selection Field for: Date
      CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
        EXPORTING
          I_ID                         = '<name of date attribute in the context>'
    *      I_WITHIN_BLOCK               = MC_ID_MAIN_BLOCK
    *      I_DESCRIPTION                =
    *      I_IS_AUTO_DESCRIPTION        = ABAP_TRUE
          IT_RESULT                    = lt_range_table
    *      I_OBLIGATORY                 = ABAP_FALSE
    *      I_COMPLEX_RESTRICTIONS       =
    *      I_USE_COMPLEX_RESTRICTION    = ABAP_FALSE
    *      I_NO_COMPLEX_RESTRICTIONS    = ABAP_FALSE
    *      I_VALUE_HELP_TYPE            = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE
    *      I_VALUE_HELP_ID              =
    *      I_VALUE_HELP_MODE            =
    *      I_VALUE_HELP_STRUCTURE       =
    *      I_VALUE_HELP_STRUCTURE_FIELD =
    *      I_HELP_REQUEST_HANDLER       =
    *      I_LOWER_CASE                 =
    *      I_MEMORY_ID                  =
    *      I_NO_EXTENSION               = ABAP_FALSE
    *      I_NO_INTERVALS               = ABAP_FALSE
    *      I_AS_CHECKBOX                = ABAP_FALSE
    *      I_AS_DROPDOWN                = ABAP_FALSE
    *      IT_VALUE_SET                 =
    *      I_READ_ONLY                  = ABAP_FALSE
    *      I_DONT_CARE_VALUE            =
    *      I_EXPLANATION                =
          I_TOOLTIP                    = 'Select Date'.
    8: To Fetch Data entered in the selection field, write following code on action of button click:
      data:
            lt_date type REF TO DATA.
    FIELD-SYMBOLS:
                     <fs_date> TYPE table.
      *  retrieve Date from Select Options
      CALL METHOD WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
        EXPORTING
          I_ID           = '<attrib_name>'
        RECEIVING
          RT_RANGE_TABLE = lt_date.
    *  assign Date Field Symbol
      ASSIGN lt_date->* to <fs_date>.
    9: Windows Window Tab: In the View Conatiner, embed the WND_SELECTION_SCREEN view from SELECT_OPTIONS component Usage of  WDR_SELECT_OPTIONS component.
    Regards,
    Reema.

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

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

  • Select-options  and button not aligned on same line

    Hi,
    My goal is to show selection screen with One Select-option & a search button
    For this I have created a GROUP inside ROOTUIELEMENTCONTAINER
    Following are the settings
    ROOTUIELEMENTCONTAINER ( Layout -Matrix layout)
    GROUP ( Layout -Matrixlayout , Layout Data : MatrixHeadData)
    ViewContainer with select options: (layout -MatrixHeadData)
    Button:(Layout - MatrixData)
    In SE80/view/layout  Select-options &  Button are aligned on same straight line
    but in output view button has been moved upwards I mean they are not in line.
    What else do i need to look?
    rgds
    vara

    Hi Vara,
    Please explain your problem in a better way becaiuse I am getting little confused here. Is the search button coming in next row?? Or the select-option and search button are coming in same row but their alignment is different?? If they are coming in different row, then set the width of your view which contains your search button. Just go that view and set the WIDTH and HEIGHT (say 100px) of the ROOTUIELEMENTCONTAINER.  Set the layout of your main view (which contains all the view containers) as matrix layout.
    Please explain.
    Regards
    Arjun

  • Select option for date

    i want give default values in select option for date (for a period)
    I used
    SELECT-OPTIONS y_s_mnth FOR y_v_dt_month default first to last OPTION BT.
    first and last are dates.
    I am getting error dialog box....specify ranges...
    Please give sample code..

    Hi Suhas,
    I hope this code will help you.  Reward me if it is helpful.
    select-options : y_s_mnth FOR sy-datum.
    initialization.
    y_s_mnth-sign   = 'I'.
    y_s_mnth-option = 'BT'.
    y_s_mnth-low    = sy-datum - 30.    "first_day
    y_s_mnth-high   = sy-datum.         "last_day
    append y_s_mnth.
    clear  y_s_mnth.
    Regards,
    Sagar

  • Difference between select-option and range

    Hi,
      wat are the difference between  select-option and range
    where u have to use those and give the syntax for the range option.
      if u use range option in report programming there is any advantages ?
      pls reply for this ..
    thanks
    rams

    Hi,
    Not much of a difference,
    A Select-Option could be like,
    SELECT-OPTIONS sel FOR f
    And a Range could be like,
    DATA: BEGIN OF sel OCCURS 10,
             SIGN(1),
             OPTION(2),
             LOW  LIKE f,
             HIGH LIKE f,
          END   OF sel.
    Here they both function the same. But then the Select-Options has numerous options associated with it than the RANGE option.
    Hope it helps,
    Pradip Parmar.

  • Passing SELECT-OPTIONS and Internal Tables to SUBROUTINES

    Hi Guys
    In the code below my colleague has created her own table types in order to pass a select option and internal tables to her subroutine. Is there an easier way of making them known to the subroutine.
    data : v_vbeln type vbeln_vf,
          it_bdoc type table of vbrp,
          it_t006 type table of t006a,
          wa_bdoc type vbrp,
          wa_t006 type t006a,
          it_bdoc2 type table of zsswathi_st_vbeln,
          wa_bdoc2 type zsswathi_st_vbeln
    select-options s_vbeln for v_vbeln matchcode object zswathi_vbeln obligatory.
    start-of-selection.
    perform bdoc using s_vbeln[]
                 changing it_bdoc
                          it_bdoc2
                          it_t006.
      loop at it_bdoc2 into wa_bdoc2.
    form bdoc using f_s_vbeln type ZSWATHI_ST_SELECT_OPTION_TA_TY       " all these are table types. for select options, a structure is created and then a table type for it is created.
            changing f_it_bdoc type zswathi_vbrp_ty_ta
                     f_it_bdoc2 type zswathi_vbeln_ty_ta
                      f_it_t006 type ZSWATHI_T006_TA_TY.
    select * from vbrp into table f_it_bdoc where vbeln in f_s_vbeln.
          if f_it_bdoc is not initial.
          select  vbeln sum( netwr ) prsdt from vbrp into table f_it_bdoc2 where vbeln in f_s_vbeln group by vbeln prsdt.
          sort f_it_bdoc2 by vbeln.
          "select * from t006a into table it_t006 for all entries in it_bdoc where msehi = it_bdoc-vrkme.
          select * from t006a into table f_it_t006 for all entries in f_it_bdoc where msehi = f_it_bdoc-vrkme.
       endif.
        endform.

    Hi Brett,
    1. you can use a select-options-range in a FORM subroutine also without passing it as a parameter because parameters and select-option range tables are global fields in their program.
    2. If you need a parameter, declare it as type table or type standard table or type any table. You do not need any special table type.
    Regards
    Clemens

  • Web Dynpro ABAP - Select Option and ALV Component Usage

    Hi,
    I'm new in ABAP Web Dynpro and i was trying to follow the SDN tutorial
    Web Dynpro ABAP - Select Option and ALV Component Usage  
    In this video, we create a new Web Dynpro ABAP component that uses both Select Options and ALV. Developers can learn the basic mechanisms for working with both of these reusable components.
    Following the link: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/39c54fe7-0b01-0010-0eb6-d63ac2bdd637
    I implemented and generated the web dynpro with success but when i execute a test i get a dump on select-option definition.
    Note
    The following error text was processed in the system ECD : Exception condition "TYPE_NOT_FOUND" raised.
    The error occurred on the application server ITAWSECCS01D_ECD_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: DESCRIBE_BY_NAME of program CL_ABAP_TYPEDESCR=============CP
    I went in debug and the piece of code dumping is:
    lt_range_table =
    wd_this->m_handler->create_range_table( i_typename = 'S_PROJ' ).
    Is there someone who can help me?
    Thanks in advance,
    Stefano.

    Hi,
    I'm new in ABAP Web Dynpro and i was trying to follow the SDN tutorial
    Web Dynpro ABAP - Select Option and ALV Component Usage
    In this video, we create a new Web Dynpro ABAP component that uses both Select Options and ALV. Developers can learn the basic mechanisms for working with both of these reusable components.
    Following the link: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/39c54fe7-0b01-0010-0eb6-d63ac2bdd637
    I implemented and generated the web dynpro with success but when i execute a test i get
    an error as
    Note
    The following error text was processed in the system EI6 : Exception condition "TYPE_NOT_FOUND" raised.
    The error occurred on the application server EC6IDES_EI6_01 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: DESCRIBE_BY_NAME of program CL_ABAP_TYPEDESCR=============CP
    I have created a table zmy_table and trying to make USERID field as a select-options.I've written the code as shown below .
    data: itab type standard table of zmy_table,
    wa type zmy_table.
    data:
    node_employee type ref to if_wd_context_node,
    elem_employee type ref to if_wd_context_element,
    stru_employee type wd_this->element_employee ,
    item_userid like stru_employee-userid.
    navigate from <CONTEXT> to <EMPLOYEE> via lead selection
    node_employee = wd_context->get_child_node( name = wd_this->wdctx_employee ).
    @TODO handle not set lead selection
    if ( node_employee is initial ).
    endif.
    get element via lead selection
    elem_employee = node_employee->get_element( ).
    @TODO handle not set lead selection
    if ( elem_employee is initial ).
    endif.
    alternative access via index
    Elem_Employee = Node_Employee->get_Element( Index = 1 ).
    @TODO handle non existant child
    if ( Elem_Employee is initial ).
    endif.
    get single attribute
    elem_employee->get_attribute(
    exporting
    name = `USERID`
    importing
    value = item_userid ).
    select *
    from zmy_table
    into table itab
    where userid = item_userid.
    node_employee = wd_context->get_child_node( 'EMPLOYEE' ).
    node_employee->bind_elements( itab ).
    Is there someone who can help me and can tell am i doing wrong?
    Thanks in advance,
    Dheeraj

  • 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

  • How to create a Select-option and a pushbutton together

    Hi Experts,
    I have defined a selection screen in my module pool program and I am including this screen in my Module pool Dynpro. Now, my problem is that if I write the following piece of code to define my selection screen, it gives me an error that "Error when generating the selection screen "1010" of report "ZTESTHIM_MOD" ".
    SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
    SELECT-OPTIONS: s_matnr FOR  mara-matnr NO INTERVALS,
                    s_matkl FOR  mara-matkl NO INTERVALS,
                    s_mtart FOR mara-mtart NO INTERVALS,
                    s_ersda FOR mara-ersda NO INTERVALS.
    SELECTION-SCREEN PUSHBUTTON 10(5) pubu USER-COMMAND test.
    SELECTION-SCREEN END OF SCREEN 1010.
    Please help me whats the reason for this.
    Also, if I define the select-options within a block and pushbutton outside it, the code is working fine.
    The problem is that I want a select-option and a pushbutton in the same line.
    Please help me out.
    Useful answers will be duly rewarded.
    Thanks in advance.
    Regards,
    Himanshu
    null

    Hi,
    You have declared so many select options in one line and also you want to include a push button in the same line, this is not possible.
    Since the visible lenght of the line is less than the number of fields you want to display this will not be possible.
    What you can do is instead group then using
    SELECTIOn-SCREEN BEGIN OF BLOCK b1.
    here use lines
    SELECTION-SCREEN END OF BLOCK b1
    Regards,
    Sesh

  • Select-Options and check box on Selection Screen

    Hi Guru's,
    I have to develop a webdynpro report(static). I have a combination of select options and checkboxes on the selection screen. Can you please help me how to design this static selection screen.
    Thanks,
    Pradeep

    Hi Pradeep,
    WDP ABAP does not directly provide the selection screen options as in ABAP programming.
    You can achieve the selection screen functionality using the WDR_SELECT_OPTIONS component usage. Go through the WDP component WDR_TEST_SELECT_OPTIONS.
    Regards
    Wenonah

  • Select-options and ranges

    Hi all,
    Belated Happy Holi.
    Can u  explain me the difference between
    Select-options and ranges?
    When, where and how to use them ?
    I know the basic differences, but i need to know in deep .
    could u give me the informatin with a scenario please ?
    Thanks in advance
    Ravi

    HI
    <u>SELECT-OPTIONS:</u> Declare an internal table that is also linked to input fields on a selection screen
    <u>RANGES:</u> Declare an internal table with the same structure as in select-options, but without linking it to a selection screen.
    FOR FURTHER DOCUMENTATION PLEASE GO THROUGH THE LINK
    <a href="http://72.14.203.104/search?q=cache:btyoj86smhEJ:www.sap-img.com/abap/difference-between-select-options-ranges.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=1">Difference Between Select-Options & Ranges</a>
    <a href="http://72.14.203.104/search?q=cache:EJgiHLpghDEJ:help.sap.com/saphelp_nw04/helpdata/en/fc/eb3034358411d1829f0000e829fbfe/content.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=4">Statical Declaration</a>
    <a href="http://72.14.203.104/search?q=cache:VWS1erlabRIJ:help.sap.com/saphelp_nw04/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htmSelect-optionsandrangesIN+ABAP&hl=en&gl=in&ct=clnk&cd=5">Selection tables</a>
    REGARDS
    ANOOP
    Message was edited by: ANOOP R.S

  • Select options and radio button problem

    Hi All,
    In selection screen I have a select option and two radio button default is disable when I input value on select option, it will enable radio button. How can I do this?
    Thanks.
    mlai

    Please go through the below code and reward points if u find it useful:
    tables : pa0000.
    selection-screen begin of block b1 with frame title text-001.
    select-options : s_pernr for pa0000-pernr.
    parameters : r1 radiobutton group g1 modif id abc.
    parameters : r2 radiobutton group g1 modif id abc.
    selection-screen end of block b1.
    at selection-screen output.
    if s_pernr[] is initial.
    loop at screen.
    if screen-group1 = 'ABC'.
    screen-invisible = 1.
    modify screen.
    endif.
    endloop.
    else.
    loop at screen.
    if screen-group1 = 'ABC'.
    screen-invisible = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Thanks
    Vasu

  • Measure Formulae for Uploadable and Data collection report

    Hi,
    I have query related to application of measure Formula for Uploadable and Data collection report.
    Consider a scenario where i use a MDX query to create a data collection report and I map these columns from these reports to an rowsource using a loader file. Can I use measure formula feature like onchange to work with Uploadable and Data colection reports such that changes to any one column should take effect in another column.
    Regrads,
    Wesley

    Wesley,
    IOP uploadable reports are used for sending data to the server in batch. They are coupled to the IOP model via a rowsource. You have a lot of flexibility with the spreadsheet you build for staging the upload. It's really just a function of how crafty you are with vb. Cascading changes from one column to another can be easily accomplished this way.
    Onchange formulas are for something else. They are part of the model definition and are used for describing how to cascade changes between IOP data blocks.

Maybe you are looking for

  • How do I create a new user account?

    I have a new iPod with a different iTunes account than my other devices.  How do I sync the iPod on my iMac with the songs/movies from its own iTunes account?  Do I need to create a new user profle on the computer for that?

  • Separate Bank accounts for AP and AR

    Hi SAP Gurus,   My client want to have Separate Bank accounts for AP and AR,  for different  reasons, I want to know how this  configured in SAP and also I want to know  what is  standard process followed across SAP implementations Please Suggest Dis

  • Deleting Planning Profitability thru KP90 and KP91

    SAP Experts, I am trying to delete plan data in one of our plan versions, I used tcode KP90 & KP91, However, when I go to run reports to view what was deleted, I noticed that all Costing was deleted with the exception of Profitability. I read varios 

  • After latest security update cannot access my wired network

    After the latest security update on my MBP.... no longer can access wired network on laptop.  Desktop did not update.... can still access wired network. Anyone have a fix for the updated MBP? Thank, Reed

  • Saving attachment problem

    Hi, I just wrote a java code for reading mail and store the attachment on a specific folder. It works for 90%, but with some mails the system sees well that it's a multipart/mixed mail, but when I use the getDisposition() it's allways return a NULL v