cancel
Showing results for 
Search instead for 
Did you mean: 

Binding problem for model node

0 Kudos

Hi Guru,

I have following structure

like

Context

A--


>ZBAPI DATA----0..n

B--


>HeaderData----0..1

C--


>item data-----0..n

D--


>customer data-0..n

E--


> output data--0..1

The cardinality has came automatically.

i wrote code like this

A a = new A(),

wdContext.nodeA().bind(a);

B b = new B();

a.setOder_B(b);-------> B instance

C c = new C();

a.setOrder_C(c)-------> here passing object showing up Abstract list object.

But c not abstract list object it instance of C.

how can bind or set C and D nods to root node A.

I tried like b.setmat("sss")

then a.addB(b);

Its not working could you please tell me how to bind 0..n cardinality node. any type casting for abstract list...

its little bit urgent

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Ramana,

You may have your context setup wrong to do this. It should look like this

Context -


>ZBAPI_DATA (0,n)

ZBAPI_DATA --->HeaderData (0,1)

ZBAPI_DATA --->Item_Data (0,n)

ZBAPI_DATA --->customer.....

ZBAPI_DATA --->.....

I think you get the idea. ... then you can do somthing like this

Collection itemLinesArray = new ArrayList();

IPrivateApplicationView.IItem_DataElement item_DataElement;

item_DataElement = wdContext.createItem_DataElement();

item_DataElement.setSomeValue("value");

itemLinesArray.add(itemLinesElement);

item_DataElement = wdContext.createItem_DataElement();

item_DataElement.setSomeValue("value2");

itemLinesArray.add(itemLinesElement);

wdContext.nodeItem_Data().bind(itemLinesArray);

This isn’t the only way to do this you can also use the api which should have an addElement(int, object); but its really no different than binding an arraylist.

- Roger

0 Kudos

Hi thnks for ur repply,

But while i am creating

Collection array = new ArryList();

is giving cant resolve collection .

i need import any pakege... i used java.util.ArryList

0 Kudos

Hi Ramana,

That’s the right package for the ArrayList; the Collection Class is java.util.Collection. An easy way to find you imports is to right click on the source code and select Source->Organize Imports from the context menu.

- Roger

0 Kudos

Hi Roger,

Thanks for your quick replies....

while I am writing code

" item = wdContext.createOrder_Items_InElement();"

It is asking object to pass this method.

could check plzz

0 Kudos

Hi Roger,

My requirement is . I have take data from adobe form. needs to export data to bapi.

i was changed the code , but its not working.

Any more stuff on this

Best regards

Ramana

0 Kudos

Hi Ramana,

can you export you project as a zip and email it. I have some time today and wouldn't mind taking a look at it. roger.murphy@sap.com

- Roger