Skip to Content
author's profile photo Former Member
Former Member

How can you iterate through the values of a bapi node?

i try to process the values getting from a bapi call. but the iterator i get is always empty. Neither "it" nor "it1" has any values.

Any ideas?

Regards Jens

try {

wdContext

.currentIsa_Read_Catalog_Complete_InputElement()

.modelObject()

.execute();

Iterator it = wdThis.wdGetContext().nodeIsa_Read_Catalog_Complete_Input().nodeOutput().nodeItems().iterateChildNodes();

Iterator it1= wdThis.wdGetContext().nodeIsa_Read_Catalog_Complete_Input().nodeOutput().nodeItems().getNodeInfo().iterateChildren();

while (it.hasNext()) {

IItemsNode node = (IItemsNode) it.next();

}

wdContext.nodeOutput().invalidate();

} catch (Exception e) {

}

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Dec 05, 2004 at 06:20 PM

    Hi Jens,

    Incase you want to loop the elements of the node to get the values in attributes you can do in the following manner.

    <i>for(int i = 0; i < wdContext.node<Name of the node>().size(); i++){

    wdContext.node<Name of the node>().moveTo(i);

    wdContext.current<Name of the Node>Element().get<Attribute Name>();

    }</i>

    Hope this helps.

    Regards

    Sidharth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2004 at 06:14 PM

    Hi Jens,

    after "navigating" to the items node, you can loop through the elements of the node like:

    for(int ix = 0; ix < wdContext.nodeX().nodeY().nodeItems().size(); ix++) {
      IXElement element = wdContext.nodeX().nodeY().nodeItems().getXElementAt(ix);
      /** Do something with the element */
    }

    Hope that helps.

    Regards

    Stefan

    PS.: wdThis.wdGetContext() is exactly the same as the predefined instance member wdContext.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.