cancel
Showing results for 
Search instead for 
Did you mean: 

Adding another element to a model node

Former Member
0 Kudos

Hi,

After calling a BAPI I want to add another element to a model node. My problem is, that when I use bind() or addElement() all elements are deleted and only the one i added is there in the end.

My coding for that is the following:

// Add SalesOrg 9999 = Combo

IPublicZ_Hus_P22_Get_Properties.IIt_Sales_OrgNode soNode =

wdContext.nodeOutput_Z_Hus_P22_Get_Properties().nodeIt_Sales_Org();

Zvkorg model = new Zvkorg();

model.setVkorg("9999");

model.setVtext("Combo");

IPublicZ_Hus_P22_Get_Properties.IIt_Sales_OrgElement combo =

soNode.createIt_Sales_OrgElement(model);

wdContext.nodeIt_Sales_Org().addElement(combo);

Would be great, if you can tell me what's wrong with that coding. Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Timo,

If i am not wrong, you want to add one element in your node after executing your BAPI. Means, you want to append one more element in result.

Try following code for the same:

wdContext.node<Node name>().validate();

IPublic<controller>.I<node>Element ele = wdContext.create<node>Element(new <model structure type>());

ele.set<attribute name>("<value>");

wdContext.node<node name>().addElement(ele);

wdContext.<node name>().invalidate();

Regards,

Bhavik

P.S. : Don;t forget to reward points if it was helpful

Former Member
0 Kudos

Hi Bhavik,

Exactly, I want to add an element after executing the BAPI. I just tried your code, it works great.

Honestly, I would give you 100 points here, but the maximum is 10 points. That thing was really driving me crazy.

Thanks a lot!!

Answers (0)