How to poputale a node within a node using WD Abap?

Hi Experts.
I have a context structure resembling something similar to this:
node-FAMILY  (1..1)
  --attribute-MOTHER
  --attribute-FATHER
    --node-CHILDREN  (0..n) 
      --attribute-NAME
      --attribute-AGE
I use the following code to populate MOTHER and FATHER:
DATA lo_el_family TYPE REF TO if_wd_context_element.
  lo_el_family->set_attribute(name =  `MOTHER`value = ls_text-mother ).
  lo_el_family->set_attribute(name =  `FATHER` value = ls_text-father ).
I now need to add 3 children's names and ages to the node CHILDREN of cardinality (0..n)
I tried using something like this, but it doesn't work:
  LOOP AT lt_children INTO ls_children.
      ls_children-name = ls_data-name.
      ls_children-age = ls_data-age.
      Append ls_children TO lt_children.
  ENDLOOP.
      lo_nd_children->bind_table( new_items = lt_children set_initial_elements = abap_true ).
Any suggestions on how to create multiple entries for node CHILDREN for each node FAMILY?
Thanks in Advance
Anton Kruse
Edited by: Anton Kruse on Jun 15, 2009 11:46 AM

You need to ask for the element set of the parent and then loop through this element set and do a bind_table for each one to add its appropriate children:
****Loop Through all the Items
  data element_set type wdr_context_element_set.
  field-symbols <wa_set> like line of element_set.
  field-symbols <wa_item> type sdemo_so_item_all.
  data l_tabix type sytabix.
  element_set = lo_nd_sales_items->get_elements( ).
  loop at element_set assigning <wa_set>.
    l_tabix = sy-tabix.
    read table <wa_so>-t_item assigning <wa_item> index l_tabix.
*****Load WDCTX_SALES_ITEM_TEXT
    data lo_nd_sales_item_text type ref to if_wd_context_node.
    lo_nd_sales_item_text = <wa_set>->get_child_node( name = if_componentcontroller=>wdctx_sales_item_text ).
    lo_nd_sales_item_text->bind_table( new_items = <wa_item>-lt_sales_item_text set_initial_elements = abap_true ).
endloop.

Similar Messages

  • How to Populate Node Within Parent Node?

    Hi @,
    I have nodeA within that nodeB .nodeA can have multiple nodeB.
    But the contents of nodeB have to be derived from one attribute in nodeA.
    I am not able to attach the nodes to the nodeA.
    How can we do this?
    Regards

    Hi @,
    I am sorry, my nodes have different Name I was just quoting an example.
    nodeB is LineItem kind of field for nodeA so nodeB will contain multiple elements within .
    nodeA
    ---attrA
    ---nodeB
    attrB
    attrA and nodeB are at same level.
    Regards
    Edited by: BeyondThe obvious on Oct 14, 2008 1:58 PM
    Edited by: BeyondThe obvious on Oct 14, 2008 1:59 PM

  • Accessing node within a node in a context

    Hi!
    I have Node strucrure like this in my context..
    Node           (0..n)(singleton="true")
       Node1      (0..n)(singleton="true")
         Node11  (0..n)(singleton="true")
           atrr1
           attr2
    Can you tell me that how can I access Node11 and its attributes?
    Iam having n number of Node1's under each Node and again n number of Node11's under each Node1. I need to access attributes of each Node11. How can i do that??
    Thanks,
    Archana

    Hi Archana,
    As u described ur scenario, there are multiple instances of Node1 exist for Node
    and Node11 for Node1.So u have to set "singleton" property of child nodes to false.
    Otherwise the elements of the relevant node are instantiated for only one element of the parent node.
    for(int i=0;i<wdContext.nodeNode().size();i++)
      wdContext.nodeNode().setLeadSelection(i);
    for(int j=0;j<wdContext.nodeNode1().size();j++)
       wdContext.nodeNode1().setLeadSelection(j);
       for(int k=0;k<wdContext.nodeNode11().size();k++)
        wdContext.nodeNode11().setLeadSelection(k);
        wdContext.currentNode11Element.getAttributeValue("attrName");
    Hope it helps!

  • How To pass the value within the page using jsp?

    How to passing the textbox value within the jsp page without using javascript or reload the page.
    I have a scenario like this:
    I have a textbox named as "accno" which allow user to key in the accno. After key in the accno, this accno value will used to do a query from database using jstl.
    here is part of my code
    <input name="accno" type="text" onChange="checkLC()"/>
    <sql:query var="results" dataSource="${db}">
    select accno,name from account where accno = '<%=value get from accno textbox%>'          
    </sql:query>
    <c:out value="${result.rows[0].name}"/>
    note that onChange() is the javascript when user key in accno then automatically go to check database then only show out the name. So how can i get the '<%=value get from accno textbox%>' from accno textbox.

    How to passing the textbox value within the jsp page
    without using javascript or reload the page.No, jsp executes on the remoter server, the text box is on a client machine, you need to send information to the server over the network, http does this with a request, which will reload the page.....................

  • How to count the days between Date Range using OO ABAP?

    hi experts,
            i want to count the days between Date Range using OO ABAP for that  which class and method  can i use?.
    Thanks,
    Mahesh.

    Not sure I understand the requirement for it to be OO, but you could always write your own (i.e. use this):
    REPORT zz_date_diff.
    CLASS date_diff DEFINITION.
      PUBLIC SECTION.
        METHODS diff IMPORTING     i_date_fm TYPE d
                                   i_date_to TYPE d
                     EXPORTING     e_days    TYPE i.
    ENDCLASS."
    CLASS date_diff IMPLEMENTATION.
      METHOD diff.
        e_days = i_date_to - i_date_fm.
      ENDMETHOD."
    ENDCLASS."
    DATA: g_ref TYPE REF TO date_diff,
          g_days  TYPE i,
          g_date_fm  TYPE d VALUE '20080101',
          g_date_to  TYPE d VALUE '20090101'.
    START-OF-SELECTION.
      CREATE OBJECT g_ref.
      CALL METHOD g_ref->diff
        EXPORTING
          i_date_fm = g_date_fm
          i_date_to = g_date_to
        IMPORTING
          e_days    = g_days.
      WRITE g_days.

  • BRF+ Deleting functions within object nodes

    Hi Experts,
    We are a large FMCG company and are implementing SAP Master Data Governance module for managing our material master data.
    Hence, we have chosen BRF+ as the business rule engine to drive SAP MDG. SAP MDG version is EHP5
    To create a ruleset, I initially create an object node within the 'Trigger tab' in the catalog. This object node is created with a naming convention DERIVE_ENTITY_ATTRIBUTE. I have then successfully created a function within the object and defined a ruleset as well.
    Now if I delete the object node; it gets deleted from the trigger function tab. However if I create a new object node with a similar function, the system does not allow me to create the function as it throws a warning message stating that the function still exists.
    Hence I wanted to know HOW DO I DELETE THE FUNCTION if the Object node for that function has already been deleted?
    Is there any option to search the function and delete it?
    Thanks in advance
    Edited by: Reenav on Nov 29, 2011 12:29 PM

    Hi Carsten,
    Where do you actually restore an object though?  I don't see a button on the UI. 
    I have deleted an object by mistake, but since I don't have versioning turned on I cannot do a version restore.  However I can still see the deleted object since it's only logically deleted?
    If you do not have versioning turned on is it then impossible to restore?
    Thanks,
    Lee

  • How can I include CDATA in the node-value?

    Hi Experts,
    Via XI I map an incoming mail message to an outgoing XML. To be sure to not run into problems, I want to put <![CDATA[ and ]]> around the node-values.
    Currently, I just do this in my message-mapping via a concatenate. The result LOOKS fine, but the XML-parser on the receiving application treats the CDATA as part of the total string and not as an indicator to accept every charachter within the node-value.
    How can I put this CDATA around the node-values in a correct manner?
    Thanks for your help!
    Regards
    William

    Hello,
    These Links will help you....
    This might help
    Message Mapping - same structure
    /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
    http://www.cxml.org/files/downloads.cfm
    ******************************Reward points,if found useful

  • How can I get the previous clicked node in a Tree?

    I have a JTree. If a node is selected, before the user select another, I need to make a question if he have sure about the new selection.
    If the user answers not, I need to select the previous node.
    I have in my class a variable, type of DefaultMutableTreeNode, that makes reference to the last node selected.
    How can I turn this node selected again, if the user select "No"?
    Thanks for any help.
    Renato de Melo

    You don't want to maintain a reference to the last selected node, but to the last selected path. Nodes within a tree are addressed using a TreePath, with contains references to each node from the root, down to a specific node. Look at the JavaDocs of javax.swing.tree.TreePath for more info.
    Also, JTree has getter/setter methods for the selectionPath.

  • How to address message to the specific node of the ESB cluster

    Hi!
    We are running ESB on two node active-active cluster configuration. We use custom adapter to communicate with customer legacy system over Socket connection. The point is, that we need to transfer large amount of data from our database into customer system using one open socket connection. Because of memory limitation we had to split data into multiple messages in ESB. This socket connection can be open from any of the active cluster node, but ones it's open all messages must be send within the node which had open the connection.So, the messages should not arrive into another node. The question: How is it possible to address (route) ESB messages into specific node of the cluster?
    Thanks in advance.
    Jaro,

    Muthu92 wrote:
    Thank you for your reply. It is very useful for me.  But i can't give conditional operator in that operator. It is showing error.
    My Test cases
    A[0]+A[1]>150
    A[31]-50 <100.
    If those are your exact statements, then they don't make sense in a formula node.  You have to use them in an if-statement or some other type of control logic.  This mimics text-based programming languages such as C... See here for instructions on formula node syntax: http://zone.ni.com/reference/en-XX/help/371361G-01​/lvhowto/formula_node_syntax/
    For instance, you COULD say something like:
    **In this example, let A[0] == x, A[1] == y, A[31] == z**
    if(x+y>150)
    /* do something if this is true */
    else if(z-50 < 100)
    /* do something else */
    EDIT: 
    It should also be noted that Variable Names MUST be lowercase!! I just discovered this
    EDIT2:
    I stand corrected.  After trying to create an example and digging through the LabVIEW Help, I stumbled across this:
    Differences between the Parser in the Mathematics VIs and the Formula Node
    The parser in the Mathematics VIs supports all elements that Formula Nodes support with the following exceptions:
    Variables—Only a, a0, ..., a9, ... z, z0, ..., z9, are valid.
    Logical, conditional, inequality, equality—?:,, &&, !=, ==, <, >, <=, and >= are not valid.
    Functions—atan2, max, min, mod, pow, rem, and sizeOfDim are not valid. You can use these functions in a Formula Node or use their corresponding LabVIEW functions.
    So it DOES NOT seem like Eval Formula Node can do conditionals like you want.  I would just implement them using a LabVIEW based algorithm after all.  Trying to out smart the formula nodes to avoid simple LabVIEW code is just too much of a hassle
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

  • How can I get the adf-tree-node's attributes?

    I want get the attributes in the method of "selectionListener"?
    How can I do?
    I only know :
    RichTree treeId;
    RowKeySet keySet = treeId.getSelectedRowKeys();
    Thanks!

    You don't want to maintain a reference to the last selected node, but to the last selected path. Nodes within a tree are addressed using a TreePath, with contains references to each node from the root, down to a specific node. Look at the JavaDocs of javax.swing.tree.TreePath for more info.
    Also, JTree has getter/setter methods for the selectionPath.

  • How to blick tree view few specific nodes

    here i got a code which show how to blink tree view node but i am confuse that how to blink few node.
    Answered by:
    Avatar of Tamer Oz
    20,185
    Points
    Top 0.5
    Tamer Oz
    Partner Joined Sep 2009
    2
    8
    17
    Tamer Oz's threads
    Show activity
    Treeview control - How to make a node blink?
    Visual Studio Languages
    .NET Framework
    >
    Visual C#
    Question
    Alert me
    Question
    Vote as helpful
    0
    Vote
    Hi,
    Is there a "elegant" way to make blink a treeview node?
    I am thinking to use a timer with the collection of nodes that I want to make the blink effect, and update the icon ...
    Friday, November 06, 2009 6:19 PM
    Reply
    |
    Quote
    |
    Report as abuse
    Avatar of Kikeman
    Kikeman
    R. BOSCH
    105 Points
    All replies
    Question
    Vote as helpful
    0
    Vote
    Hi,
    You can develop your custom control for this purpose. The logic you mentioned was correct. Here is a sample control that I developed by the logic you mentioned.
    public class BlinkingTreeView : TreeView
    private Timer t = new Timer();
    private List<TreeNode> blinkingNodes = new List<TreeNode>();
    public BlinkingTreeView()
    t.Interval = 1000;
    t.Tick += new EventHandler(t_Tick);
    bool isNodeBlinked = false;
    void t_Tick(object sender, EventArgs e)
    foreach (TreeNode tn in blinkingNodes)
    if (isNodeBlinked)
    //update Icon
    tn.Text = tn.Text.Substring(0, tn.Text.Length - 1);//to test
    isNodeBlinked = false;
    else
    //update Icon
    tn.Text = tn.Text + "*";//to test
    isNodeBlinked = true;
    public void AddBlinkNode(TreeNode n)
    blinkingNodes.Add(n);
    public void RemoveBlinkNode(TreeNode n)
    blinkingNodes.Remove(n);
    public void ClearBlinkNodes()
    blinkingNodes.Clear();
    public List<TreeNode> BlinkingNodes
    get { return blinkingNodes; }
    public int BlinkInterval
    get { return t.Interval; }
    set { t.Interval = value; }
    public void StartBlinking()
    isNodeBlinked = false;
    t.Enabled = true;
    public void StopBlinking()
    t.Enabled = false;
    just show me how to use BlinkingTreeView class. i will have tree view which will have few node and few nodes may have few child nodes. now how to achieve by this class BlinkingTreeView and show me how to blink few specific node not all. thanks

    better to come with code. first populate tree view with some dummy node this way
    Root
           Child1
                    Child1-sub1
                    Child1-sub2
           Child2
                    Child2-sub1
                    Child2-sub2
    now blink Child1-sub2 & Child2-sub1. please come with code. thanks

  • How to read the content in one node of XML in Java? Pls help

    My dear brothers,
    I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
    1. Create a GUI form which gives the ability for user to choose a XML file (ok)
    2. Load XML and return the file (ok)
    3. Read the file from node to node to create the node in Tree View (?!)
    Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
    Hoang Yen Binh

    I hope this one helps you.
         <ABC Type="ProductBased" ProdName="One" Location="India">
              <CEO>Raj</CEO>
              <Finance>Vikram</Finance>
              <HR>Karthik</HR>
              <Technical>Satish</Technical>
         </ABC>
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Attr;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.DOMException;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import java.io.File;
    import java.io.IOException;
    public class XmlReading {
         Document doc;
         Element element;
         public static void main(String[] args) throws Exception{
              XmlReading xr = new XmlReading();
              xr.getXmlParser(args);
         public void getXmlParser(String[] args) {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   if(args.length != 1) {
                        System.err.println("Argument Required");
              try {
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   doc = builder.parse(new File(args[0]));
              }catch(ParserConfigurationException e1) {
              }catch(SAXException e2) {
              }catch(IOException e3) {
              getAttributes();
         public void getAttributes() {
              // Retrive the entire Document from the Dom Tree
              element = doc.getDocumentElement();
    //          System.out.println(element);
              NamedNodeMap attrs = element.getAttributes();
              // Get number of attributes in the element
         int numAttrs = attrs.getLength();
         // Process each attribute
              for (int i=0; i<numAttrs; i++) {
                   Node node = attrs.item(i);
                   // Get attribute name and value
                   String attrName = node.getNodeName();
                   String attrValue = node.getNodeValue();
                   System.out.println(attrName + ": " + attrValue);
              String s1 = element.getTagName();
              System.out.println(s1);
              // To get all the elements in a DOM Tree
              NodeList nl1 = element.getElementsByTagName("*");
              int i2 = nl1.getLength();
              System.out.println(i2);
              for(int i=0; i<i2; i++) {
                   System.out.println(nl1.item(i) + "\n");
    }

  • How to populate a Value Attribute of a Value Node inside Model Node

    Hello
    I have my context like this.
      Context
    ..          - ModelNode
    ....                      - Model Attr1
    ....                      - Model Attr2
    ....                      - Model Attr3
    ....                      - Model Attr4
    ....                      - Value Node
    ......                                  |
    ......                                   - Value Attr1
    Model Node is of Cardinality 0..N
    Value Node is of Cardinality 1..1
    I want to create multiple records in my Model Node and one record for every Model Node in Value Node.
    How to do this?
    All good suggestions are welcome.
    Regards,
    Shubham

    Hi Shubham,
    With your context structure the code will be
    for(int i = wdContext.nodeModelNode().size()-1 ; i>=0 ; i--)
        IPublic<comp name>.IModelNodeElement ele =   wdContext.nodeModelNode().getModelNodeElementAt(i);
        IPublic<comp name>.IValNodeElement valEle = wdContext.nodeModelNode().nodeValNode().createValNodeElement();
        valele.setValAttr("");
        ele.nodeValNode().addElement( valEle);
    Your val node should be non singleton (singleton property = false)
    Regards,
    Jaydeep

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to set CORS properties for BLOB Storage using node?

    Hi - I just got started with Azure using a Node-based web site and mobile services.
    I am following various documentation in order to provide an API for users to upload images via a time-restricted SAS for the BLOB Storage.
    In order to upload my image, I need to set the CORS configuration for the BLOB Storage. Unfortunately this cannot be done via the management portal.
    I'm unclear as to how to accomplish this. I'm considering using the startup.js file in my mobile service to make a post request to the BLOB Storage REST API:
    http://msdn.microsoft.com/en-us/library/windowsazure/hh452235.aspx
    Are there appropriate methods in the Node SDK to make this easier, especially the signing part?
    What is the recommended way for setting CORS properties for the BLOB Storage via Node?
    Thanks for your help
    Stefan

    Unfortunately Node SDK does not support CORS functionality yet. Your option would be to write code which consumes the REST API for setting CORS. Not sure if it helps but there's a free tool out there written by my company which you can use to set CORS
    on your storage account. More information about this tool can be found here:
    http://blog.cynapta.com/2013/12/cynapta-azure-cors-helper-free-tool-to-manage-cors-rules-for-windows-azure-blob-storage/
    Hope this helps.

Maybe you are looking for

  • My HP ENVY dv4 windows 8 camera is not working and it cannot be found on the device manager.

    I am using a HP Envy dv4 on Windows 8 and trying to use the 'Cyberlink Youcam ' Webcam which is not working. When I went to find it in the device manager, it was not present. I have restarted my computer already. Product Number: D5F96PA#AB4 Serial Nu

  • Different B5 template page sizes in Illustrator and Indesign

    Hello, I just created new document in Indesign but also needed to prepare backgroud image in Illustrator. What I've found is that B5 template page sizes are different in both apps. Is it for any reason?

  • Is there VNC software for OS9?

    Is there VNC software for OS9? (Like Chicken of the VNC for OSX) I want to be able to control an OSX machine from an OS9 machine. Can this be done? -JN

  • My project file in not where I thought it was. How can I find it?

    I have been searching through my old Premier Pro 5.5 projects and archiving several to a different drive to make room on my projects drive. I closed down Premier Pro and then re opened later to continue editing a current job, but my project was missi

  • Importing music from CD

    I am Running XP and Itunes 5 I have been busy importing music from my CD collection which because of lack of space has to be stored away. Recently I have found that when inserting a cd in the cd drive Itunes will not recognise that their is a cd ther