Collapase Select Options Tray

Hi All,
I am reusing Select Options( WDR_SELECT_OPTIONS ) in my screen.
Is there a way to collapse the Tray(  if_wd_select_options=>mc_block_type_tray ) of Select Options when the page is initially loaded.
This is  my code for Adding a tray and adding select option fields using add_selection_field later.
* create a block
  wd_this->l_handler->add_block(  i_id         = 'ID01'
                                  i_block_type            = if_wd_select_options=>mc_block_type_tray
                                  i_title                      =  ' '
                                  i_width                    = '100%').
Thanks

Hi Santosh,
There is no standard method available to control the behaviour BLOCK  of WDR_SELECT_OPTION.
You need to do an enhancement in view SELECTION_SCREEN of component and use the post exit of WDDOMODIFYVIEW( ) method.
Sample code;
  IF FIRST_TIME EQ ABAP_TRUE.
    DATA LO_TRAY TYPE REF TO CL_WD_TRAY.
      LO_TRAY ?= VIEW->GET_ELEMENT('ID01').
  if lo_tray is bound.
      LO_TRAY->SET_EXPANDED( ABAP_FALSE ).
  endif.
  ENDIF.
Note: the changes made in WDR_SELECT_OPTIONS may impact globally for other applications. Instead you can copy the component WDR_SELECT_OPTION and do the necessary changes.
Hope this helps you.
Regards,
Rama

Similar Messages

  • How to Expand/Collapse Select Option Tray

    Hi,
    I have a View in which I have dynamically created a select-option Tray and then added select-options within the Tray using:
    DATA lr_cost_ctr            TYPE REF TO data.
    DATA lr_interfacecontroller TYPE REF TO iwci_wdr_select_options.
    DATA lr_select_options      TYPE REF TO if_wd_select_options.
    * Initialise the selection screen.
      lr_interfacecontroller = wd_this->wd_cpifc_select_options_search( ).
      lr_select_options =
               lr_interfacecontroller->init_selection_screen( ).
    * Add a tray.
      lr_select_options->add_block(
        i_id           = 'TRY_ACCT_***'
        i_block_type   = if_wd_select_options=>mc_block_type_tray
        i_title        = 'Account Assignment' ).
    * Add a Select Option.
      lr_cost_ctr = lr_select_options->create_range_table( 'KOSTL' ).
      lr_select_options->add_selection_field(
        i_id              = 'COST_CTR'
        i_within_block    = 'TRY_ACCT_***'
        it_result         = lr_cost_ctr ).
    This works fine, but how do I dynamically expand and collapse the select-option Tray ?  There are plenty of examples for expanding/collapsing normal Trays by binding the "expanded" attribute at design time or dynamically.  But with a Tray created as a select-option block I do not have a reference to the Tray.
    I have searched high and low but cannot find how to do this.
    I don't want to create the Tray at design time because there will be select-options above and within the Tray.
    Any help will be appreciated.
    Thanks & regards,
    Grogan

    Hi,
    My Approch is:
    ---Initially set the webBean property in processReq
    Hgrid.setAutoQuery(false);
    ---On Button click navigate to the same page n set the webBean properties..
    put var in session.
    pageContext.forwardImmediatelyToCurrentPage(null, true, null);
    ---in process req get teh value of var from session.
    if(pageContext.getSessionValue(var)!= null)
    Hgrid.setAutoQuery(true);
    Hope it will helps..:)
    Note:
    ---We cant modify the webBean properties in processformReq and processformdata.
    Regards
    Meher Irk

  • Unable to see select options in view

    HI ,
    I have the following code in the WdDOINIT method of my view for viewing a field as a select option...
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
    l_ref_cmp_usage =   wd_this->wd_cpuse_select_options( ).
    IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
      l_ref_cmp_usage->create_component( ).
    ENDIF.
    DATA: l_ref_interfacecontroller1 TYPE REF TO iwci_wdr_select_options .
    l_ref_interfacecontroller1 =   wd_this->wd_cpifc_select_options( ).
      DATA:
        l_r_helper_class TYPE REF TO if_wd_select_options.
      l_r_helper_class = l_ref_interfacecontroller1->init_selection_screen(
    data lt_range_table type ref to data.
    CALL METHOD l_r_helper_class->create_range_table
      EXPORTING
        i_typename     = 'BUKRS'
       i_length       =
       i_decimals     =
      receiving
        rt_range_table = lt_range_table
    CALL METHOD l_r_helper_class->add_selection_field
      EXPORTING
        i_id                         = 'BUKRS'
       i_within_block               = mc_id_main_block
        i_description                = 'Empresa'
       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_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            =
    Besides this, the WND_SELECTION_SCREEN view is embedded in the respective container as follows...
    Tray - >Container - this container has the WND_SELECTION_SCREEN.
    I can see the tray in the view cannot see any field (expectation was to see a select-option for BUKRS.
    Any hints? Am i missing something. I have followed the tutorial for select options in webdynpro abap.
    regards,
    Priyank

    Hi Sascha,
    No i cannot see the buttons either.
    Following is how the view is embedded.
    View - > Tray - >viewcontaineruielement-> wnd_selection_screen.
    Am i missing something?
    regards,
    Priyank

  • Using Select options how to validate

    Hi Experts,
    I am using webdynpro abap component select options.In select options i am using vbeln field i want to validate the entered value.How to validate it.Can give me for this solution is there any example provide me.

    Hi Chandra sekhar ,
    Can you give me the clear idea for validation.I have done initially in wddoinit
    method WDDOINIT .
    * Reference variable used instantiate the select-options component
    DATA
    lr_cmp_usage TYPE REF TO if_wd_component_usage.
    * Variables used to create the select-options fields and
    * define its initial values
    DATA:
    lr_field TYPE REF TO data.
    FIELD-SYMBOLS:
    <fs_field> TYPE ANY,
    <fs_range> TYPE INDEX TABLE.
    * Instantiate the select-options component
    lr_cmp_usage = wd_this->wd_cpuse_cmp_sel_opt( ).
    IF lr_cmp_usage->has_active_component( ) IS INITIAL.
    lr_cmp_usage->create_component( ).
    ENDIF.
    * Sets the helper reference
    wd_this->m_sel_opt = wd_this->wd_cpifc_cmp_sel_opt( ).
    wd_this->m_helper = wd_this->m_sel_opt->init_selection_screen( ).
    * Hide the standard select-options components.
    wd_this->m_helper->set_global_options(
    i_display_btn_cancel = abap_false
    i_display_btn_check = abap_false
    i_display_btn_reset = abap_false ).
    * Adding a block (type Tray) to the select-options
    wd_this->m_helper->add_block(
    i_id = `BL01`
    i_block_type = if_wd_select_options=>mc_block_type_tray
    i_title = `Flight Booking` ).
    * Adding a parameter field to the created block
    * Create a reference to the type of airline code
    CREATE DATA lr_field TYPE s_carr_id.
    * Sets the airline code initial value
    ASSIGN lr_field->* TO <fs_field>.
    <fs_field> = 'AA '.
    * Add the parameter to the group
    wd_this->m_helper->add_parameter_field(
    i_id = `CARRID`
    i_within_block = `BL01`
    i_value = lr_field ).
    FREE lr_field.
    UNASSIGN <fs_field>.
    * Adding a select-options field to the created block
    * Create a reference to the connection number range table
    lr_field = wd_this->m_helper->create_range_table( `S_CONN_ID` ).
    * Add the select-option to the group
    wd_this->m_helper->add_selection_field(
    i_id = `CONNID`
    i_within_block = `BL01`
    it_result = lr_field ).
    FREE lr_field.
    endmethod.
    and in button i have done as
    method ONACTIONON_EXECUTE .
      TYPES:
    lty_r_connid TYPE RANGE OF s_conn_id.
    DATA
    lr_sbook TYPE REF TO if_wd_context_node.
    * Variables used to retrieve the values of select-options fields
    DATA
    lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.
    FIELD-SYMBOLS:
    <fs_sel_item> LIKE LINE OF lt_sel_item,
    <fs_carrid> TYPE s_carr_id,
    <fs_connid> TYPE lty_r_connid.
    * Get the selection-screen items
    wd_this->m_helper->get_selection_screen_items(
    IMPORTING et_selection_screen_items = lt_sel_item ).
    * Retrieve the values from the select-options items
    LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
    CASE <fs_sel_item>-m_id.
    WHEN `CARRID`.
    ASSIGN <fs_sel_item>-m_value->* TO <fs_carrid>.
    WHEN `CONNID`.
    ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_connid>.
    ENDCASE.
    ENDLOOP.
    * Retrieve the data from the database, for simplicity, the
    * SELECT statement has been implemented here.
    SELECT * FROM sbook
    INTO TABLE wd_this->t_sbook
    WHERE carrid = <fs_carrid>
    AND connid IN <fs_connid>.
    * Bind the data to the context
    lr_sbook = wd_context->get_child_node( name = `T_SBOOK`).
    lr_sbook->bind_table( wd_this->t_sbook ).
    endmethod.
    now can you provide me the code for carrid and connid validation how has to be done.Please give me this solution

  • Selecting the tray or the roll as the paper source for printing

    my printing machine is a canon ipf 5100.With Aperture 2 it was easy to select "tray" or "roll" in the printer driver.With Aperture 3 it is impossible because their is no such option in the Aperture 3 driver.I have tried to download the last version of the ipf 5100 printer driver but Aperture 3 doesn't take it.What can i do to recover my options "tray" or "roll" for my choice of paper?

    Your wording has me confused. You said you were unable to select tray or roll in the printer driver originally. I showed you where the roll selection is; if you do not select roll in the driver, then it will use tray for all the other selections are cut-sheet paper.
    You last message says you can only select roll in the printer. Make these selections on the computer from the print driver, not the physical printer.

  • Align Select-Option position

    Hi All.
    I use Parameter (label & Input field)  and Select-Option.
    Is it possible to justify Select-option's input field position?
    I want to align Select-Option's input field and Parameter's one .
    Does anybody know about this and help me?
    Thanks & Regards.
    Sayako.

    Hi,
    to some extent you can still achieve it.
    Or esle you can create 2 blocks using ADD_BLOCK of the above interface. check the parameters of this method where you can provide the layout as GRP or TRAY or TRANPSARENT. When you create a selection field give this block id I_WITHIN_BLOCK of ADD_SELECTION_FIELD, and other block id for the paramter I_WITHIN_BLOCK of ADD_PARAMETER_FIELD
    Regards,
    Lekha.
    Edited by: Lekha on Dec 19, 2011 11:13 AM

  • How do I select which tray I would like to print from on my company printer?

    I am using a Mac and attempting to print a file from illustrator to the bypass tray of our company printer.  I am personally trying to print labels and I don't want to risk putting the labels in the main tray and have someone else print their document before I can push print on mine. I have done the due diligence of searching the internet for this issue but with no helpful results found just yet. Any advice?

    Larry G. Schneider wrote:
    And Preview still doesn't render the PDF correctly. Install the free Reader app.
    No, Preview renders and prints just fine for me.  And Preview doesn't have any problem printing to the Manual Feed tray.
    I do own Acrobat via CC and can install the full version for no additional cost.  However, in my opinion, Acrobat is so horribly bloated that I won't install it even though it's free (and again, I'm generally an Adobe fan).
    I do appreciate your suggestions, but the real issue here is that Illustrator should really have a functioning tray selection option.  I'm guessing that Adobe would argue that it's a printer-driver issue, but again, literally every other graphics application on OSX can print to the Manual Feed tray seamlessly, except for Adobe products.  Even Photoshop lets you actually select Manual Feed instead of Tray 1, however, the printer will still print from Tray 1 instead of the MF tray regardless of what I set.  Again, no other application exhibits this odd/errant behavior, so it's got to be something messed up with the way Adobe is doing it.
    Thanks for the feedback though, I appreciate it.

  • Report help for multiple Date Select options

    Hi Friends,
    For a particular year wise report, the client wants 12 date select-options which are changeable and informal every year .The report will also be displayed as per the given date selection period wise. Please help me how to fetch the datas from the table as per the given selection period. Currently the report have one date select-option where the user gives selection range as 1.04 to 31.03. It's related to EB power consumption report and hence the new requirement on date selection which are informal and not a fixed date of every year.
    Ex:Selection-Screen
    Period 1 : 08.04.2008 to 12.05.2008
    Period 2: 12.05.2008 to 20.06.2008
    Period 3: 21.06.2008 to 28.07.2008
    Period 4: 29.07.2008 to 15.08.2008
    Period 5: 15.08.2008 to 21.09.2008
    Period 6 : 21.09.2008 to 14.10.2008
    The data will derive as per the above selection ranges.......
    Please advise with example.
    thanks & regards
    Sankar.

    >
    sankar babu wrote:
    > Ex:Selection-Screen
    > Period 1 : 08.04.2008 to 12.05.2008
    > Period 2: 12.05.2008 to 20.06.2008
    > Period 3: 21.06.2008 to 28.07.2008
    > Period 4: 29.07.2008 to 15.08.2008
    > Period 5: 15.08.2008 to 21.09.2008
    > Period 6 : 21.09.2008 to 14.10.2008
    Hi,
    In this case just derive all records matching dates between 08.04.2008 (low in first select-options) and 14.10.2008(high in last select-options.
    Also my advice is to use a single select-options and prompt the user to give the dates as ranges in the multiple entries dialog which can be opened by clicking the button on the right side of the select-options.
    Regards
    Karthik D

  • How To... Change the Data Type for a SELECT-OPTIONS at run time.

    Hello,
    I am trying to restrict the values available for entry into a SELECT-OPTIONS at run time depending on user input.
    The logic is as follows. The user has two input fields. A PARAMETER field which has the type RSDIOBJNM and allows them to choose an InfoObject. And the user has a SELECT-OPTIONS field to allow them to select the Characteristic values for that InfoObject.
    I would like the following example to be possible:
    The user enters 0MATERIAL into the PARAMETER. When the user clicks on the SELECT-OPTIONS control code will derive a list of possible options the user can enter in the SELECT-OPTIONS. In this case only values found in the master data or at least no values greater than 18 characters.
    I have looked at the following function module SELECT_OPTIONS_RESTRICT and this do not appear to be helpful as they only restrict on the signs allowed for the values (unless I misunderstand, it is a complex function module!).
    The code I have so far is (thus the user enters a InfoObject into p_char1 and the select options so_char1 should only accept active values of that InfoObject):
    declaration of variables for user interface
      DATA c_char(32) TYPE c.
    declaration of count variable
      DATA i_count TYPE i.
    declaration of user interface
      SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
        PARAMETERS: p_ipack TYPE RSLOGDPID.
      SELECTION-SCREEN END OF BLOCK a1.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
        PARAMETERS: p_char1 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char1  for c_char NO INTERVALS.
        PARAMETERS: p_char2 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char2  for c_char NO INTERVALS.
        PARAMETERS: p_char3 TYPE RSDIOBJNM.
        SELECT-OPTIONS: so_char3  for c_char NO INTERVALS.
      SELECTION-SCREEN END OF BLOCK b1.
    Is what I am trying to do possible???
    Thanks for any help. Ross.

    You really want to restrict possible values of a select-option based on another field, not change the length of type of the select-option field, right?
    Here is what you do:  Code a custom F4 value help for the select-option at event AT SELECTION-SCREEN ON VALUE REQUEST FOR..  The first thing you do here is read the value of the parameter field (p_ipack in your example).  You can use function module DYNP_VALUES_READ.  Based on this value, you can propose values for the select-option fields.  Note that the use can still enter whatever s(he) wishes in to the select-option field without pressing F4. In this case, you will have to code some input validations taking into account the value in the p_ipack field.

  • Select-options in SELECT query - syntax error

    Hi all,
      I get the error below when I try to use the select options in a SELECT query . Please help me.
    "The IN operator with "SO_AWART" is followed neither by an internal
    table nor by a value list."
    The code i have used(Logical database  PNP is used):
    TABLES: pernr,
            catsdb.
    INCLUDE ztime_cwtr_top.    " global Data
    INCLUDE ztime_cwtr_f01.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
    PARAMETERS P_THRES TYPE I.
    SELECTION-SCREEN END OF BLOCK B1.
    Get data from CATSDB table. Workdates within the date interval are considered.
      SELECT pernr workdate awart catsquantity beguz enduz status
      FROM catsdb
      INTO TABLE it_catsdb
      WHERE pernr  = pernr-pernr    AND
           workdate GE pn-begda     AND
           workdate LE pn-endda     AND
           status   IN ('20', '30') AND
           awart    IN  so_awart .
          awart    IN ('1100', '1137', '1138', '1139', '1140',
                      '1147', '1148', '1149', '1157', '2003' ).
    when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
    I have tried different options like using only the select-options in the where condition.
    Thanks in advance.....
    Madhu

    Solved.
    Code with syntax error:
    include z...top .
    include z...fo1.
    select-options: xxxxxxx
    Code  with no syntax error:
    select-options: xxxxxxx
    include z...top .
    include z...fo1.
    Thanks for all your help,
    Madhu

  • How to hide some select-option of Logical Database in report?

    How to hide select-option of  Logical Database in report?eg . In Logical Database 'PNP' , my code is 'GET  PERNR' , excute the report , select-screen is displayed . I want to hide some select-options , such as PNPPERNR-LOW .
    Edited by: rongrong wang  on Mar 26, 2008 9:31 AM

    U need to write code in initialization as
    initialization.
    loop at screen.
    if screen-name = 'PNPPERNR-LOW'.
    screen-active = '0'.
    modify screen.
    endif.
    if screen-name = 'PNPPERNR-HIGH'.
    screen-active = '0'.
    modify screen.
    endif.
    endloop.

  • Re : select-options in abap-objects program

    Dear friends,
                      I want to give select-options in abap-objects program. How to give that.
                                 Thanking You
    with regards,
    Mani

    In the transaction SE24, enter your class name, click modify.
    in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
    " P_SAKNR FOR SKAT-SAKNR".
    you've got to declare two types in the class:
    a- TYPES:  begin of E_S_SAKNR,
                          sign(1),
                          option(2),
                          low(10),
                          high(10),
                      end of E_S_SAKNR.
    b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
    so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
    method TEST importing ET_SAKNR type E_T_SAKNR.
    now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example..

  • Re : select-options in abap objects

    Dear friends,
    I want to give select-options in abap-objects program. How to give that.
    Thanking You
    with regards,
    Mani

    HI Mani,
    It's common mix ABAP Procedural with ABAP Objects in the same program.
    You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
    But inside ABAP OBJECTS classes you can't use is these statement type.
    Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
    Best Regards.
    Marcelo Ramos

  • Select-option in ABAP objects

    Hi Guys,
               I need a small help from you. I want to know how to populate the value from select-option to abap object. Please help me, it is very important

    check this code
    REPORT ZSELOPT_TO_CLASS .
    TABLES: VBRK.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    DATA: IT_VBELN TYPE RSELOPTION.
    DATA: X_VBELN TYPE RSDSSELOPT.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    DATA: IT_VBRP TYPE VBRP_TAB,
          X_VBRP LIKE LINE OF IT_VBRP.
    METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
    METHODS: DISP_DATA.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD GET_DATA.
      *SELECT * FROM VBRP*
       INTO TABLE IT_VBRP
       WHERE VBELN IN S_VBELN.
    ENDMETHOD.
    METHOD DISP_DATA.
      LOOP AT IT_VBRP INTO X_VBRP.
        WRITE:/ X_VBRP-VBELN,
                X_VBRP-POSNR.
      ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA OBJ TYPE REF TO ZCL_SELOPT.
    CREATE OBJECT OBJ.
    LOOP AT S_VBELN.
      MOVE S_VBELN-LOW TO X_VBELN-LOW.
      MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
      MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
      MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
      APPEND X_VBELN TO IT_VBELN.
    ENDLOOP.
    CALL METHOD OBJ->GET_DATA
                        EXPORTING
                          S_VBELN = IT_VBELN.
    CALL METHOD OBJ->DISP_DATA.
    Edited by: moazam hai on May 17, 2008 6:17 AM
    Edited by: moazam hai on May 17, 2008 6:19 AM

  • Can we use select options in smartform

    can we use select options in smartform if so can any one send me a sample code...
    Thanks
    bhaskhar

    Hi ,
    Can u explain why u want to use select options in smartforms . U can try it in program lines .
    Its better to use select options in the driver program and fetch data accordingly in the driver program or passing the selected values from select options to the smatfrom and fdetching the data there in smartform .
    Regards

Maybe you are looking for

  • How Can I sync contacts FROM my iPhone TO my AOL E-mail?

    How can I sync contacts FROM my iPhone TO my AOL E-mail? In other words, I want to keep all of my iPhone contact information intact and make AOL "mirror" it (and not wipe it out when I sync thru iTunes).

  • I Tunes Windows Error Message?

    I upgraded from ITunes 6 several times to various 6 versions and even currently ITunes 7.0.2 My system is will not install Quicktime and gives me an error message: 1905.Module C:\Program Files\Quicktime\QTOLibrary.dll failed to unregister. HRESULT -2

  • Invalid Digital Signatures

    Hi I have a HP Spectre xt 13-2100ea windows 8 and i recently uploaded windows 7 instead of 8 and all is good except my Card reader and high speed USB 3.0 are not working. I am getting an message saying that windows cannot verify the digital signature

  • Archive Error file in PI

    Hi frnds, I have a requirement which says we need to archive a file when it is in error in PI. How can we acheive this as we need to move error file into a specific folder. Any Suggestions. Thanks, Prabhas

  • HCM formps and Process - Get Process description

    Hi Experts, Im using HCM forms and process for Leave request. My problem is, Employee initates leave process in portal. If he choosed Annual leave in the form means, Hr clerk is the approver and is employee apply a Emergency leave then HR Manager is