Select options default value and execute

Hello,
I managed to fill my select options default value. But what I also want is that the user does not have to press the execute button when the screen is shown at the first time. I would like to show the result screen for these default values at the same time the screen is shown first.
I tried in WDDOINIT:
  data: l_ref_interfacecontroller type ref to iwci_wdr_select_options .
  l_ref_interfacecontroller =   wd_this->wd_cpifc_select_options( ).
  l_ref_interfacecontroller->execute(
but this coding only works when the select-option screen was shown the first time.
Any ideas?
regards
stefan

Hello Sascha,
I checked that WD_THIS->MR_SELOPT is filled.
My coding in WDDOINIT is:
*--- Instantiate select options component
  lr_usage = wd_this->wd_cpuse_usage_so( ).
  if lr_usage->has_active_component( ) is initial.
    lr_usage->create_component( ).
  endif.
*--- Initialize selection screen
  lr_if_controller = wd_this->wd_cpifc_usage_so( ).
  wd_this->mr_selopt = lr_if_controller->init_selection_screen( ).
*--- Configure layout options
  wd_this->mr_selopt->set_global_options(
                             i_display_btn_cancel  = abap_false
                             i_display_btn_check   = abap_false
                             i_display_btn_reset   = abap_true
                             i_display_btn_execute = abap_true ).
*--- Create range tables
  lt_range = wd_this->mr_selopt->create_range_table(
                                                   i_typename = 'DATUM' ).
*Range vorbelegen
  wa_dats = sy-datum - 30.
  wa_range_datum-sign = 'I'.
  wa_range_datum-option = 'BT'.
  wa_range_datum-low = wa_dats.
  wa_range_datum-high = sy-datum.
  assign lt_range->* to <fs_rangetable>.
  create data r_headerline like line of  <fs_rangetable>.
  assign r_headerline->* to <fs_range>.
  move-corresponding  wa_range_datum to <fs_range>.
  append <fs_range> to <fs_rangetable>.
  wd_this->mr_selopt->add_selection_field( i_id        = 'DATUM'
                                           it_result   = lt_range ).
  lt_range = wd_this->mr_selopt->create_range_table( i_typename = 'UZEIT' ).
  wd_this->mr_selopt->add_selection_field( i_id        = 'UZEIT'
                                           it_result   = lt_range ).
  lt_range = wd_this->mr_selopt->create_range_table( i_typename = 'UNAME' ).
  wd_this->mr_selopt->add_selection_field( i_id        = 'UNAME'
                                           it_result   = lt_range
                                           i_no_intervals = 'X'
                                           i_no_extension = 'X' ).
data: event type ref to cl_wd_custom_event.
create object event
  exporting
    name   = 'EXECUTE'
   parameters =
  wd_this->search_sel_opt(
    wdevent =    event                       " Ref to cl_Wd_Custom_Event
Maybe you can see my mistake?
regards
stefan

Similar Messages

  • Select options default value

    Hi,
    Kindly assist me on how to set a default value for dynamically created Select options.
    I am coding the below code snippet for default value and it's working but when I remove the default value for the select option on portal screen ...I encounter a dump stating line type does not match with internal table.
    wd_this->m_wd_select_options = wd_this->wd_cpifc_wdr_select_options_e( ).
    init the select screen
      wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
        lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'STRING' ).
        assign lt_range_table->* to <range_table>.
        insert initial line into table <range_table> assigning <range_table_line>.
        assign component 'SIGN'   of structure <range_table_line> to <sign>.
       assign component 'OPTION' of structure <range_table_line> to <option>.
        assign component 'LOW'    of structure <range_table_line> to <low>.
        assign component 'HIGH'   of structure <range_table_line> to <high>.
        <sign>   = 'I'.
        <option> = 'EQ'.
        <low>    = 'ZA'.
        clear <high>.
        wd_this->m_handler->set_range_table_of_sel_field(
          i_id          = 'DY_PARVW'
         it_range_table     = lt_range_table ).
    Points will be rewarded!!!!

    Hi.
    I use the following code (snippet) to add default values:
    lt_range = lr_selop->create_range_table(
                                        i_typename = 'VKORG' ).
      lr_selop->add_selection_field(
                         i_id = 'VKORG'
                         i_within_block = lv_id_gdata
                         i_no_intervals = abap_true
                         i_no_extension = abap_true
                         i_obligatory = abap_true
                         i_read_only = abap_true
                         it_result = lt_range
                         i_value_help_type = if_wd_value_help_handler=>co_prefix_none ).
    DATA:
            lr_user        TYPE REF TO zcl_user,
            lr_param       TYPE REF TO data,
            lr_headerline  TYPE REF TO data.
      DATA:
            ls_tmprange    TYPE rsparams.
      FIELD-SYMBOLS:
                     <fs_param>      TYPE ANY,
                     <fs_range>      TYPE ANY,
                     <fs_rangetable> TYPE table.
      lr_user = zcl_user=>get_instance( ).
      lr_param  = lr_user->get_usermaster_param(
         param_name = param_name
      ASSIGN lr_param->* TO <fs_param>.
      MOVE <fs_param> TO ls_tmprange-low.
      IF ls_tmprange-low IS NOT INITIAL.
        ls_tmprange-sign = zcl_salsa_assistance=>userparam_sign_default.
        ls_tmprange-option = zcl_salsa_assistance=>userparam_option_default.
        ASSIGN lr_range->* TO <fs_rangetable>.
        CREATE DATA lr_headerline LIKE LINE OF  <fs_rangetable>.
        ASSIGN lr_headerline->* TO <fs_range>.
        MOVE-CORRESPONDING  ls_tmprange TO <fs_range>.
        APPEND <fs_range> TO <fs_rangetable>.
      ENDIF.
    lr_user->get_usermaster_param( param_name = param_name ) just returns a data reference to a parameter value.
    After assigning this value to the range table i do not have to call set_range_table_of_sel_field cause lr_range is already a reference to the range table.
    This works well and I can remove the default value without getting dumps.
    Cheers,
    Sascha

  • Populate SELECT-OPTIONS default value using CALL FUNCTION

    Hi Experts,
    I would like to populate SELECT-OPTIONS s_currm default with value in w_currm, however, it doesn't seem to work.  Can you please advise what the correct syntax is.
    Note that CALL FUNCTION 'GET_CURRENT_YEAR' is working correctly and populating w_currm (as I can use it in a SQL SELECT statement), however, it does not seem to work for SELECT-OPTIONS s_currm.
    Thank you for your time.
    Code snippet is as a follows:
    REPORT  Z_DOWNLOAD_BSIS_TEST.
    *Data Declaration
    DATA: w_currm TYPE BSIS-MONAT.
    *Define current fiscal month
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        BUKRS         = 'X999'     " Company Code
        DATE          = SY-DATUM   " Date to find fiscal year for
      IMPORTING
        CURRM         = w_currm.   " Current Fiscal Month
    SELECT-OPTIONS s_currm FOR w_currm
                   DEFAULT w_currm. " The default value is NOT being populated (appears blank)

    Hi Venkat.O,
    Thank you for your clear response.  I have implemented your suggestion and it works, however, I now have a new problem. 
    Each time the report is executed or the "multiple selection" button is clicked the selection fields are populated once again with the default (low) values.
    For example, when report is first opened the s_curry field displays '2010'.  Clicking "multiple selection" results in another '2010' being populated.  After executing the report the selection screen is populated again with '2010' (so we now have '2010' listed 3 times in the s_curry field).
    How do I prevent the default values from repeating?
    REPORT  Z_DOWNLOAD_BSIS_TEST
    *Data Declaration
    DATA:  w_currm TYPE BSIS-MONAT,
           w_curry TYPE BSIS-GJAHR,
           w_prevm TYPE BSIS-MONAT,
           w_prevy TYPE BSIS-GJAHR.
    SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME TITLE text-001 .
    *Parameters to enter the path
    PARAMETERS: FILENAME(128) OBLIGATORY DEFAULT '/usr/sap/tmp/TEST.txt'
                             LOWER CASE.
    SELECT-OPTIONS: s_curry FOR w_curry,
                    s_currm FOR w_currm.
    SELECTION-SCREEN END OF BLOCK b11.
    AT SELECTION-SCREEN OUTPUT.
    *Define current/previous financial periods
    CALL FUNCTION 'GET_CURRENT_YEAR'
      EXPORTING
        BUKRS         = 'X999'     " Company Code
        DATE          = SY-DATUM   " Date to find fiscal year for
      IMPORTING
        CURRM         = w_currm    " Current Fiscal Month
        CURRY         = w_curry    " Current Fiscal Year
        PREVM         = w_prevm    " Previous Fiscal Month
        PREVY         = w_prevy.   " Previous Fiscal Year
        s_curry-low = w_curry.
        s_curry-option = 'EQ'.
        s_curry-sign = 'I'.
        APPEND s_curry.
        CLEAR  s_curry.
        s_currm-low = w_currm.
        s_currm-option = 'EQ'.
        s_currm-sign = 'I'.
        APPEND s_currm.
        CLEAR  s_currm.

  • Help on the selection screen.....Select-options default values

    Dear Friends,
    We have one requirement,i.e. In Report program i am using select-option once will execute the program ALV report will be generated.In ALV Report we have one button like 'WM DATA'.Once click the WMDATA one pop-up is displaying...In that pop-up also same select-options are there upto here it's working fine...Now my problem is on pop-up select-options i have to display by default..... which i am using on report select-options values.
    Please help on the same
    Thank You.

    Do like this. Before calling your next screen assign the select option value or just assign the value in start of selection only.
    tables
    :lqua.
    SELECT-OPTIONS:
    s_lgnum FOR lqua-lgnum MODIF ID sc1 OBLIGATORY,
    s_lgtyp FOR lqua-lgtyp MODIF ID sc1.
    SELECTION-SCREEN BEGIN OF SCREEN 300 .
    SELECT-OPTIONS : s_lgnum1 FOR lqua-lgnum OBLIGATORY,
    s_lgtyp1 FOR lqua-lgtyp OBLIGATORY.
    SELECTION-SCREEN END OF SCREEN 300.
    START-OF-SELECTION.
    s_lgnum1[] = s_lgnum[].
    s_lgtyp1[] = s_lgtyp[].
    call SELECTION-SCREEN 300.

  • Select-option default value???

    DATA: gsber1         like csks-gsber.
    select distinct GSBER
      into (gsber1)
      from csks
    where kostl = sch_kostl.
    endselect.
      SELECT-OPTIONS : gsber    FOR csks-gsber DEFAULT gsber1.
    why not input value gsber1?

    Pung,
    Pls. see the docs. below.
    To assign default values to a selection criterion, you use the following syntax:
    SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] ....
    Default values <g> and <h> can be literals or field names. You can only use fields that contain a value when the program is started. These fields include several predefined data objects.
    For each SELECT-OPTIONS statement, you can specify only one DEFAULT addition. This means that you can fill only the first row of selection table <seltab> with default values. To fill more rows with default values, the selection table must be processed before the selection screen is called, for example, during the AT SELECTION-SCREEN -OUTPUT event.
    You use the DEFAULT addition as follows to address the individual components of the first row:
    To fill only the LOW field (single field comparison), use:
    ........DEFAULT <g>.
    To fill the LOW and HIGH fields (range selection), use:
    ........DEFAULT <g> TO <h>.
    To fill the OPTION field, use:
    ........DEFAULT <g> [to <h>] OPTION <op>.
    For single field comparisons, <op> can be EQ, NE, GE, GT, LE, LT, CP, or NP. The default value is EQ. For range selections, <op> can be BT or NB. The default value is BT.
    To fill the SIGN field, use:
    ........DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>.
    The value of <s> can be I or E. The default value is I.
    The input fields of the selection criterion are filled with the default values. The user can accept or change these values.
    REPORT DEMO.
    DATA WA_SPFLI TYPE SPFLI.
    SELECT-OPTIONS AIRLINE FOR WA_SPFLI-CARRID
                   DEFAULT 'AA'
                        TO 'LH'
                    OPTION  NB
                      SIGN  I.
    Don't forget ot reward if useful...

  • WD4A select options, default value

    Hello,
    while using the select option screen i tried to fill a default value in one of my fields. I used:
    *add a new field to the selection
      wd_this->m_handler->add_selection_field(
      i_id = 'Z_TEST'
      it_result = lt_range_table
      i_memory_id = 'SXV'
      i_no_intervals = abap_true
      i_no_extension =  abap_true ).
    I checked that the parameter ID SXV is filled but there is no default value in the dynpro.
    Any ideas?
    best regards
    stefan

    Hi Stefan.
    Is it necessary to use memory id's for you?
    It is quiet easy to work with field-symbols and
    add a value to the range table:
      data:
            ls_tmprange    type rsparams.
      field-symbols:
                     <fs_param>      type any,
                     <fs_range>      type any,
                     <fs_rangetable> type table.
      ls_tmprange-low = some value.
      ls_tmprange-sign = some value.
      ls_tmprange-option = some value.
      assign lt_range_table->* to <fs_rangetable>.
      create DATA lr_headerline like LINE OF  <fs_rangetable>.
      ASSIGN lr_headerline->* to <fs_range>.
      move-CORRESPONDING  ls_tmprange to <fs_range>.
      append <fs_range> to <fs_rangetable>.
    After that you can call add_selection_field with lt_range_table.
    Hope this helps.
    Cheers,
    Sascha

  • Select-option default values

    Hi,
    I have date as select-option.
    I am required to
    default current date minus one day to current date .simply my select-option-low = sy-datum-1,
    select-option-high = sy-datum should be defaulted.
    How to do this...?
    thanks

    HI,
    Please refer the code below:
    tables: bsis.
    select-options : so_date for bsis-budat.
    at selection-screen output.
    so_date-low = sy-datum-1.
    so_date-high = sy-datum.
    append so_date.
    Thanks,
    Sriram Ponna.

  • Dynamic variant for select option High value

    Hi ,
    Please help me in creating dynamic variable for a select option date field high value.
    II tried the following method:
    1. Enter the values in the selection screen
    2. Save the variant using the SAVE button
    3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
    4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (i.e. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    5. Save the variant.
    But it is saving the date value in Field LOW of select option( From value).
    I need it in TO field( High value).
    Please help.
    regards,
    Sheeba

    Hi Sheeba
        we can do it other way .. Select the same steps as you have done but after the assigning the value current date to low ..click on the selection option push button at the application bar and choose the 'less than or equal to' option to your select option value and try the same ....
    I guess this would throw you same results as that of the value in the high value button
    Cheers,
    Jacks.

  • Check select-options parametr value

    hi,
    i want to check if select-option parameter value is '002' then execute some code, how can i do that .
    thanks in advance,
    ramakrishna buddala.
    Moderator Message: Not enough search done. Thread locked.
    Edited by: Suhas Saha on Oct 20, 2011 3:15 PM

    Hi
    Perform the validation in AT Selection-screen on field event.If validation is not succes then give error message.
    AT selection-screen on <Fieldname>.
    if fieldname-low <> '002'.
       message '<Message Text>' type 'E'.
    endif.
    Regards.
    Raghu.

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • SSRS 2008 R2 Report parameters have default values and report not to auto run

    Hi, I am using SSRS 2008 R2 one of my requirements for a Report is all the parameters have default value and I do not want this report to auto run when users open this report. I can create a dummy hidden parameter to break the auto run for this
    report. But I am looking for solutions other than that.
    Thanks in advance..........
    Ione

    Hi lone,
    According to your description, you have a report with parameters. Now you want you report not to run automatically with your parameters default values. Right?
    In Reporting Service, if you have parameters with default values in your report, your report will always auto run with these default values. We can say these default values are used for report running initially. So for your requirement, if you really need
    to see your default value before the report running, the best workaround is set one more parameter to break the auto run like you have done. If you just want your report not to auto run, your can achieve it by removing those default values.
    Reference:
    Report Parameters (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou (Pactera)

  • How to set default value and bg color of cross tab cell?

    Hi all
    Which way can I set default value and background color for a crosstab cell where there are no any data?
    I try to pass it in following way
    if isnull(CurrentFieldValue) then
    But is has no effect.

    Hi,
    If your field is numeric
    if currentfieldvalue =0 then cryellow else crnocolor
    if the field is numeric but you don't see the 0 check check if : Suppress if zero is ticked in the Number format tab.
    Regards

  • Initializu00EDng select options field with default values and with NO INTERVALS

    Dear All,
    I have used WDR_SELECT_OPTIONS technology within WD Abap.
    I also have added the fields which have to be taken into consideration.
    lt_range_table =
    wd_this->m_handler->create_range_table(
    i_typename = 'PLANT' ).
    wd_this->m_handler->add_selection_field(
    i_id = 'PLANT'
    it_result = lt_range_table
    i_read_only = read_only ).
    Can I assign two values to this field 'PLANT' whereby the user may take only these values.
    I mean kind of pre initializíng of this select options field with default values.
    Due to this handling it should be prevented that the user can give other values
    except this values.
    Additonally it should be fine whether it is possible to disable the second input field
    of this select options field like NO INTERVALS .
    Regard
    sas
    Regard
    sas

    wd_this->m_handler->add_selection_field(
    i_id = 'PLANT'
    it_result = lt_range_table
    I_NO_INTERVALS = 'X'
    i_read_only = read_only ).
    Pls check 'WDR_TEST_SELECT_OPTIONS' web dynpro component

  • Infoset-query-selection-screen-default-values

    Hi All,
    I am having the requirement as I need to put default values in the selecion-screen of the report by using  Infoset query. Let me know the settings required for this.
    I am using SQ01, SQ02, SQ03 T.Codes.
    And I need display  one record only if any field contains mulitple records, for example in the HR-ABAP, field p0105-usrid contains multiple values depending on the subtype.So, I need to display USRID when URSTY = '900'. All these should display by Infoset query only.
    Pls help me in this scenario , its an urgent requirement.I am very much thankful for you for reading my proble, if you will provide some sort of solution, I feel very happy.
    Advance thanks for this .
    Regards,
    Prakash.

    Prakash,
    To default the values on your selection screen, you will need to do some ABAP I guess. (if you do not want to use variant). Open up the infioset in SQ02 and then goto code option for the PNP**** field and then you can code to initialize the selection screen variables. Test with an ABAPer.
    To display multiple records as multiple columns, you will have to create custom fields in infoset, and then go from there. Again see ABAPer.

  • Selection Screen Default Values

    Hi,
    The selection screen can have the default values by using the parameter ID. To be the parameter ID value to defaulted we normally add the entry in User Profile>Own data>paramters with Parameter ID and the value.
    I would like to know is there any other way to achieve the same, it could be parameter or select-options.
    With Regards,
    Azhar

    For Parameter u can use DEFAULT keyword
    eg. PARAMETERS: p_matnr TYPE mara-matnr DEFAULT 'B1200'.
    For select option
    As u might be knowing select options creates an intenal table, so if  u want to have some default values then u can use the following code in the INITIALIZATION event:
    DATA: v_matnr TYPE mara-matnr.
    INITIALIZATION.
    SELECT-OPTIONS: s_matnr FOR v_matnr.
    s_matnr-low = 'BT100'.
    s_matnr-high = 'BT900'.
    append s_matnr.
    This will give default values in the selection screen for select-options.

Maybe you are looking for