Delete an Element in the Tree

Hi,
I would like to delete an element in the tree.
but I was able to delete only the rootNode
Could you help me. thanks
IPrivateTreeView.ITreeNodeNode rootNode =
     wdContext.nodeTreeNode();
IPrivateTreeView.ITreeNodeElement level2Delete = null;
level2Delete = rootNode.currentTreeNodeElement( );
// I would like to do somethink like that
level2Delete.REMOVE_ELEMENT

Hi Philippe,
it's sooooo easy This is a snipped from the IWDNode API
   * Removes an element from the node collection. If an ICMIObservableList is
   * bound to the node, this list is modified!
   * @param element The element to be removed
   * @return <code>true</code> if the element was in.
  boolean removeElement(IWDNodeElement element);
so you simply have to call
wdContext.nodeTreeNode().removeElement(level2Delete);
Hope that helps.
Regards
Stefan

Similar Messages

  • My code to "select" an element in the Tree UI element is not consistently working

    Hi,
    I created a Web Dynpro component that does many things.  One feature is do display information in a Tree UI element.  I use the TreeNodeType and recursive context node to build a nice tree representing what the customer wants.  Since this tree could get very large, I implemented a search feature to help users locate items in the tree.  When found, I expand the tree, and call call set_lead_selection passing in the element where found.  This seems to generally work fine (and highlights the highlights the desired TreeNodeType), but only when going farther down in the tree. If I change the search so that it should find something "higher up" in the tree, the search still works, and it finds the data, but calling the set_lead_selection does not seem to unhighlight a previously located TreeNodeType.  I have added code to loop through all elements in the tree and call set_selected( ABAP_FALSE).  This didn't seem to help.  If I use the mouse and manually click on the root of the tree, it seems deselect previously highlight TreeNodeTypes, and the highlighting works again (but still just going forward).
    I implemented a Find Next feature that starts where the last search left off, and looks farther down the tree.  This works more consistent, but still occassionaly seems to "forget" to unhighlight a previously located TreeNodeType/element.
    What am I doing wrong?
    I am attaching a screen shot.

    Hi Perry,
    Before setting the lead selection of found result, try to clear all the selected elements from context node.
    Sample:
                   data lo_node type ref to if_wd_context_node.
                   lo_node = wd_context->get_child_node ( name = 'MY_NODE' ).
                   "Clear the current selection
                   lo_node->clear_selection( ).
                   " now, set the lead selection
                    lo_node->set_lead_selection( .... )
    Hope this helps you.
    Regards,
    Rama

  • How to delete an element in a tree?

    how can i delete element in my tree?
    after that to refresh the tree?

    OK. You should have the rootNode and then your three other nodes added to the root (fiche, famille, etc)?
    I'm currently creating an application that uses a tree with two branches. The code I posted works regardless of the branch the node I wish to remove belongs to.
    It does depend as well how you are storing your nodes. I mean I'm just storing the node referenced by a string in a hashtable for easy reference. I gather that you want to click the node for it to disappear?

  • How to delete an element in arraylist??

    here i have an array list which contain details of an address book
    I want to delete one element in the list
    but its not deleting
    Could anyone please take a look and help me
    tank u in advance!!
    else if (X.compareTo(F)==0)
       {System.out.println("Pour supprimer une fiche : saisir le NUM INDEX.");
        Integer c1 = new Integer(0);
        Z = clavier.readLine();
        c1=Integer.valueOf(Z);
        System.out.println("Vous allez supprimer la fiche "+c1);
        for( Iterator it= l.iterator(); it.hasNext();) {
          Object p =it.next();
          relations R=(relations)p;
            if (R.getnumero()==c1)
           l.remove(l.indexOf(p));}
          for( Iterator it1= l.iterator(); it1.hasNext();) {
             Object o =it1.next();
             if (o.getClass().getName()=="carnetadresses.contact")
               ((relations) (o)).affiche();
               }break;
      }

    It's a good thing you use code tags for posting here. Could you now consider using code conventions?
    - Why is the second loop nested in the first one? (this second loop looks weird anyway...)
    - The Iterator has a remove method. You should use it in such case.
    - Looks like you have a malpositioned/misused break statement (which is probably the reason why nothing happen, as it terminates the for loop after the first iteration.)

  • Kill a thread and remove the element from the vector

    Hi All
    I have attached each Vector element to a thread which I later want to kill and remove that element from the Vector.
    Thread.join(milliseconds) allows this functionality to let the thread die after n milliseconds.
    However, I want to delete this element from the Vector now.
    Can someone please throw some light on this?
    Here the code I have written for this:
    try
         System.out.println(counter);
         int xCoord = generator.irand(25,200);     // X-coord of AP
         int yCoord = generator.irand(25,200);     // Y coord of AP
         listMN.addElement(new MobileNode((int)mnId,new Point2D.Double(xCoord,yCoord)));
         listMNcoords.addElement(new Point2D.Double(xCoord,yCoord));
         for(int i=0;i<vnuBS.returnBSList().size();i++)
              if(vnuBS.returnBSListCoords().get(i).contains(xCoord,yCoord)&&(vnuBS.returnBSList().get(i).getChannelCounter()<=3)&&(vnuBS.returnBSList().get(i).getChannelCounter()>0))
                   double c = exponential() * 10000;
                   long timeToService = (long)c;
                   System.out.println("BS "+vnuBS.returnBSList().get(i).id+" is connected to MN ");
                   vnuBS.returnBSList().get(i).reduceChannelCounter();
                   System.out.println("Channel Counter Value Now: "+vnuBS.returnBSList().get(i).getChannelCounter());
                   mobileNodesThread.addElement(new Thread(listMN.elementAt(mobileNodeCounter)));
                   mobileNodesThread.elementAt(mobileNodeCounter).setName(mobileNodeCounter+"");
                   mobileNodesThread.elementAt(mobileNodeCounter).start();
                   mobileNodesThread.elementAt(mobileNodeCounter).join(100);
    //                              System.out.println("Died");// thread dies after join(t) milliseconds.
                   System.out.println("ListMN getting generated : " + mobileNodesThread.get(mobileNodeCounter));
              else if(vnuBS.returnBSListCoords().get(i).contains(xCoord,yCoord)&&(vnuBS.returnBSList().get(i).getChannelCounter()<=0))
                   listMN.remove(this.listMN.lastElement());                         //dropcall
                   System.out.println("Removed "+mnId);
                   removeCounter++;
                   mnId = mnId--;
                   mobileNodeCounter--;
              mnId = mnId+1;
         Thanks a lot.

    I'm not sure if what you are trying to accomplish is correctly implemented.
    The method join does not kill the thread. It will wait for the specified time for the thread to exit. If you want the thread to run for a specified ammount of time, develop the run method of that thread with that in mind. Do not try to kill it from the outside, but let it terminate itself (gracefull termination).
    Now for your question regarding the vector (you should probably be using ArrayList nowadays): I would implement the observer pattern for this job. Make the threads post an event on the interface when they are done, let the main thread register itself with the threads and synchronize the method that handles the events. In that method you can remove the object from your list.
    I'm not sure if you want to use thread anyhow, could you tell us what it is that you are trying to accomplish?

  • Delete WBS Elements

    Dear all,
    I try to delete WBS Element and the system trigers this message:
    The business transaction cannot be carried out.
    and when i clicked the "status information" there was an error message tells that there is a Purchase Order still exists for this WBS element.
    i deleted this Purchase Order and still the system gives me the same error message.
    what should i do ???

    Hi Syarein,
    1. Block the PO & set status TECO, & set deletion flag.
    2. Lock account assignment category. Edit > Status > Lock > Account Assignment.
    Regards'
    Syed

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

  • In Elements 7.0, how can I delete multiple photos at the same time?

    In Adobe Photoshop Elements 7.0, how can I delete multiple photos at the same time?   Please be a little specific so I can follow your instructions as I'm not real smart at computers; I'm an intermediate user.  Thank you.

    Shift-click the photos or Ctrl-click them to select them, then right-click one of them and choose Delete from Catalog. They will all go together.

  • In photoshop elements 12 I try to delete a folder but the delete option is grayed out. how can I delete a folder from my catalogue?

    how can I delete folders from photoshop elements 12. the option to delete is grayed out an I don't know what the alternative options are

    Got it fixed!  The Folder was set to Open With Terminal!
    Maybe when you moved it over from your other system, the Open With got changed?  To change this, in your Finder, select the iPhoto library from your User/Pictures folder and do a Get Info on it Command+I.
    Then change the Open With to iPhoto application! 
    Then from the Finder, double click the iPhoto Folder and it will be opened with iPhoto!  WALLA it worked!

  • Accessing the parent element of  a tree node !

    Hi All,
    I’m building a tree application, in which the user has the option for creating a new node at any level he wants. But my problem is, If the user wants to create a node at the same level of the selected node, how do I retrieve the parent element? Can someone help me in this regard? I’ve done the following
    1)     Created a node “TreeNode” with the required attributes & the recursive node.
    2)     When the user clicks on any node, I am able to retrieve the selected element through recursive traversal (i.e. the instance of TreeNodeElement, say elmt)
    3)     I was able to retrieve the parent element through the function elmt.node().getParentElement(). But it returns an instance of IWDNodeElement, which does not have the recursive node. Ofcourse, I cannot typecast IWDNodeElement to “TreeNodeElement”.
    Then How do I retrieve the “TreeNodeElement” instance of the parent element? Someone please help…..!
    Thanks in Advance,
    Best Regards,
    Nibu.

    Hi Nibu,
    you should type as follows
    IPrivateRecursiveTree.ITreeNodeElement ele=(IPrivateRecursiveTree.ITreeNodeElement)selectedElement.node().getParentElement();
    this way you will get the Parent element of the current node.
    Rgds,
    Vilish
    P.S. If prob solved, consider reward points

  • How to delete cost element name from group after deleting the cost element

    Hi,
    Please let me know how to delete the cost element number  from the Cost element group hierarchy.I have deleted cost element but still showing only the CE number---no valid master record.If I d not want this to be visible within hierarchy let me know what should I do.
    Thanks

    Hi
    Go to change cost element group select the cost element click on select tab (3rd Tab from Left) it will take u to new screen in that screen select remove tab (1st tab from left)
    Regards
    Sandesh

  • Is there a way to "mix" the nodes and leaves of the tree so if they are at the same level, they will display in a specified order.

    Is there a way to "mix" the nodes and leaves of the tree so that even if they are at the same level (1,2,3...), they will display in a specified order (via sort sequence, alphabetical, etc.).
    History:
    We are using the Tree UI element to display/manage a material bom interface. We seem to be running into an issue with displaying the nodes/leaves of the tree.. regardless of the order that the context is built (which is currently the order of the exploded BOM from from CS_BOM_EXPL_MAT_V2), the bom is displayed with the nested boms at the top of each level and the single materials below them. For example. If  TK1 contains Material1, Material2, Material3, Kit1(containing component1, comp2, comp3), Material4, Kit2(containing comp4, comp5, comp6), and Material5 (in this order), the tree will display with the A level node as TK1, the next node as Kit1 (with its subleaves of comp1,comp2,comp3), Kit2(with subleaves of comp4,comp5,comp6), THEN Material1, material2, material3, material4, material5.  Our users are adamant about the items displaying in the correct order (which should be alphabetical based on the description for one report and by location for purposes of inventory for another). I've searched but not been able to locate a similar question. If I've missed it, please point me in the right direction. The users want the tree,  not a "tree" table.  This is our first attempt at the tree, so maybe we're missing something basic?
    TK1
    -Mat1
    -Mat2
    -Mat3
    -Kit1
    --Comp1
    --Comp2
    --Comp3
    -Mat4
    -Kit2
    --Comp4
    --comp5
    --comp6
    -Material5
    displays as
    TK1
    -Kit1
    --Comp1
    --Comp2
    --Comp3
    -Kit2
    --Comp4
    --Comp5
    --Comp6
    -Mat1
    -Mat2
    -Mat3
    -Mat4
    -Mat5

    co-workers said example picture is misleading.. we can make the order work if everything is a "folder" but not a mix of "folders" and "files" (if making a visual reference to the windows browser). i.e - a file is represented as an empty folder.
    TK1    
    . Mat1
    . Mat2
    . mat3
    > kit1   
    .. comp1
    .. comp2
    .. comp3
    . mat4
    > kit2
    .. comp4
    .. comp5
    .. comp6
    . mat5
    displays at
    TK1
    > kit1
    .. comp1
    .. comp2
    .. comp3
    > kit2
    .. comp4
    .. comp5
    .. comp6
    . mat1
    . mat2
    . mat3
    . mat4
    . mat5
    we can make it work if everything is a folder. This is our current workaround.
    TK1
    > mat1
    > mat2
    > mat3
    v kit1 (when expanded)
    .. comp1
    .. comp2
    .. comp3
    > mat4
    > kit2 (when not expanded)
    > mat5

  • How to binding incoming xml node list to the tree control as dataProvider

    Recently, I faced into one issue: I want to binding incoming xml node (it's not avaliable at start) list to the tree control as a dataProvider.
    Since the incoming xml node list is not avaliable at beginning but I needs to bind it to the tree, so I create one virtual one in the xml, and prepare to remove it before the tree is shown. (ready for the actual node adding). But It did not work.
    Please see the presudo-code here:
    1.  Model layer(CsModel.as)
    public class CsModel
            [Bindable]
            public var treeXML:XML=<nodes><car label="virtualOne" id="1">
                                   </car></nodes>;
            (Here, I want to build binding relationship on the <car/> node,
             one 'virtual/stub' node is set here with lable="virtualOne".
             But this node will be deleted after IdTree
             control is created completely.)      
            [Bindable]
            public var treeData:XMLList =new XMLListCollection(treeXML.car);
    2. view layer(treePage.mxml)
            private var _model:CsModel = new CsModel();
            private function addNode():void
                    var newNode:XML=<car/>;
                    newNode.@label="newOne";
                    newNode.@id=1;
                    _model.treeXML.appendChild(newNode);
                             private function cleanData():void
                                     delete _model.treeXML.car;
            <mx:VBox height="100%" width="100%">
            <mx:Button label="AddNode" click="addNode()" />
            <mx:Tree id="IdTree"  labelField="@label"
              creationComplete="cleanData()"
              dataProvider="{_model}"/>
        </mx:VBox>
    3. Top view layer (App.Mxml)
    <mx:application>
        <treePage />
    </mx:application>
    For method: cleanData(),It's expected that when the treePage is shown, we first delete the virutalOne to provide one 'clear' tree since we don't want show virtualOne to the user. The virutalOne node just for building the relationship between treeData and treeXML at beginning. But the side effect of this method, I found, is that the relationship between treeXML and treeData was cut off. And this leads to that when I added new node (by click the 'addNode' button) to the xmlXML, the xmlData was not affected at all !
    So Is there any other way to solve this issue or bind the incoming xml node list to the xmlListCollection which will be used as Tree control's dataProvider ?

    If u want to display the name : value then u can do like this
    <xsl:eval>this.selectSingleNode("name").nodeName</xsl:eval> : <xsl:value-of select="name" />

  • Okay, i have 2 bugs with maverick.  First, when I delete a file within a window, the files deletes but the preview doesn't delete until I close the window and reopen it.  Second, I work on a network of computers and the search feature is now buggy...

    Okay, i have 2 bugs with maverick.  First, when I delete a file within a window, the files deletes but the preview doesn't delete until I close the window and reopen it.  Second, I work on a network of computers and the search feature is now buggy...  When I search for a file, A) it asks me if it's a name, or it wont produce anything, and B), its slower than in prior OS versions and in some instances I have to toggle to a different directory and go back to my original directory in the search: menu bar or the search wont produce anything...  Very buggy. 

    It appears to me that network file access is buggy in Maverick.
    In my case I have a USB Drive attached to airport extreme (new model) and when I open folders on that drive they all appear empty. If I right click and I select get info after a few minutes! I get a list of the content.
    It makes impossible navigate a directory tree.
    File access has been trashed in Maverick.
    They have improved (read broken) Finder. I need to manage a way to downgrade to Lion again.

  • HOW TO DELETE DUPLICATE ELEMENT IN A VECTOR

    Hi everybody!
    If I've a vector like this vectA={apple,orange,grape,apple,apple,banana}
    and I want final result be vectB={apple,orange,grape,banana}.
    How should I compare each element in vectA and delete duplicate element. Like here duplicated element is apple. Only one apple remain in the vectB.
    Any help,
    Thanks.

    Hello all. Good question and good answers, but I would like to elaborate.
    To begin with, you specifically asked to map the following:
    {apple,orange,grape,apple,apple,banana} ==> {apple,orange,grape,banana}
    Both of cotton.m's solutions do NOT do this, unfortunately. They are both useful in particular cases though, so think about what you're trying to do:
    cotton.m's first solution is best if order does not matter. In fact, as flounder first stated, whenever order doesn't matter, your most efficient bet is to use a Set instead of a List (or Vector) anyways.
    Set vectB = new HashSet(vectA);This code maps to {banana, orange, grape, apple}, because HashSets are "randomly" ordered.
    cotton.m's second solution is good if you want to impose NEW ordering on the List.
    Set vectB = new TreeSet(vectA);This code maps to {apple, banana, grape, orange}, because TreeSet uses alphabetical-order on Strings by default.
    java_2006, your solution is the most correct, but it's a little verbose for my taste :)
    more importantly, the runtime-efficiency is pretty bad (n-squared). calling Vector.contains performs (at worst) n comparisons; you're going to call it n times! Set.contains usually performs 2 comparisons (constant, much better), so I suggest you USE a Set to do the filtering, while still sticking with your good idea to use a List. When the ordering is "arbitrary" (so can't use TreeSet) but still relevant (so can't use HashSet), you're basically talking about a List.
    I think saving A LOT of time is worth using A LITTLE extra space, so here, let's save ourself some runtime, and some carpal-tunnel.
    import java.util.*;
    class Foo {
         public static void main(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List     l = Arrays.asList(fruits),
                   m = filterDups(l);
              System.out.println(m);
         // remember, both of the following methods use O(n) space, but only O(n) time
         static List filterDups(List l) {
              List retVal = new ArrayList();
              Set s = new HashSet();
              for (Object o : l)
                   if (s.add(o))
                        retVal.add(o);     // Set.add returns true iff the item was NOT already present
              return retVal;
         static void killDups(List l) {
              Set s = new HashSet();
              for (Iterator i = l.iterator(); i.hasNext(); )
                   if (! s.add(i.next()))     
                        i.remove();
         // honestly, please don't use Vectors ever again... thanks!
         // if you're going to be a jerk about it, and claim you NEED a Vector result
         // then here's your code, whiner
         public static void mainx(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List l = Arrays.asList(fruits);
              Vector v = new Vector(l);
              killDups(v);
              System.out.println(v);
    }

Maybe you are looking for

  • MAC OS and LDAP and Samba Server

    How can I make my Mac OS authenticate against LDAP and automatically map shared by a Samba server folders? (samba domain)? The idea is that any person who is registered in the database of LDAP can log into any Mac machine and automatically access the

  • How many space takes a digital signature

    Hello, I wait for the activation key of JCOP to use with Eclipse. so I can try nothing, only plan and clue some code snippets together. For planning my data structures I need to know how big a digital signature is. Thank you very much. mimaxx

  • How do I change which programs start when the system boots up?

    I want to delete a program from the start up sequence so that the program does not start up automatically.  Suggestions!

  • What happens when two computers call the same code stored in network storage?

    We have our code on network storage and have only been running code on one computer.  We have now duplicated our setup and would like to use the same code to run the new setup from a different computer.  We would like to run both setups simultaneousl

  • Displaying TIFF image

    Hi everybody...! i am new to this forum and this is my first question in this forum. anybody can tell me how to display an image (tif). using drawImage() i can able to display gif image but i need tif image. thanks in advance. Ramesh