Copy element of a node

Hi
I have a requirement to copy the values of an element in a node to another element in the same node.
The only method I know is to use getter - setter method for the two elements.However , it is a cumbersome task , given my node has 60 attributes.
Is there any other method to achieve this.
Note: I am not talking about WDCopyService for node to node copy.
Thanks in advance,
Sudeep.

IWDNodeElement original = ...;
IWDNodeElement copy = wdContext.node<YourNode>().createAndAdd<YourNode>Element();
WDCopyService.copyCorresponding(original, copy);
Armin

Similar Messages

  • Creation of new element in Model Node

    Dear All,
    I am facing one problem, I have two  model node. I want to copy one model node to other model node.while copying its giving error saying the you can bind the element, coz target node doesn't have valid parent.
    Pl don't suggest me work on Value node.
    Can i create a element in model node at run time.
    Thanks & Regards
    Manoj Sahoo

    Hi Manoj,
                   Model node properties :
    1.A context model node makes a model object look like any other context node.  I.E. it gives the model object an API that is very similar to a value node.
    2.  A model node is not considered valid until it is bound to a corresponding model object.  Therefore, a model node always inherits its metadata from the model object to which it is bound.
    3. The element collection in a model node does not hold the actual runtime data!   Instead, it holds a list of references to the relevant model object instances.
    If u check the 2nd property, u will find the cause of ur exception. As u have already told, don't suggest to use value nodes, i don't have any other comment.
    regards
    Sumit

  • Copy values from model node to another model node with different structure

    Hi,
    I am getting detils from RFC1 and update some of the data into another RFC2.
    the first RFC1 having the strucutre
    context
    NodeName
    nodel
    arrtibutes
    the second RFC2 having the different strucutre
    context
    NodeName1
          | nodel2
               | arrtibutes2
               | arrtibutes3
          | nodel5
               | arrtibutes4
               | arrtibutes5
    I need to copy the values from first one to second one.
    Both are different structures.
    Can any one tel me how to do it.
    Thanks
    Ravi

    Hi,
    Create 1 custom controllers for each Model.
    1.Cust COntroller1:
            Node one.
            ->Attr1(type:String)
            ->Attr2(type:long)
    2.Cust COntroller2
            Node one.
            ->Attr1(type:String)
            ->Attr2(type:long)
    Through the component controller only u can send the data by mapping.
    In component controller:
      Node one.
            ->Attr1(type:String)
            ->Attr2(type:long)
    Step1:Map the elements from custControler1.
    Before mapping make sure that u have data in CustController Context=>value node.
    (Note:cust controler node s model node means copy the elements to value node using copyservice)
    step2:Go to cust controller2 goto value node and map it.
    if ur nt getting,Plz let me knw,
    Thanxs,
    Lavanya.G

  • How to bind UI Element with Context Node Attribute Element

    Hi,
    I'm building my view dynamically in the wdDoModifyView method.
    Is it possible to bind a "TextView" element to a specific element of an attribute node?
    Scenario:
    Node_Employees
    |
    +- Attribute_Code
    |
    +- Attribute_Name
    Node Contents:
    Employees
    |
    +- Code: 1, Name: Employee 1
    |
    +- Code: 2, Name: Employee 2
    |
    +- Code: 3, Name: Employee 3
    I need to do something like binding a TextView UI element to the "Name" attribute of the element #2, what would result to show "Employee 2" on my view.
    How can I do this?
    Thanks in advance,
    Geraldo.

    Hi Saravanan,
    First I populate the context node and it won't change during view's lifecycle.  After that, I build my view and bind the TextView UI elements to the node context attributes elements.
    If the node has 10 elements, I will build 10 TextView UI elements and bind them to each attribute element.
    Regards,
    Geraldo Brígido.

  • Segment has no subnode of type element/composite/technical node

    Hi all,
    I have created a DME tree format. but not able to activate it because has following errors:
    1). Node HEADER A: segment has no subnode of type element/composite/technical node
    Message no. DMEE_ABA338
    the node HEADER A is of kind Segment. and i dont want to create any seperate element/composite/technical node under it.
    it has 5 segments already in below level, and those segments has elements.
    How to correct this error.
    Thanks,
    Vidya

    Hi Vidya
    What is the solution that you got
    Regards
    Sangarsh

  • Add an element to a node.

    Hi,
    Any help to add an element to a node.
    I have a node in a view context and I would like to add its content to a component controller context node which has the same structure ( subnodes and attributes) .
    Thanks in advance.

    Hi,
    Sorry , i think i misspoke. I'll try to be clearer.
    It's as simple as you have a registration screen of a game. and then players must register one by one in the same screen.
    So you have the same screen with the same structure behind and each time when a player press submit button after its registration you add a new entry in the table and clear all fields of the same screen for the next player.
    I want to do some thing like a table of node in the component controller.
    For this i just use a main node with cardinality 0..n.
    Then in each view i have the same node structure that i use.
    When the user press submit i want to add all what he has filled-in as a new entry in the principal node in the component controller context. And then pass to the next view which use the same structure.
    Here is the wrong code in the submit method to have an idea
    method ONACTIONSUBMIT .
    **   prepare Usage table
      DATA: lo_node_1 TYPE REF TO if_wd_context_node.
      DATA: l_prop_usage_tab  TYPE STANDARD TABLE OF bapi1077du,
            l_prop_comp_tab TYPE STANDARD TABLE OF bapi1077vp.
      DATA :  lo_component TYPE REF TO if_wd_component,
              lo_context TYPE REF TO if_wd_context,
              lo_controller TYPE REF TO if_wd_controller,
              lo_node TYPE REF TO  if_wd_context_node,
              lo_child TYPE REF TO if_wd_context_node.
      lo_component = wd_comp_controller->wd_get_api( ).
      lo_controller ?= lo_component.
    * get controller context node
      CALL METHOD lo_controller->get_context
        RECEIVING
          context = lo_context.
    * get root node component controller
      lo_node = lo_context->root_node.
    * get prop_component node of component controller
      lo_node = lo_node->get_child_node( 'GENERAL_COMPO' ).
      DATA lo_element type ref to IF_WD_CONTEXT_ELEMENT.
      lo_node_1 = WD_CONTEXT->get_child_node( name = 'GENERAL_COMPO' ).
      lo_element = lo_node->create_element( STATIC_ATTRIBUTE_VALUES = lo_node_1 ).
      lo_node->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).
    *  lo_child = lo_node->get_child_node( 'COMPOSITION' ).
    *  lo_child->BIND_ELEMENT( l_prop_comp_tab ).
    *  lo_child = lo_node->get_child_node( 'USAGE' ).
    *  lo_child->BIND_ELEMENT( l_prop_usage_tab ).
    endmethod.
    General_comp is the main node. it is with 0..n cardinality in the controller context.
    And with 1..1 cardinality in the view context and there is no mapping between them.
    It contains 2 sub-node "usage" and composition.
    Hopefully it is clearer
    Thanks for help
    Edited by: dyngry on Apr 21, 2011 9:31 AM

  • Cannot ALT copy elements across pages in Indesign CS6

    I cant seem to copy elements across pages anymore in Indesign CS6. In CS4 ( the last one I was using before I upgraded) i could select an element (ie text box) and (windows) ALT drag that text box across pages effectively copying it. In CS6 I can ALT drag on a page but as soon as I try to go across pages it cancels the dupilcation. Anyone know if this is new/changeable/bug

    That shouldn't be happening.
    Is it just on this document and not all, old or new documents? If it's just one document then try clearing corruptions - http://forums.adobe.com/message/3854248#3854248
    If it's for all documents - old and new - reseting your preferences - http://forums.adobe.com/thread/526990?start=0&tstart=0

  • Locked Objects when i try to copy elements from one folder to another

    Hi,
    Could anyone help me to resolve a lock problem in the portal-content studio? I try to copy elements (iviews or pages) from one package(folder) to another and the objects have been locked.
    How can I set another lock time different from the system time (36 000sek.)?
    and how should I copy this files/elements to avoid this locking situation?
    thx in advance

    hi
        to unlock the objects <system admin><monitoring>in detailed navigation <portal>drill down <object locking> u may check to unlock the objects..

  • Add several elements to a node

    Hello experts,
    I'm trying to add several elements to a node I have, the node cardinality is 0..n and the data I'm trying to pass comes from a hashtable, this is the code I have:
    ICifrasControlElement cifras = wdThis.wdGetContext().createCifrasControlElement();
    for(;enum.hasMoreElements();){
    String key = (String)enum.nextElement();
    String value = (String)res.get(key);                    
    cifras.setConcepto(key);
    cifras.setValor(value);
    wdContext.nodeCifrasControl().addElement(cifras);
    I'm getting this exception:"cannot bind or add element, because it is already bound to a node"

    Jesus-
    Your problem is you have created only one element and you are adding the same reference in the loop. Change your code as follows:
    for(;enum.hasMoreElements();){
    String key = (String)enum.nextElement();
    String value = (String)res.get(key);                    
    ICifrasControlElement cifras = wdThis.wdGetContext().createCifrasControlElement();
    cifras.setConcepto(key);
    cifras.setValor(value);
    wdContext.nodeCifrasControl().addElement(cifras);
    Cheers-
    Atul

  • Can't add new element to model node from web service

    Hi Folks,
    we are using the old WebService (not adaptive one) for calling a service on XI. We are reusing the same service for loading the data and also sending them back to the backend to modify, delete or add new elements. Request and response tree structure consist basically of the same structure.
    Now everything works fine so far except adding a new element to the model tree.
    So what are we doing:
    After calling the service for reading (and invalidate on the response), we copy the received data from response node into the request node. All the view forms are bound to the model elements in the request.
    Modifying single attributes worked just fine (from dialog and programatically). A new element we add to the model tree shows up in the dialog and seems to work equally fine, but when we trigger the service call to send the collected data, every change to the model data is send except the new added element. It just won't be send.
    What's the problem here? Seems to me this must be somehow related to the supplying relation role maybe.
    What code do you need to look at and how do I mark code in the new forum editor so it gets displayed properly formatted?
    Thanks,
      ok

    Hi,
    Can you tell me which code are you using currently for transferrring the data? It might help me to figure out what your problem is.

  • How to copy a set of nodes stored in a variable in xslt 2.0

    I am trying to do something like this:
    XSL
    <xsl:variable name="setOfNodes" select="foo[@attr = 'bar']" />
    <result>
    <xsl:copy-of select="$setOfNodes/*" />
    </result>XML
    <test>
    <foo attr="bar" />
    <foo attr="bar" />
    <foo attr="different" />
    <foo attr="bar" />
    </test>I want the result to look like this:
    <result>
    <foo attr="bar" />
    <foo attr="bar" />
    <foo attr="bar" />
    </result>But when I run the above xsl I get:
    <result />This seems like it should be pretty simple, I am probably just mixing something up. Does anyone have any ideas or suggestions for how to do this type of thing?

    Whether it is XSLT 1.0 or 2.0 does not really matter for your question. As you bind a value to your variable 'setOfNodes' with the XPath expression in the 'select' attribute selecting some 'foo' element nodes the value of that variable is a node-set (in XSLT 1.0) or a sequence (in XSLT 2.0) of those 'foo' element nodes. And if you want to copy those nodes to the result tree then you simply do <xsl:copy-of select="$setOfNodes"/>. Your attempt with select="$setOfNodes/*" would copy the child elements of those 'foo' elements to the result tree, only all those 'foo' elements are empty, they don't have any child nodes at all, thus nothing is copied to the result tree with your xsl:copy-of attempt.

  • How to copy data from one node to another or fromone table to another table

    Hi,
    I have a two tables.I am populating data in first table and on the click of first table ,selected row data should be copied to the second table.
    How do i achieve this requirement and what should be the cardinality of the second table
    Thanks
    Bala Duvvuri

    Hi,
    For this u have to fetch the selected row.
    For fetching the selected row go to the events of first table and select "OnLeadselect".
    Create a new method for this.
    Now in this method read the value of the selected row with method get_static_attributes.
    with this u will have the selected row in the element.
    not just bind this elemnt with the second table.
    Second node will also have the cardinality 0:n, because this is also binded with the table.
    Coding part for this is as below:
    method ONACTIONSELECT .
        DATA lo_nd_cn_mara TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_mara TYPE REF TO if_wd_context_element.
        DATA ls_cn_mara TYPE wd_this->element_cn_mara.
        DATA ls_cn_mara1 TYPE wd_this->elements_cn_mara.
      navigate from <CONTEXT> to <CN_MARA> via lead selection
        lo_nd_cn_mara = wd_context->get_child_node( name = wd_this->wdctx_cn_mara ).
      @TODO handle not set lead selection
        IF lo_nd_cn_mara IS INITIAL.
        ENDIF.
      get element via lead selection
        lo_el_cn_mara = lo_nd_cn_mara->get_element(  ).
      @TODO handle not set lead selection
        IF lo_el_cn_mara IS INITIAL.
        ENDIF.
      alternative access  via index
      lo_el_cn_mara = lo_nd_cn_mara->get_element( index = 1 ).
      @TODO handle non existant child
      IF lo_el_cn_mara IS INITIAL.
      ENDIF.
      get all declared attributes
        lo_el_cn_mara->get_static_attributes(
          IMPORTING
            static_attributes = ls_cn_mara ).       " here u are getting the selected row of the table.
    APPEND ls_cn_mara to ls_cn_mara1.      " append the row in the table so that can be binded with the second node
      DATA lo_nd_cn_maraout TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_maraout TYPE REF TO if_wd_context_element.
      DATA ls_cn_maraout TYPE wd_this->element_cn_maraout.
    navigate from <CONTEXT> to <CN_MARAOUT> via lead selection
      lo_nd_cn_maraout = wd_context->get_child_node( name = wd_this->wdctx_cn_maraout ).
    Bind the table with the second node
    lo_nd_cn_maraout->bind_table( ls_cn_mara1 ).
    endmethod.
    ->cn_mara  is the first node.
    ->cn_mara1  is the second node
    Thanks,
    Pankaj Aggarwal
    Edited by: Pankaj Aggarwal on Nov 19, 2008 7:40 AM

  • How to pass all values from one node element to created node element?

    Hi
    I have model node element under which there are 7 values, and I've created value node element and trying to pass the values from the model node Element to this value node element. But instead of passing all the values its listing only one value.
    How do we rectify this problem!!!
    Thanks in Advance
    Srikant

    Hi Anil
    I've created the node named: TableNode
    and the name of the node from which i want to get the data is : Li_Required_Node
    the Node Structure is
    Context
      |_ Zs_Quantity_Input
         |_Output
           |_Node_Required_Node
              |_Schddt
      |_TableNode
        |_CmpDate
    The Schddt has some 7 values
    The code Snippet is as follows:
    IPublicPricesComp.ITableNodeElement nodeElement;
    IPublicPricesComp.ILi_Required_NodeElement scheduleElement;
    int counter3Max = wdContext.ILi_Required_Node().size();
    for( int counter3= 0 ; counter3 < counter3Max ;counter3++ )
    nodeElement = wdContext.createTableNodeElement();
                             scheduleElement = wdContext.nodeZs_Quantity_Input().nodeOutput_Contract_Qty().nodeLi_Required_Node().getLi_Required_NodeElementAt(counter3);
    nodeElement.setCmpDate(scheduleElement.getSchddt());
    wdContext.nodeTableNode().addElement(nodeElement);               
    On writing the above code and then binding the node to a table column only one value getting displayed
    Where can be the error?
    Thanks in Advance
    Srikant

  • Child element of target node in message mapping getting suppressed

    Hello All,
                      I am having  mapping where i am trying  to generate the target node based on some condition of the source structure ,this is working fine ,I am able to generate the target node once the condition gets satisfied ,but the problem is one of the  child elements of the same node is not getting populated,its getting suppressed,i have some condition for the same
    I checked  the  queues its showing value as
    SUPPRESS
    Value
    Value ( in grey )
    But still element is not getting generated..
    I have added a condition used at the node function and apart from other condition of element..
    If some body have the solution for the same,please help me out
    Thanks in advance
    Rajesh

    Hi Rajesh,
    The Error is mostly cause of that the node and your child are in same context.
    You got to remember that the parent node creates the context, and then the child element puts the value in it.
    Try putting your child element to a higher context then mapwithdefault for your supress and then removecontext.
    This Issue, you got to work it out with the node functions,
    I had the same kind of issue in my mapping, it was rectified with the help of node functions as mapwithdefault, removecontext.
    Further unless one sees the mapping of your issue it is a bit difficult to imagine it and answer it.
    For more clarifications please give the full hierarchy, and the condition. As of now try with the node functions.
    Thanks
    Ashmi

  • How to get current node element for recursive node.

    Hello Xperts,
    I have a requirement where I need to find the current node element of the recursive node.
    I was trying following code for the same
    Data:
    selected_elem type ref to if_wd_context_element.
    selected_elem  = WDEVENT->GET_CONTEXT_ELEMENT( NAME = 'CONTEXT_ELEMENT' ).
    selected_elem  ->get_static_attributes(
        IMPORTING
          static_attributes = sel_attri ).
    But it does not work for me and I always get 1st node value.
    Please help me in this issue.
    -Ashutosh

    Hello ,
             If you implementing a simple tree ( not table tree )  and you want the selected element for
    OnLoadChildren event  .
    Then create an importing parameter CONTEXT_ELEMENT  of type IF_WD_CONTEXT_ELEMENT
    in the event handler of onLoadChildren .
    Webdynpro framework automatically filled up the context element with the current node in the tree .
    I tried it , It really worked for me .
    If you have a table tree then you need to create an importing parameter PATH  of type String in tha event handler .
    Webdynpro frame automatically fills the PATH .
    the use can use the following method to get the element from the PATH .
    wd_context->path_get_element( path ).
    I tried it , It also  worked for me .
    Regards
    Vivek
    PS : please provide the points if answer is helpful .

Maybe you are looking for

  • IPod Glue Major Glue Problem, HELP

    Hey guys! Recently after I bought my iPod Nano 6th gen, I got a case for it, got all my songs on it, awesome! But there's more. See I'm a perinoid guy, and all the cases left the back metal clip naked, and dropping the iPod on that section could caus

  • Uninstalling iPhoto 6/Reinstalling iPhoto 5

    I have an old G4 400 running 10.4.5. I decided to update iLife 05 to 06, which was a mistake. It took up way too much disk space and iPhoto and iDVD were so sluggish that they were practically useless. Fortunately I had made a backup of the entire Pi

  • FI AR C02 - Data exists but Queries show no data

    Hi all, The FI AR cube C02 has data but the queries show "no applicable data". Is there a way to debug the query and see what it is trying to pull?  I tried using RSRT with execute + debug option but I couldn't figure out much.. Is there any other wa

  • RE:Invoice & GRN mismatch issue

    Hi All, one of my user is facing an issue with regards to Invoices not being allocated to the right GRNu2019s.  This causes some invoices to be paid without approval, and other invoices that have been approved to be blocked for payment. for ex: We ha

  • PO release at item level

    Hi all Is it possible to release PO at item level. Our requirement is as follows: We have a field in material master of each material to be checked before PO can be released. The PO price should not be greater than the value in the material master fi