cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a element to a BAPI node

Former Member
0 Kudos

Hi,

i want to append one or more elements to my node in order to call a BAPI. I found the following code, but it's not to possible to use IPublic<controller>. My controller name is "DocumentPreviewApp" so i tried IPublicDocumentPreviewApp but it does n't work.

Also it's not possible to declare a new model like: GetConnectionModel model = new GetConnectionModel();

I get always the following message: ...can not be resolved or is not a type

regards,

sharam


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();

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

use this below code

<struct> <instance> = new <struct>

IPublic<controller>.I<node>Element ele ;

<instance>.set<attibute>();

ele = wdContext.create<node>Element( <instance> );

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

or you can use this as well

<struct> <instance> = new <struct>

IPublic<controller>.I<node>Element ele ;

<instance>.set<attibute>();

wdContext.node<nodename>.modelobject.add<nodename>(<instance>);

regards,

Gopi

Former Member
0 Kudos

Hello Gopi,

can you please give me an example of an appropriate structure. I tried it with an array but it does not work.

regards,

sharam

Former Member
0 Kudos

If you enter

I<Node>Element

and press CTRL-SPACE, what do you get as available types?

Armin

Former Member
0 Kudos

Hello Armin,

i get nothing. In my context i have a node which called "Bapi_Archivobject_url_input" so i tried:

IBapi_Archivobject_url_inputElement + CTRL-SPACE

regards,

sharam

roberto_tagliento
Active Contributor
0 Kudos

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