cancel
Showing results for 
Search instead for 
Did you mean: 

Questions reg Looping through a Node inside a Currently Selected Node.

Former Member
0 Kudos

i have the following context structure in my WD application.

Parent Customer Node A<Cardinality 1.n & Selection 1.n & Singleton True>

Child Addresses Node B<Cardinality 1.n & Selection 1.n & Singleton True>

Child Attribute B.City

Child Attribute A.Name

Child Attribute A.Age

For the currently selected Parent Customer Element, i want to read the all the addresses this customer has. How to read all the addresses of the customer and loop through it & show it.

Any inputs are appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185879
Active Contributor
0 Kudos

Hello Saravanan,

Please use the Singleton Concept.

Refer the following links.

http://help.sap.com/saphelp_nwce711core/helpdata/en/47/be673f79c8296fe10000000a42189b/frameset.htm

http://wiki.sdn.sap.com/wiki/display/WDJava/SupplyFunctionin+Webdynpro

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60086bd5-9301-2b10-6f97-a14366a56...

if you have doubt in implementation then let us know.

Regards

Nizamudeen SM

Answers (1)

Answers (1)

Former Member
0 Kudos

ICustomerElement customer = wdContext.currentCustomerElement();
for (int i = 0, n = customer.nodeAddresses().size(); i < n; ++i)
{
  IAddressesElement address = customer.nodeAddresses().getAddressesElementAt(i);
  /* do whatever */
}
Former Member
0 Kudos

Thanks Nizam and Segmentation :).... Gave the points..