Dynamic creation of Dropdown by Index in the view

Hi,
Please help me how to create Dropdown by Index dynamically.
The scenario is in a view, part of view is Static and other part is Dynamic.
Dynamic part display depends on entry  selected from Static part of the view.
I am using method WDDOMODIFYVIEW to implement this. I could successfully generate Group, Caption, TextView view
element dynamically but with Dropdown by Index, I am getting runtime error.
New Dropdown by Index will belong to Dyanmically generated Group in 'ROOTELEMENTCONTAINER' and new Context node will be created in CONTEXT for Dynamic Dropdown by Index .
Thanks, in advance ,for your help.

Thanks Amit and Lekha for your replies.
I tried the code but still I am getting the same error.
  lr_rootnode_info = wd_context->get_node_info( ).
  lr_rootnode_info = lr_rootnode_info->get_child_node( 'ADD_DATA' ).
  call method lr_rootnode_info->add_new_child_node( exporting name = lv_node_name                                                                    is_mandatory = abap_false
                                                              is_multiple = abap_true
                                                              is_multiple_selection = abap_true
                                                              is_singleton = abap_false
                                                              is_initialize_lead_selection = abap_true
                                                              is_static = abap_false
                                                    receiving child_node_info = lr_rootnode_info ).
****----------------Get instance of new node
  concatenate 'ADD_DATA.' lv_node_name INTO lv_child_node.
  lr_dyn_node = wd_context->get_child_node( name = lv_child_node ).
***----------------Prepare properties of attribute and add to context node
*data:lo_nd_add_data type ref to if_wd_context_node,
*     lo_nd_lv_node_name type ref to  if_wd_context_node,
*     lo_el_lv_node_name type ref to  if_wd_context_element.
*lo_nd_add_data = wd_context->get_child_node( name = wd_this->wdctx_add_data ).
*lo_nd_lv_node_name = lo_nd_add_data->get_child_node( name = lv_node_name ).
*lo_el_lv_node_name = lo_nd_lv_node_name->get_element(  ).
  concatenate is_char-descr_char 'ID' into lv_attname.
  translate lv_attname to upper case.
  condense lv_attname no-gaps.
  lr_attribute-name = lv_attname.
  lr_attribute-type_name = 'STRING'.
  lr_attribute-value_help_mode = '0'.
  lr_rootnode_info->add_attribute( exporting attribute_info = lr_attribute ).
  lr_element = lr_dyn_node->create_element( ).
  lr_dyn_node->bind_element( new_item = lr_element
                             set_initial_elements = abap_true ).
  concatenate lv_node_name '.' lv_attname into   lv_bindtext.
  lr_ddbyidx = CL_WD_DROPDOWN_BY_IDX=>NEW_DROPDOWN_BY_IDX( id = iv_name
                                                view = ir_view
                                                label_for = iv_textviewid
                                                bind_texts = lv_bindtext ).
  lr_row_grid_data = cl_wd_grid_data=>new_grid_data( element = lr_ddbyidx ).
*******To set the TextView to the Group_2
  lr_group2->add_child( lr_ddbyidx ).
Please help.
Thanks.
Edited by: Trupti Kallurwar on Oct 26, 2009 9:14 PM

Similar Messages

  • Android Adobe DPS viewer. HTML form dropdown menu closes everytime the viewer navigation pops up.

    I have a web content page which contains a form dropdown menu: <select><option></option></select> ... and so on. I use this as a small filter to narrow a result.
    When I tap the screen, this dropdown menu is shown and works correctly on an iPad. As a side effect the navigation from the Adobe DPS viewer is also shown although this doesn't interfere with the dropdown menu in the HTML. Both are shown.
    On an Android tablet, the html dropdown menu is shown for a fraction of a second until the Adobe DPS viewer navigation pops up. The HTML dropdown menu just won't stay visible.
    My question: How can I solve this? How can I make the HTML dropdown visible on an Android tablet? Or how can I prevent the DPS viewer navigation from showing?
    Thanks

    This phenomenon does not happen on a Samsung Galaxy Tab 2. While not showing the dropdown menu as on an iPad it shows it as a scrollable menu at the bottom.

  • Dynamic creation of TabStrip

    Hi,
    I want to create a tabstrip dynamically.The tabstrip should have 3 tabs, and in each of the tabs i want to put some UI elements like a label, input field, dropdown, tables.........etc.
    Im able to create the tabstrip and add tabs to it dynamically.
    I've even created the UI elements which i wanted to put in the tabs.............But im not able to proceed as i dont know how to add the UI elements to the tabs.......
    Can anyone tell me how to add UI elements to a tab in a tabstrip?
    Regards,
    Padmalatha.K
    Points will be rewarded.

    Hi,
    Following code will help you to understand the dynamic creation and adding them
    //Tabstrip
           IWDTabStrip tabStrip = view.createElement(IWDTabStrip.class);
           //Tab
           IWDTab tab = view.createElement(IWDTab.class);
           //Input Field
           IWDInputField inputField = view.createElement(IWDInputField.class);
           //Adding inputfield to tab
           tab.setContent(inputField);
           //Adding tab to tabstrip
           tabStrip.addTab(tab);
    //Finally add this tabstip to either your root container or some other container.
    Regards
    Ayyapparaj

  • INDEX on VIEW or TABLE when using CONTAINS function on the VIEW

    Hi,
    I'm querying a view with a contains function and I'm getting an error:
    query: select * from view where contains(name,'jack OR jill')>0
    ORA-20000: Oracle text error
    DRG-10599 column is not indexed.
    From what I gathered you can't create an index on the view, or is that possible afterall (using 10g).
    Would it be sufficent to create an index on the column in the table that the view-query is pulling the data from? or can you use the contains funtion on views at all?
    Or are there other ways of doing this better?
    Thanks,

    That particular CONTAINS clause will require a domain index on the column, NAME in your case.
    You could also do: select * from view where name in ('Jack', 'Jill')
    Depending on your need and number of records and other variables, it may be "fastest" to do the text index on the NAME column. If it is a rather small subset of data and performance is not critical then the IN clause should suffice.

  • How can I get the View Tab name on the Crystal Report Viewer at runtime?

    When a report is displayed in the Windows Forms Crystal Report Viewer and the user drills into the report, the drill down view is displayed in a seperate view and is identified via a View tab at the top of the report.  I can determine the index of the view tab that is currently selected, but I need to access the text that is on the View tab.  The only properties that I've found that pertain to the "view" on the Crystal Report viewer are the ActiveViewIndex and the ViewCount.  Unfortunately, neither of these items help me because they are not specific to a certain section of the report.  Has anyone had any luck accessing the View Tab properties ?  Thanks.

    The tabs at the top of the page are nested within some of the viewers controls. Through trial and error you just have to find the right one. In this case the main part of the report is in the first control. This happens to be a TabControl. From there you can loop through the TabPages on the TabControl to grab the names of the tabs.
    Here is a quick example of what I did to get the tab text. All this code was in a button click event.
    Control oControl = crystalReportViewer1.Controls[0];
    TabControl oTabControl = (TabControl)oControl.Controls[0];
    foreach (TabPage oTabPage in oTabControl.TabPages)
         MessageBox.Show(oTabPage.Text);

  • Spatial Index Problem in View

    Hello everyone.
    I have a table (A) that stores point locations (X,Y) and contains the following fields:
    ID NUMBER(10,0) No 1
    CD_CODIGO_EMA VARCHAR2(10 BYTE) Yes 2
    TX_NOMBRE_EMA VARCHAR2(50 BYTE) Yes 3
    CD_PROVINCIA_EMA NUMBER(5,0) Yes 4
    CD_MUNICIPIO_EMA NUMBER(5,0) Yes 5
    NU_UTMX_EMA NUMBER(10,2) Yes 6
    NU_UTMY_EMA NUMBER(10,2) Yes 7
    NU_HUSO_EMA NUMBER(5,0) Yes 8
    NU_TIPO_EMA NUMBER(3,0) Yes 9
    TX_URL_EMA VARCHAR2(255 BYTE) Yes 10
    I have created a view (V) with a field of type SDO_GEOMETRY values based on longitude (NU_UTMX_EMA) and latitude columns (NU_UTMY_EMA) in Table A, as follows:
    CREATE VIEW A_VIEW (ID, SHAPE)
    AS SELECT
    ID, MDSYS.SDO_GEOMETRY(2001, 83030, MDSYS.SDO_POINT_TYPE(NU_UTMX_EMA, NU_UTMY_EMA, NULL), NULL, NULL)
    FROM A
    I have updated the view USER_SDO_GEOM_METADATA:
    insert into user_sdo_geom_metadata values (
    'A_VIEW',
    'SHAPE',
    MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('Longitude',90000,630000,0.005),
    MDSYS.SDO_DIM_ELEMENT('Latitude',3980000,4300000,0.005)
    83030
    I can see the spatial view in differentes clientes (for example, Geoserver and ArcMap). The problem is when I try to Zoom into the View I receive the message: Interface not supported without a spatial index+
    If I try to make an spatial index on the view, I receive the message:
    create index V_idx on A_VIEW(SHAPE) indextype is MDSYS.SPATIAL_INDEX;
    ORA-01702 A view is nos appropiate here.
    How can I fix it? The original table (A) has a spatial index and it works fine.
    Thanks in advance

    This should be answered in your other post:
    View with SDO_GEOMETRY column

  • Indexes in a view(how does it work?)

    I have a view that makes a union query between too similar tables,
    selecting equal fields in both, and the field I use in the where clause are the same in both too.
    That's somenthing like this:
    CREATE OR REPLACE VIEW TABLE_1 AS
    SELECT T1.DESC_DATA
    T1.TOTAL_DATA
    FROM TABLE_1 T1
    WHERE T1.COD = &COD_PARAMETER
    UNION
    SELECT T2.DESC_DATA
    T2.TOTAL_DATA
    FROM TABLE_2 T2
    WHERE T2.COD = &COD_PARAMETER
    The first table(TABLE_1) has to many rows, around 10 millon registers, so it has index for the field cod,
    but the TABLE_2 has few registers, like 1000, and has no index created.
    But when I run a query using the view TABLE_1 it goes to slowly, not using the index.
    How do I have to proceed in this case?
    Do I have to create index for the same index in TABLE_2?
    TABLE_2 not having any indexes makes the view not use indexes?
    Or is something else?
    The version that I'm using is Oracle 9.2.0.4.0.

    We need more information like the explain plan.. Please look at this link about when the query is slow.
    When your query takes too long ...
    Thanks

  • Finding the View associated with an Element

    Hi,
    Is there any way to find the javax.swing.text.View associated with an Element without iterating over every view and seeing if ( view.getElement() == element )?
    Thanks,
    Chris

    Don't know if this will help but you can use:
    TextUI ui = textComponent.getUI();
    View root = ui.getRootView( textComponent );
    View child = root.getView(???);
    So if you are iterating through each Element then I am guessing that child index of your Element would be the same index for the View.

  • Dynamic Dropdown key bind in the row

    hi all,
    i am facing a typical scenario where, <b>for each row in a table of 10 cells i have 1 cell with dropdownbykey control. the requirement is that based on the row's data the dropdownkey's content differs. ie.,
    row 1's -> dropdownkey control's content can have x,y,z
    row 2's -> dropdownkey control's content can have a,b,c
    row z's ->dropdownkey control's content can have m,n,c</b>
    Now problem is that if each row's dropdown content doesnt change then i can bind the simple type to the cell, which would have the same dropdown values for all the row's.
    BUT in my case each row's dropdown key value differs based on some XYZ condition (fetch data from bapi/backend).
    Could anyone suggest me the alternative or solution for this problem.
    Thanks,
    Raghavendra

    Hi Raghavendra,
    You cannot use DropdownByKey for this functionality. Instead you can use DropdownByIndex for achieving this. This query may help help you in this regard. TableView
    Hope this helps,
    Best Regards,
    Nibu.

  • How to get the index of the clicked button on TOOLBARBUTTONCHOICE

    Hello Experts,
       I have used toolbarbuttonchoice and created the dropdown list of the buttons dynamically. now when any of the button is clicked i need to get the reference of the button to call appropriate code in the action, but i am unable to get the either the reference or index of the clicked button.
    Please help.
    Regards,
    Kinshuk

    Hi Sascha,
      My code goes this way
      data:
        lr_btn_ch   type ref to if_wd_view_element,
        lr_toolbar_btn_choice type ref to cl_wd_toolbar_btn_choice,
        lr_row_data           type ref to cl_wd_row_data,
        item                  type string,
        action                type string.
    CALL METHOD view->get_element
      EXPORTING
        id      = 'BTNCH'   " button choice Element in layout
      receiving
        element = lr_btn_ch
    lr_toolbar_btn_choice ?= lr_btn_ch.
    DATA:  lt_items      type string_table,
        lt_actions    type string_table.
    loop at lt_dyntab into ls_dyntab.
      append ls_dyntab-name to lt_items.
    append 'ONBTNCH' to lt_actions.
    endloop. 
    i get the data in the table lt_dyntab from API not in context
      loop at Lt_items into item.
        read table Lt_actions index sy-tabix into action.
        create_choice_item( i_toolbar_btn_choice = lr_toolbar_btn_choice i_item = item i_action = action i_view = VIEW ).
      endloop.
    create_choice_item creates the menu item for the button choice..
    My question is where should i call the map_on_action method. and how do i retrieve the index or reference in ONBTNCH method.
    please elaborate.
    Regards,
    Kinshuk

  • Dynamic tree UI element in the view

    Dear All,
         Can anyone provide me with the code snippet for Dynamic Tree UI element in the view. I need to show the tree which should be generated dynamically.
    Thanks alot in advance!
    Points will be rewarded, Please its urgent!
    Cheers,
    Darshna.

    Hi ,
    sorry for the late reply... here is the code for onActionLoadchildren .. i am sure you wont understand this.. but lets try...
    DATA:
        element_parent  TYPE REF TO if_wd_context_element,
        lv_object_key1   type string,
        lv_object_type  type string.
    DATA:
           node_root_entry                     TYPE REF TO if_wd_context_node,
           elem_root_entry                     TYPE REF TO if_wd_context_element,
           stru_root_entry                     TYPE if_structure_view_new=>element_root_entry ,
           item_valid_from                     LIKE stru_root_entry-valid_from,
           item_plant                          LIKE stru_root_entry-plant,
           item_equi_key                       LIKE stru_root_entry-equi_key,
           item_object_key                     LIKE stru_root_entry-object_key,
           item_object_type                    TYPE string,
           item_path                           TYPE string,
           item_parent_path                    TYPE string,
          context_node                        TYPE REF TO if_wd_context_node,
           root_entry                          TYPE if_structure_view_new=>element_selected_entry.
          l_ref_componentcontroller           TYPE REF TO ig_componentcontroller.
    DATA:
         node_root_info                    TYPE REF TO if_wd_context_node,
         elem_root_info                    TYPE REF TO if_wd_context_element,
          stru_root_info                    TYPE if_structure_view_new=>element_root_info .
    DATA:
          element                            TYPE REF TO if_wd_context_element,
          node_selected_entry                TYPE REF TO if_wd_context_node,
          elem_selected_entry                TYPE REF TO if_wd_context_element.
    DATA:
          ls_hier_return      TYPE rplm_ts_struc_elements,
          lt_hier_return      TYPE TABLE OF rplm_ts_struc_elements,
          ls_hier_return_temp TYPE rplm_ts_struc_elements,
          lt_hier_return_temp TYPE TABLE OF rplm_ts_struc_elements,
          ls_hier_level       TYPE rplm_ts_hier_level,
          lt_hier_level       TYPE TABLE OF rplm_ts_hier_level,
          ls_hier_return_sort TYPE rplm_mt_ts_hier,
          lt_hier_return_sort TYPE TABLE OF rplm_mt_ts_hier.
      DATA:
           temp_hier_level TYPE if_structure_view_new=>element_hier_level,
           lt_hier_temp    TYPE TABLE OF if_structure_view_new=>element_hier_level,
           lt_temp         TYPE TABLE OF if_structure_view_new=>element_hier_level.
      DATA:
           lc_path       TYPE string,
           lv_object_key TYPE string.
      DATA:
           lv_hier_lines TYPE i.
      DATA:
          node_entries                        TYPE REF TO if_wd_context_node,
           node_sub_entries                    TYPE REF TO if_wd_context_node,
          elem_sub_entries                    TYPE REF TO if_wd_context_element,
           stru_sub_entries                    TYPE if_structure_view_new=>element_sub_entries .
      TYPES: BEGIN OF ls_hier_type,             "structure for Hierarchy table
          object(31)      TYPE c,         "Objectkey
          predecessor(31) TYPE c,         "Objectkey Predecessor
          data(2000)      TYPE c,         "Data container
          level           TYPE i,         "level of object in tree
          successors(1)   TYPE c,         "Object has successors: YES/NO/U
          display(1)      TYPE c,         "Object is displayed: YES/NO
          selected(1)     TYPE c,         "Object is selected/marked: YES/NO
          index_predec    LIKE sy-tabix,  "Index predecessor
          strno           TYPE ilom_strno,"External number for func. loc.
                                         "in BOMs used for top object
       END OF ls_hier_type.
      DATA:
           ls_hier     TYPE ls_hier_type,
           lt_hier     TYPE TABLE OF ls_hier_type WITH DEFAULT KEY,
           lt_mat_hier TYPE TABLE OF ls_hier_type WITH DEFAULT KEY.
      " For retrieving Material Data Heirarchy
      DATA:
           lh_stpo_tab     TYPE TABLE OF rihstpx ,
           lwa_stpo_tab    LIKE LINE OF lh_stpo_tab,
           check_menge     TYPE string ,
           check_meins     TYPE string ,
           lwa_mat_hier    LIKE LINE OF  lt_mat_hier ,
           lt_dup_mat_hier LIKE lt_mat_hier,
           lv_len          TYPE i,
           lv_len_temp     TYPE i .
      DATA:
           lv_equnr TYPE equi-equnr,
           lv_tplnr TYPE iflo-tplnr,
           lv_matnr TYPE mast-matnr.
      DATA:
           lv_cnt   TYPE i,
           lv_index TYPE i.
      DATA:
           lv_path        TYPE string,
           lv_parent_path TYPE string,
           pos            TYPE string,
           separator      TYPE c VALUE '.',
           max_level      TYPE i,
           temp_level     TYPE i,
           counter        TYPE i VALUE 1.
      TYPES: BEGIN OF ls_pred_type,             "structure for Hierarchy table
         parent(31)      TYPE c,         "Objectkey Predecessor
         path(2000)      TYPE c,         "Data container
         index_predec    LIKE sy-tabix,  "Index predecessor
      END OF ls_pred_type.
    DATA:
          ls_pred TYPE ls_pred_type,
          lt_pred TYPE TABLE OF ls_pred_type WITH DEFAULT KEY.
    DATA:
          lv_int_obj_key TYPE string,
          obj_len        TYPE i,
          lv_funcloc_ext TYPE ilom_strno,
          lv_funcloc     TYPE itob-tplnr.
    DATA:
          lv_level        TYPE i,
          lv_temp         TYPE i,
          lt_path_entries TYPE string_table.
    DATA:
          node_general                        TYPE REF TO if_wd_context_node,
          elem_general                        TYPE REF TO if_wd_context_element,
          stru_general                        TYPE if_structure_view_new=>element_general ,
          item_collapse_visibility            LIKE stru_general-collapse_visibility.
    DATA:
          elem_context                        TYPE REF TO if_wd_context_element,
          stru_context                        TYPE if_structure_view_new=>element_context ,
          item_expand_all                     LIKE stru_context-expand_all.
    lv_path = path.
    Get Element whose children shall be loaded
      element_parent = wd_context->path_get_element( lv_path ).
    element_parent->get_attribute(
          EXPORTING
            name =  `OBJECT_KEY`
          IMPORTING
            value = LV_object_key ).
    element_parent->get_attribute(
          EXPORTING
            name =  `OBJECT_TYPE`
          IMPORTING
            value = lv_object_type ).
    node_root_entry = wd_context->get_child_node( name = wd_this->wdctx_root_entry ).
    get element via lead selection
      elem_root_entry = node_root_entry->get_element(  ).
    get single attribute
      elem_root_entry->get_attribute(
        EXPORTING
          name =  `VALID_FROM`
        IMPORTING
          value = item_valid_from ).
      elem_root_entry->get_attribute(
          EXPORTING
            name =  `PLANT`
          IMPORTING
            value = item_plant ).
    item_object_type = lv_object_type.
    if lv_object_type eq 'EQUI'.
      item_object_key = ''.
      item_equi_key = lv_object_key.
    elseif lv_object_type eq 'FUNCLOC'.
      item_object_key = lv_object_key.
      item_equi_key = ''.
    ELSE.
      lv_matnr = lv_object_key.
    For BOM, material and Assembly
    endif.
      IF item_object_type EQ 'EQUI'.
        lv_equnr = lv_object_key.
      ELSEif item_object_type eq 'FUNCLOC'.
        lv_tplnr = lv_object_key.
      ELSE.
        LV_MATNR = lv_object_key.
        exit.
      ENDIF.
      CALL FUNCTION 'PM_HIERARCHY_CALL'
        EXPORTING
          datum             = item_valid_from
          equnr             = lv_equnr
          tplnr             = lv_tplnr
          matnr             = lv_matnr
          levdo             = '99'
          levup             = '00'
          sanin             = 'X'
          select_equi       = 'X'
          select_iflo       = 'X'
          select_stpo       = 'X'
          selmod            = 'D'
          stkkz             = ''
          werks             = item_plant
          with_equi         = 'X'
          with_equi_hier    = 'X'
          with_iflo_hier    = 'X'
          with_btyp         = 'X'
          with_mara         = 'X'
          with_ibase_hier   = ''
          capid             = ''
          emeng             = 0
        IMPORTING
          et_hier           = lt_hier
        EXCEPTIONS
          no_hierarchy      = 1
          no_object_defined = 2
          no_selection      = 3
          no_valid_equnr    = 4
          no_valid_matnr    = 5
          no_valid_selmod   = 6
          no_valid_tplnr    = 7
          OTHERS            = 8.
      LOOP AT lt_hier INTO ls_hier.
        ls_hier_return-object_key = ls_hier-object.
        ls_hier_level-object_key = ls_hier-object.
        ls_hier_level-predecessor = ls_hier-predecessor.
        lv_len = strlen( ls_hier-object ).
        IF lv_len GT 1.
          lv_len_temp = lv_len - 1.
        ELSEIF
        lv_len_temp = lv_len.
        ENDIF.
        ls_hier_level-level = ls_hier-level.
        IF ls_hier-object(1) = 'T'.
          ls_hier_return-icon = 'ICON_TECHNICAL_PLACE'.
          ls_hier_return-object_type = 'FUNCLOC'.
          IF ls_hier-successors = 'Y'.
            ls_hier_return-is_leaf = abap_false.
            ls_hier_return-is_expanded = abap_false.
            ls_hier_return-children_loaded = abap_true.
          ELSE.
            ls_hier_return-is_leaf = abap_true.
            ls_hier_return-is_expanded = abap_true.
            ls_hier_return-children_loaded = abap_true.
          ENDIF.
        ELSEIF ls_hier-object(1) = 'E'.
          ls_hier_return-icon = 'ICON_EQUIPMENT'.
          ls_hier_return-object_type = 'EQUI'.
          IF ls_hier-successors = 'Y'.
            ls_hier_return-is_leaf = abap_false.
            ls_hier_return-is_expanded = abap_false.
            ls_hier_return-children_loaded = abap_true.
          ELSE.
            ls_hier_return-is_leaf = abap_true.
            ls_hier_return-is_expanded = abap_true.
            ls_hier_return-children_loaded = abap_true.
          ENDIF.
        ELSEIF ls_hier-object+lv_len_temp(1) = 'M'.
          ls_hier_return-icon = 'ICON_MATERIAL'.
          ls_hier_return-object_type = 'MATERIAL'.
          IF ls_hier-successors = 'Y'.
            ls_hier_return-is_leaf = abap_false.
            ls_hier_return-is_expanded = abap_false.
            ls_hier_return-children_loaded = abap_false.
          ELSE.
            ls_hier_return-is_leaf = abap_true.
            ls_hier_return-is_expanded = abap_true.
            ls_hier_return-children_loaded = abap_true.
          ENDIF.
        ELSEIF ls_hier-object+lv_len_temp(1) = 'X'.
          ls_hier_return-icon = 'ICON_SUPPLY_AREA'.
          ls_hier_return-object_type = 'MATBOM'.
          IF ls_hier-successors = 'Y'.
            ls_hier_return-is_leaf = abap_false.
            ls_hier_return-is_expanded = abap_false.
            ls_hier_return-children_loaded = abap_false.
          ELSE.
            ls_hier_return-is_leaf = abap_true.
            ls_hier_return-is_expanded = abap_true.
            ls_hier_return-children_loaded = abap_true.
          ENDIF.
        ELSEIF ls_hier-object+lv_len_temp(1) = 'A'.
          ls_hier_return-icon = 'ICON_MATERIAL_REVISION'.
          ls_hier_return-object_type = 'MATERIAL'.
          IF ls_hier-successors = 'Y'.
            ls_hier_return-is_leaf = abap_false.
            ls_hier_return-is_expanded = abap_false.
            ls_hier_return-children_loaded = abap_false.
          ELSE.
            ls_hier_return-is_leaf = abap_true.
            ls_hier_return-is_expanded = abap_true.
            ls_hier_return-children_loaded = abap_true.
          ENDIF.
        ENDIF.
    *IF ls_hier-predecessor EQ item_object_key OR ls_hier-object EQ item_object_key.
        APPEND ls_hier_return TO lt_hier_return.
        APPEND ls_hier_level TO lt_hier_level.
    *ENDIF.
        CLEAR lv_len.
        CLEAR lv_len_temp.
      ENDLOOP.
    lt_hier_return_temp = lt_hier_return.
      DESCRIBE TABLE lt_hier LINES lv_hier_lines.
      IF lv_hier_lines EQ 0.
        elem_selected_entry = wd_context->path_get_element( '1.ENTRIES.1' ).
    Get children node
        elem_selected_entry->set_attribute(
        value = abap_true
        name = 'IS_LEAF' ).
      ENDIF.
    *************************************Deleting Now***********
    SORT lt_hier_level BY level DESCENDING.
      LOOP AT lt_hier_level INTO ls_hier_level.
        max_level = ls_hier_level-level.
        EXIT.
      ENDLOOP.
      SORT lt_hier_level BY level ASCENDING.
      LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ 0.
        ls_hier_level-path = '1.ENTRIES.1'.
        ls_hier_level-parent_path = '1.ENTRIES.1'.
        MODIFY lt_hier_level FROM ls_hier_level.
      ENDLOOP.
    ************************New design to Generate Path and Parent path
    lv_cnt = 0.
    temp_level = 1.
    SORT lt_hier_level BY object_key ASCENDING.
    LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ 1.
       lv_cnt = lv_cnt + 1.
       lv_parent_path = '1.ENTRIES.1'.
       ls_hier_level-parent_path = lv_parent_path.
       pos = lv_cnt.
       CONCATENATE lv_parent_path separator 'SUB_ENTRIES' separator pos INTO lv_path.
       ls_hier_level-path = lv_path.
       MODIFY lt_hier_level FROM ls_hier_level.
    ENDLOOP.
    temp_level = 1.
    lv_cnt = 0.
    *********************Need to call this for each level ***************************
    WHILE temp_level LT max_level.
       CLEAR lt_pred.
       CLEAR ls_pred.
       LOOP AT lt_hier_level INTO ls_hier_level WHERE level EQ temp_level.
         ls_pred-parent = ls_hier_level-object_key.
         ls_pred-path = ls_hier_level-path.
         APPEND ls_pred TO lt_pred.
       ENDLOOP.
       SORT lt_pred BY parent.
       DELETE ADJACENT DUPLICATES FROM lt_pred.
       LOOP AT lt_pred INTO ls_pred.
         lv_cnt = 0.
         LOOP AT lt_hier_level INTO ls_hier_level WHERE predecessor EQ ls_pred-parent.
           lv_cnt = lv_cnt + 1.
           lv_parent_path = ls_pred-path.
           ls_hier_level-parent_path = lv_parent_path.
           lv_path = ''.
           pos = lv_cnt.
           CONCATENATE lv_parent_path separator 'SUB_ENTRIES' separator pos INTO lv_path.
           ls_hier_level-path = lv_path.
           MODIFY lt_hier_level FROM ls_hier_level.
         ENDLOOP.
       ENDLOOP.
       temp_level = temp_level + 1.
    ENDWHILE.
    LOOP AT lt_hier_level INTO ls_hier_level.
       LOOP AT lt_hier_return INTO ls_hier_return.
         IF ls_hier_level-object_key = ls_hier_return-object_key.
           MOVE-CORRESPONDING ls_hier_level TO ls_hier_return.
           MODIFY lt_hier_return FROM ls_hier_return.
         ENDIF.
       ENDLOOP.
    ENDLOOP.
    SORT lt_hier_return BY path ASCENDING.
    **************************Delete the extra first character returned by PM_HIERARCHY_CALL******
      LOOP AT lt_hier_return INTO ls_hier_return.
        IF ls_hier_return-object_key(1) = 'T'.
          SHIFT ls_hier_return-object_key BY 1 PLACES.
          lv_object_key = ls_hier_return-object_key.
          lv_funcloc_ext = lv_object_key.
          CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT'
            EXPORTING
              input  = lv_funcloc_ext
            IMPORTING
              output = lv_funcloc.
          lv_int_obj_key = lv_funcloc.
          ls_hier_return-object_key = lv_int_obj_key.
        ELSEIF ls_hier_return-object_key(1) = 'E'.
          SHIFT ls_hier_return-object_key BY 1 PLACES.
          lv_object_key = ls_hier_return-object_key.
          obj_len = strlen( lv_object_key ).
          IF obj_len GE 18.
            lv_object_key = lv_object_key+0(18).
          ENDIF.
          wd_comp_controller->conv_ext_2_int(
           EXPORTING
             iv_object_key_ext =  lv_object_key            " String
             iv_object_type =   'EQUI'               " String
           IMPORTING
             ev_object_key =   lv_int_obj_key                " String
          SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
          ls_hier_return-object_key = lv_int_obj_key.
        ELSE.
          SHIFT ls_hier_return-object_key BY 1 PLACES.
          lv_object_key = ls_hier_return-object_key.
          obj_len = strlen( lv_object_key ).
          IF obj_len GE 18.
            lv_object_key = lv_object_key+0(18).
          ENDIF.
          SHIFT lv_object_key LEFT DELETING LEADING '0'.
          ls_hier_return-object_key = lv_object_key.
        ENDIF.
        MODIFY lt_hier_return FROM ls_hier_return TRANSPORTING object_key object_key.
      ENDLOOP.
    LOOP AT lt_hier_level INTO ls_hier_level.
       IF ls_hier_level-object_key(1) = 'T'.
         SHIFT ls_hier_level-object_key BY 1 PLACES.
         lv_object_key = ls_hier_level-object_key.
         lv_funcloc_ext = lv_object_key.
         CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT'
           EXPORTING
             input  = lv_funcloc_ext
           IMPORTING
             output = lv_funcloc.
         lv_int_obj_key = lv_funcloc.
         ls_hier_level-object_key = lv_int_obj_key.
       ELSEIF ls_hier_level-object_key(1) = 'E'.
         SHIFT ls_hier_level-object_key BY 1 PLACES.
         lv_int_obj_key = ls_hier_level-object_key.
         obj_len = strlen( lv_int_obj_key ).
         IF obj_len GE 18.
           lv_int_obj_key = lv_int_obj_key+0(18).
         ENDIF.
         wd_comp_controller->conv_ext_2_int(
          EXPORTING
            iv_object_key_ext =  lv_int_obj_key            " String
            iv_object_type =   'EQUI'               " String
          IMPORTING
            ev_object_key =   lv_int_obj_key                " String
         SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
         ls_hier_level-object_key = lv_int_obj_key.
       ELSE.
         SHIFT ls_hier_level-object_key BY 1 PLACES.
         lv_int_obj_key = ls_hier_level-object_key.
         obj_len = strlen( lv_int_obj_key ).
         IF obj_len GE 18.
           lv_int_obj_key = lv_int_obj_key+0(18).
         ENDIF.
         SHIFT lv_int_obj_key LEFT DELETING LEADING '0'.
         ls_hier_level-object_key = lv_int_obj_key.
       ENDIF.
       MODIFY lt_hier_level FROM ls_hier_level TRANSPORTING object_key object_key.
    ENDLOOP.
    *********************Getinfo if root node else call Get_Children_Info to generate the structure as well*******
      IF lv_path EQ '1.ENTRIES.1'.
        element = wd_context->path_get_element( lv_path ).
      navigate from <ENTRIES> to <SUB_ENTRIES> via lead selection
        node_sub_entries = element->get_child_node( name = 'SUB_ENTRIES' ).
        element->get_attribute( EXPORTING name = 'OBJECT_KEY'
                                 IMPORTING value = item_object_key ).
        element->get_attribute( EXPORTING name =  `OBJECT_TYPE`
                                IMPORTING value = item_object_type ).
    ****************Get Info of Technical Objects*************
        wd_comp_controller->get_children_info(
          EXPORTING
            iv_lt_list =     lt_hier_return           " Rplm_Tt_Mt_Struc
            iv_path = ''
            iv_hier_level  = lt_hier_level
          IMPORTING
            ev_lt_full =      lt_hier_return                   " Rplm_Tt_Mt_Struc
    Create the strcuture by binding the entries to Node which is bound to the table
    element = wd_context->path_get_element( lc_path ).
    Get children node
            node_sub_entries = element->get_child_node( 'SUB_ENTRIES' ).
            CALL METHOD node_sub_entries->bind_table
              EXPORTING
                new_items            = lt_hier_return
                set_initial_elements = abap_true.
      @TODO handle not set lead selection
       IF ( node_entries IS INITIAL ).
       ENDIF.
       lv_temp = 1.
    ***************Sort the LT_HIER_TABLE appropriately ******
       LOOP AT lt_hier_return INTO ls_hier_return .
         MOVE-CORRESPONDING ls_hier_return TO ls_hier_return_sort.
         ls_hier_return_sort-path_length = strlen( ls_hier_return_sort-path ).
         APPEND ls_hier_return_sort TO lt_hier_return_sort.
       ENDLOOP.
       SORT lt_hier_return_sort BY path_length ASCENDING path ASCENDING.
       CLEAR lt_hier_return.
       LOOP AT lt_hier_return_sort INTO ls_hier_return_sort.
         MOVE-CORRESPONDING ls_hier_return_sort TO ls_hier_return.
         APPEND ls_hier_return TO lt_hier_return.
       ENDLOOP.
    *wd_comp_controller->gv_master_data = lt_hier_return.
       LOOP AT lt_hier_return INTO ls_hier_return.
         lv_path = ls_hier_return-path.
         lc_path = ls_hier_return-parent_path.
         IF lv_path NE '1.ENTRIES.1'.
           element = wd_context->path_get_element( lc_path ).
    Get children node
           node_sub_entries = element->get_child_node( 'SUB_ENTRIES' ).
    Now, create the children elements
           element->get_attribute( EXPORTING name = 'OBJECT_KEY'
                                   IMPORTING value = ls_hier_level-predecessor ).
    Create the strcuture by binding the entries to Node which is bound to the table
           CALL METHOD node_sub_entries->bind_structure
             EXPORTING
               new_item             = ls_hier_return
               set_initial_elements = abap_false.
         ENDIF.
       ENDLOOP.
    Only when a new level is reached we create one more child node
    else we attach our elements to same child node
        element = wd_context->path_get_element( item_path ).
    Get children node
        element->set_attribute(
        value = abap_false
        name = 'IS_EXPANDED' ).
      ENDIF.
      navigate from <CONTEXT> to <GENERAL> via lead selection
      node_general = wd_context->get_child_node( name = wd_this->wdctx_general ).
      get element via lead selection
      elem_general = node_general->get_element(  ).
      get single attribute
      elem_general->set_attribute(
        name =  `COLLAPSE_VISIBILITY`
        value = abap_false ).
      node_selected_entry = wd_context->get_child_node( name = if_structure_view_new=>wdctx_selected_entry ).
      get element via lead selection
      elem_selected_entry = node_selected_entry->get_element(  ).
      get single attribute
      elem_selected_entry->set_attribute(
          name =  `OBJECT_KEY`
          value = '' ).
      elem_selected_entry->set_attribute(
            name =  `OBJECT_TYPE`
            value = '' ).
    get element via lead selection
      elem_context = wd_context->get_element(  ).
    get single attribute
      elem_context->set_attribute(
        name =  `EXPAND_ALL`
        value = abap_false ).
      wd_this->enable_buttons(
    endmethod.

  • Dynamic creation of variables and alv grid output/internal table

    Dear Experts
    I am stuck in an inventory ageing report which is to be done year wise. the scenario is as follow.
    selection screen i enter the year 2011 or 2010 or 2009.
    the output should show me 2011-2007 or 2010-2007 or 2009-2007. the alv grid should always start from 2007 and end at the year that is entered in the selection screen.
    Now how can i create a dynamic variables to store the values of the corresponding yr and also how can i create a dynamic internal table to store these values.
    Thanks & Regards
    Zamir Parkar

    Hi Zamir,
    if you are new to ABAP you may leave old and buggy techniques behind.
    If you want to create the table dynamically, please do not use l_alv_table_create=>create_dynamic_table because it is limited and always triggers a possibly unwanted database commit.
    You better use RTTS dynamic runtime type services, i.e. check the example for [Creating Flat and Complex Internal Tables Dynamically using RTTI|http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI].
    As done here, leave all outdated ALV technologies behind and start with CL_SALV_TABLE. It is following the object-oriented approach and does not need a field catalog.
    You will get used to field-symbols that can be compared to the data referenced by a pointer. For dynamic fields, you may build the field names dynamically, i.e.
    DATA:
          lo_structdescr         TYPE REF TO cl_abap_structdescr,
          lo_typedescr           TYPE REF TO cl_abap_typedescr,
          lo_tabledescr          TYPE REF TO cl_abap_tabledescr,
          lr_data                TYPE REF TO data,
          lt_comp_all            TYPE cl_abap_structdescr=>component_table,
          lv_index               TYPE numc2.
        FIELD-SYMBOLS:
          <any>                  TYPE ANY,
          <component>            TYPE LINE OF abap_component_tab,
           <table>                TYPE table.
        DO nnn TIMES.
          lv_index = sy-index.
          lo_typedescr   =  cl_abap_typedescr=>describe_by_name( <name of data element> ).
          APPEND INITIAL LINE TO lt_comp_all ASSIGNING <component>.
          <component>-type ?= lo_typedescr.
          CONCATENATE 'YEARVAL' lc_underscore lv_index INTO <component>-name.
          <component>-as_include  = abap_true.
          CONCATENATE lc_underscore lv_index INTO <component>-suffix.
        ENDDO.
    * create description object for structured type
        lo_structdescr = cl_abap_structdescr=>create( lt_comp_all ).
    *  create table description object for this
        lo_tabledescr = cl_abap_tabledescr=>create(
                        p_line_type  = lo_structdescr
                        p_table_kind = cl_abap_tabledescr=>tablekind_std
                        p_unique     = abap_false ).
    * create data object
        CREATE DATA lr_data TYPE HANDLE lo_tabledescr.
    ASSIGN lr_data->* to <table>.
    This is a fragment. Please adapt to your needs.
    Regards,
    Clemens

  • Dynamic Creation of UI

    Let's assume I've got some flex app, which at some point asks the server (using http/webservices) to dynamically instantiate a component for it. The server describes (in MXML format) the UI the app should render and writes it down in an mxml file. After which the server dynamicly instantiates the requested component on the client side in accordance with the mxml file.
    Can JSP flex taglib or anything else be used to dynamically create mxml on the server based on the parameters it receives from the client? If yes, then can you please point me to an example?

    Hi,
    Create one static node name like 'NodeA'
    Create one Node(MultiNode) with one attribute(roles) using the following code. Inside the DoInit() method
    Step 1:
    IPrivate<ViewName>.INodeAElement ele = wdContext.createNodeAElement();
    wdContext.nodeNodeA().addElement(ele);
    IWDNodeInfo multipleinfo = wdContext.nodeNodeA().getNodeInfo();
    IWDNodeInfo multiplenode = multipleinfo.addChild("MultiNode" , null, true, false, true, true, false, true, null, null, null);
    multiplenode.addAttribute("roles", "ddic:com.sap.dictionary.string");
    Step 2:
        Assign values for Dropdown. Here i assigned 5 values.if you want assign values from database/BAPI also.
    IWDNode node1 = wdContext.nodeNodeA().getChildNode("MultiNode", IWDNode.NO_SELECTION);
    IWDNodeElement elem1;
    for(int s=0;s<5;s++){
       elem1 = node1.createElement();
       elem1.setAttributeValue("roles","Value"+s);
       node1.addElement(elem1);
    Step 3:
    Inside Domodifyview create IWDDropDownByIndex UI Element and Bind it.
    IWDDropDownByIndex dropDownList = (IWDDropDownByIndex)view.createElement(IWDDropDownByIndex.class, "drop");
    IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");
    dropDownList.bindTexts(info);
    Finally add this Dropdown into container. Like this you can create more Dropdown and add action to the dropdown as dynamically.
    <b>Valuable answer=points</b>
    Kind Regards,
    S.Saravanan.

  • ORA-03113 WITH CREATION OF A SPATIAL INDEX

    Hello,
    the creation of a spatial index with 11G database interrupts with:
    ORA-03113 end-of-file on communication channel.
    The table contains only point data, but has over 3.000.000 data records.
    Has anyone an idea what to do?
    Anna

    Anna,
    A couple of questions.
    1 Does this happen all the time?
    2 Can you select from table consistently?
    3 How long does it take from issuing the command to getting the error?
    The error is indicating a network timeout or similar.
    Regards.
    Ivan

  • Dynamic creation of ComponentUsage

    Hi people,
    I want to reuse a view (ViewA) in different views (ViewB, ViewC, ViewD).ViewA has a quite complex logic, so it is necessary to outsource this view.  Not only the logic, but also the count of UIElements and contextelements is quite large, for this I don't want to implement this part redundant in the views A, C and D.
    I have to use ViewA in a table in  the TablePopin UIElement. Every line of the table should have its own instance of ViewA. Is that possible?
    My idea is it, to put the view in an own component. For every tableline I need an instance of the componentUsage. My problem is now, that I'm not able to create at runtime a ComponentUsage and at designtime I don't know how many instances I need. Is it possible in webdynpro to create dynamic instances of ComponentUsage?
    If you know an other way, that prevents me from implementing the view and its logic more times, please tell me!
    Thanks in  advance,
    Thomas Morandell

    Hi Thomas,
    just for clarification. Principally it is possible in Web Dynpro to dynamically create new component usages of the same type like an existing, statically declared one. This means after having defined a component usage of type ISomeComp (component interface definition) you can dynamically create new component usages which all point to the same component interface definition ISomeComp:
    wdThis.wdGetISomeCompUsage().createComponentUsageOfSameType();
    But this dynamic creation approach implies, that you must also embed the component interface view of this component usage to the view composition dynamically; and this is (unfortunately) quite cumbersome and complicated based on the existing Web Dynpro Java API (it is not yet optimized for a simple dynamic view composition modification.
    Additionally, like Valery pointed out, the dynamic creation of new component usages is not compatible with table popins.
    Regards, Bertram

Maybe you are looking for