Providing Default values to Select-Options in WD ABAP

Dear Experts,
Using reusable component  WDR_SELECT_OPTIONS im able to create select-options successfully ... I need your guidance to provide default values(type date) on the same select-options.
Thanks a lot.
Regards
Siva Mandapudi.

I do not see the relevance of this thread to FPM. Please follow this thread for your solution.
[Default the value in  Parameter in wdr_select_options|Default the value in  Parameter in wdr_select_options]

Similar Messages

  • Default Values for Select-options In Webdynpro-ABAP

    Hi Freinds,
    Kindly,Help me in setting the Default values for the Select-options in Webdynpro ABAP.
    Here the Node and the Attributes are Created Dynamically, and then Displayed Select-options Component View.
    Regards,
    Xavier.P

    Xavier Reddy Penta sent me this question via email and I answered it directly yesterday. Here is the solution that I provided to him, so that it is stored with the original question:
    I believe your problem is that you are not setting the value into the range correctly.  You are setting it directly into the field symbol of the range like such:
    <FS> = L_STRING2.
    But ranges are deep objects. They have four fields: Sign, Option, High, and Low. This is from the online help:
    1.     sign of type c and length 1. The content of sign determines for every row whether the result of the condition formulated in the column is included or excluded in the entire resulting set for all rows. Evaluable values are "I" for include and "E" for exclude.
    2.     option of type c and length 2. option contains the selection option for the condition of the row in form of logical operators. Analyzable operators are "EQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP" if column high is initial, and "BT", "NB" if column high is not initial. With the options "CP" and "NP", the data type of the columns low and high must be of the data type c, and special rules apply for entries on the selection screen.
    3.     low of the data type defined after FOR. This column is designated for the comparison value or the lower interval limitation.
    4.     high of the data type defined after FOR. This column is designated for the upper interval limitation.
    So when you are moving the value into the field symbol you are setting it into the sign column.
    Here is an example of how you can access the components of the range:
    * create a range table that consists of this new data element
        lt_range_table =
          wd_this->lv_sel_handler->create_range_table(
               i_typename = l_typename ).
        IF l_fieldname = 'CARRID'.
          FIELD-SYMBOLS: <tab>         TYPE INDEX TABLE,
                             <struct>      TYPE ANY,
                             <wa>          TYPE ANY,
                             <option>      TYPE char2,
                             <sign>        TYPE char1,
                             <high>        TYPE ANY,
                             <low>         TYPE ANY,
                             <wa_values>   TYPE ANY.
          ASSIGN lt_range_table->* TO <tab>.
          APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
          <sign> = 'I'.
          <option> =  'EQ'.
          <low> = 'AA'.
        ENDIF.

  • How to set default value in select option for ABAP query

    Hi experts,
    What is the way to set up default values for select-options in ABAP query.
    e.g.
    I have one field 'Year' in my ABAP query selection screen.
    I want value of current year to be appeared here whenever user execute report
    Thanks in Advance
    -Harkamal

    Hi Harkamal,
    execute your Query via SQ01. On Selection-Screen
    goto save Variant. Mark your field
    as selection variable an press Button election variable.
    Take variable from TVARV and use it.
    Than save the Variant.
    Look at TVARV if the 'Year' is updated to the actualYear!
    regards, Dieter

  • Set of default values for Select-Options

    Hi Gurus,
    I have a requirement where I need to set default values for select options
    ex: SELECT-OPTIONS: S_MTART FOR MARA-MTART
    default values must be ERSA - HIBE- FHMI - DIEN - GEST
    Please tell me how to do it.
    Effective replies will be rewarded with full points
    Karthik

    Hi,
    For each SELECT-OPTION, you can only specify one DEFAULT.
    You must specify the default value g in its internal format, e.g. "SELECT-OPTIONS DATE FOR SY-DATUM DEFAULT '19931224'", not "... DEFAULT '24.12.1993'".
    The default value g should normally be a literal because, at runtime when you use SUBMIT, it is transferred to the selection options table sel so early that no value can be assigned to the field g. System fields like SY-DATUM are an exception here because the system usually assigns values to them as soon as the report processing starts.
    When you use user-defined selection screens in your programs that you do not call using SUBMIT, the DEFAULT value is transfered when the selection screen is first called. In this case, therefore, you can use other fields g.
    regards,
    sowjanya
    Message was edited by: sowjanya suggula

  • How to assign list of default value for select-option variable???

    Hi every one
    This is Deepak,
    I want to know how to assign list of default value to select-option variable ? please any body tel me solution
    for example
    select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
    Thank you in advance
    Deepak

    Hi.
    Check the following sample code.
    REPORT ztn_test.
    " It is example for list populating.
    TABLES:knvp.
    data: BEGIN OF itab OCCURS 10,
          kunnr like knvp-kunnr,
          END OF itab.
    data: wa_itab like itab.
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id,
    list TYPE vrm_values,
    value LIKE LINE OF list.
    PARAMETERS: s_kunnr(20) type c  as LISTBOX VISIBLE LENGTH 40 .
    AT SELECTION-SCREEN OUTPUT.
    SELECT kunnr from knvp  into  CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
    " I have used loop to populate some values from table
    loop at itab into wa_itab.
      name = 'S_KUNNR'.
      value-key = sy-tabix.
      value-text = wa_itab-kunnr.
      append value to list.
      clear wa_itab.
    endloop.
    " If u want individaully assign the values change the code as
    name = 'S_KUNNR'." Select option name
      value-key = 1." Index
      value-text = 'VAL1'.
      append value to list.
    name = 'S_KUNNR'." Select option name
      value-key = 2." Index
      value-text = 'VAL2'.
      append value to list.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING id = name
    values = list.
    Edited by: tahir naqqash on Feb 21, 2009 4:38 PM

  • Default  value for select options.

    Hi folks
    I have to default four values in select-options.
    eg.,
    S_lfart for likp-lfart, default zse, zin, znd, zps.
    Thanks in Advance,
    Rao

    Hi,
    Go through the following syntax:
    SELECT-OPTIONS <sel> FOR <f>
                   [DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>]
                   [MEMORY ID <pid>]
                   [LOWER CASE]
                   [OBLIGATORY]
                   [NO-DISPLAY]
                   [MODIF ID <key>]
                   [NO-EXTENSION]
                   [NO INTERVALS]
                   [NO DATABASE SELECTION].
    Declares a selection table <sel> for the field <f>. For <sel>, places input fields on the corresponding selection screen. The additions allow you to set a default value, accept input in lowercase, define a required field, suppress or modify the display on the selection screen, restrict the selection table to a line or a selection to a single field, or prevent input from being passed to a logical database
    Regards,
    Bhaskar

  • Specific default values for select-options high and low

    Hi
    My requirement is in the selection screen i have a select-options field for which i need to give default values as mentioned below.
    Description                              Data Type       Default Value     Mandatory?             Sel Scrn Type     
    Delivery/BOL Date        ekab-bedat                         1st DOM to current day     Y              Range     
    The datatype is ekab-bedat.
    In the low value field ,it should be 1st Date of month(DOM) and in the high value field it should be current day.
    Give me the code for the same asap.

    >
    sreedeep.sreekumar wrote:
    > Dont mistake my intensions. When i tried to write it in the form of a request it showed me that it cannot me posted beacuse the words that i am using (please,kindly) is not following the terms and conditions of the words to be written in the threads
    Sounds quite vague to me.
    >
    sreedeep.sreekumar wrote:
    > I was asking help for this as i am a novice in SAP-ABAP and i couldnt find solutions for it and also i have seen people directly writing codes for the queries.
    Becuase you see people posting pieces of code doesn't mean you can ask for a solution asap. Besides, whether you're new or a veteran in ABAP, what you need can be solved with some very basic knowlegde of ABAP. Just use a bit of common sense.

  • Default values for Select options

    Hi All,
      I want to have default values X0 and ND for a select-options field.how can i get the same?
    Thanks,
    Rakesh.

    Initialization.
    s_akont-low = 'X0'.
    s_akont-sign = 'I'.
    s_akont-option = 'EQ'.
    APPEND s_akont.
    s_akont-low = 'ND'.
    APPEND s_akont.

  • Default values in select options

    Hi Experts ,
    Could some one please explain how we can fill the select option fields with initial values, my current code is giving a "The current application triggered a termination with a short dump " dump
    My Code:
    data:lt_range_table       type ref to data,
        rt_range_table       type ref to data,
        read_only            type abap_bool,
        typename             type string.
    data: lt_vendor      type ref to data,
          lt_vendor_site      type ref to data,
          lt_vendor_country     type ref to data,
          lt_vs_country type ref to data,
          lt_material    type ref to data.
    field-symbols: <fs_vendor>      type table,
                   <fs_vendor_site>      type table,
                   <fs_vendor_country>     type table,
                   <fs_vs_country> type table,
                   <fs_material>    type table.
    data:lr_componentcontroller type ref to ig_componentcontroller,
         l_ref_cmp_usage type ref to if_wd_component_usage.
    create the used component
      l_ref_cmp_usage = wd_this->wd_cpuse_use_select_options( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
    get a pointer to the interface controller of the select options
    *component
      wd_this->m_wd_select_options =
           wd_this->wd_cpifc_use_select_options( ).
    init the select screen
      wd_this->m_handler =
           wd_this->m_wd_select_options->init_selection_screen( ).
    *>>>> For Vendor
    CALL METHOD wd_this->m_handler->set_range_table_of_sel_field
      EXPORTING
        i_id           = 'LIFNR'
        it_range_table =   lt_vendor  *.
    In The Above code the table  lt_vendor   does have a value and is of ref type 'DATA'.so i am pretty sure that is not the issue.
    Edited by: Kalpana Arumugam on Nov 8, 2008 3:38 PM

    Hi
    What exactely u need? U follow the Drill Down method and get values in according to ur way.
    If u need for EX code for Dril down..
    Regards:
    Prabu

  • How to make default values in selection field?

    hi,
          i have selection field date , using data element 'QENTST' using following code in view INIT Method. i get the input selection field when i test application.
    DATA: LT_RANGE_TABLE TYPE REF TO DATA.
    CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
      EXPORTING
        I_TYPENAME                     =     'QENTST'
      RECEIVING
        RT_RANGE_TABLE           =     LT_RANGE_TABLE.
    CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
      EXPORTING
        I_ID                                     = 'QENTST'
        IT_RESULT                         = LT_RANGE_TABLE
        I_OBLIGATORY                 = ABAP_TRUE.
    What i need now , to make default value in this selection field( low = sy-datum and high = sy-datum + 10 ) . I have checked , i found one method called... SET_RANGE_TABLE_OF_SEL_FIELD. Bt i m not able to understand how to assign values to input table parameter in this method?
    Thanks In Advance.
    Saurin Shah

    Hi,
    Refer this Article by Thomas on how to make default values in Select Options:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60474842-91ca-2b10-3390-d2fd30f335fd
    I hope it would solve your problem.

  • How to get default values on selection screen(multiple ranges)?

    i want to know how to maintain default ranges in selection screen...like 2000 to 3000 and 7000 to 8000 and 11000 to 15000
    all the above ranges must get by default how to provide those to selection screen by default...please give me idea...with example...

    Hi Suresh,
    You can either use select-options or Ranges. If you want the selection screen to be displayed with allwoing user to enter values apart for the default ones use select options else use ranges. With ranges what ever values use hard code would be set and the end user will not be able to add any more values (or range of values).
    Simply write the following code
    tables : <name of the table from which the field belongs>
    select-options <fieldname> for <tablename>-<fieldname>.
    <fieldname>-sign = 'I'.
    <fieldname>-option = 'BT'.
    <fieldname>-low = '7000'.
    <fieldname>-high = '8000'.
    append <fieldname>..
    similiarly add all the ranges that you need to include as default and in your select statement use the IN operator inthe where clause to include the range.
    If using range replacethe select-option with the range statement.
    Thanks.

  • How to Captured Value into Select-Options Range Table Without "Enter"

    Hi,
    I defined a set of Select-Options in the Web Dynpro. I found that the value for the Select-Options will not be captured whenever I manually type in the value instead of choosing it from F4 Help Drop Down.
    However, this problem can be resolved if I manually type in the value for Select-Options in the Selection Field and I press "Enter". Without pressing "Enter" value will not be captured.
    Any solution for this issue? Please help.

    Hi Kris,
    My problem is only when the user key in the value themselves rather than choosing it from Select-Options drop down value. Most of the time user will know what value to key in and will skip the step to choose from the Drop Down List. Thus, if this happen, the value keyed in by the user will not be able to capture into the range table.
    I am using this logic to capture the value for selection item:
      wd_this->m_helper->get_selection_screen_items(
        IMPORTING et_selection_screen_items = lt_sel_item ).
    * Values From Selection Screen
      LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
        CASE <fs_sel_item>-m_id.
          WHEN `PERNR`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_pernr>.
          WHEN `BUKRS`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_bukrs>.
          WHEN `STAT2`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_stat2>.
          WHEN `WERKS`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_werks>.
          WHEN `BTRTL`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_btrtl>.
          WHEN `PERSG`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_persg>.
          WHEN `PERSK`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_persk>.
          WHEN `ABKRS`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_abkrs>.
          WHEN `BEGDA`.
            ASSIGN <fs_sel_item>-m_value->* TO <fs_begda>.
        ENDCASE.
      ENDLOOP.
    E.g. User key in the BUKRS without using the Drop Down Value provided by the Select-Options. For this case, <fs_bukrs> table will be initial as no value is captured.
    Edited by: Girish Nabar on Apr 21, 2011 8:55 AM

  • Passing value to select options screen.

    Hi All,
    Can anybody help me how to pass a value to select option screen from another screen?
    It's like a user enters a value in a input field and press a button to navigate to the next screen which contains the select option fields.How can i show the value enterd in the previous screen to be shown in one of teh  input field in the select option screen.

    Hi,
    Store the values that you have to pass in a global variable declared in component controller and
    Use the following piece of code in the second view,
    DATA: lt_range_table TYPE REF TO data,
              rt_range_table TYPE REF TO data,
              read_only TYPE abap_bool,
              typename TYPE string.
    * create a range table that consists of this new data element
      lt_range_table = lo_r_helper_class->create_range_table( i_typename = 'MATNR' ).
    FIELD-SYMBOLS: <tab> TYPE INDEX TABLE,
    <struct> TYPE ANY,
    <wa> TYPE ANY,
    <option> TYPE char2,
    <sign> TYPE char1,
    <high> TYPE ANY,
    <low> TYPE ANY,
    <wa_values> TYPE ANY.
    ASSIGN lt_range_table->* TO <tab>.
    APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
    ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
    ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
    ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
    ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
    <sign> = 'I'. "Default sign which you want to give
    <option> = 'EQ'. "Default option you want to give
    <low> = 'M-01'." pass your valriable name here
    *<high> = 'High_value'.
    * add a new field to the selection
      lo_r_helper_class->add_selection_field( i_id = 'S_MATNR'
      i_description = 'Material'
      it_result = lt_range_table ).
    Regards,
    Radhika.

  • Default value for selection screen field

    Hi all,
      I am using LDB PNPCE. I want to give default value for field Personnel area on selection screen.
    How can I do it?
    Thanks
    Rahul

    Hi Rahul,
    In the INITIALIZATION event we can set the default values for selection screen fields.
    INITIALIZATION.
    loop at screen.
    if screen-name = 'S_MATNR-LOW'.
    CLEAR S_MATNR.
    s_matnr-low = '1234'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr.
    CLEAR S_MATNR.
    s_matnr-high = '5678'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr
    clear s_matnr.
    endif.
    endloop.
    Hope it helps.
    Mark if useful
    Regards,
    Saumya

  • Getting values from select option

    Hi,
    I have a requirement where the user is going to pass values in select-option  in low and high. lets say s_bwart(movement types).
    now i have to fetch this bwart values into an internal table.
    my internal table will be having only one field that is bwart. so how do i populate my internal table with those values. could any body help me in this.
    Thanks in advance
    neha

    Hi, when using SELECT-OPTIONS, use can pretty much do any kind of selection he wants, including ranges, and excluding values, so the best way to handle it is to select from the data base when the user executes the report.  for example.
    data: begin of ibwart occurs 0,
          bwart type mseg-bwart,
          end of ibwart.
    select-options: s_Bwart for mseg-bwart.
    start-of-selection.
    select bwart into table ibwart
               from <b>T156</b>
                     where bwart in s_bwart.
    Regards,
    Rich Heilman

Maybe you are looking for

  • How do I reinstall the OS on a solid-state imac

    how do I reinstall the OS on a solid-state imac

  • What is SPRY??

    I am redesigning a website and want to make it primarily XML driven as the content is updated quite a lot. This is my first project since upgrading to CS3 and have just come accross SPRY but have no idea what it is. Everything ive found about it on t

  • Down Payment Requests wf

    Hi all, I'm trying to understand which is the start event after a down payment request creation (F-47 or FBA6 tx). SWEL doesn't show anything and I don't know why. Can you help me? Thanks in advance. Kind regards, Angelo

  • Virtual Infoprovider with DB2 as source system.

    Hi Experts, Can we create a Virtual / Remote Cube with DB2 as a source system.? Are there any specific systems that are supported by SAP to create a Virtual infoprovider. Thanks in advance. Regards, Hardik Luthra

  • Images still not printing

    In my program, 5 images should be printed, but it only prints one image , the last image I create. I am not sure why this happens, please help. import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import javax.imagei