cancel
Showing results for 
Search instead for 
Did you mean: 

Could not create/init an instance of a model

Former Member
0 Kudos

Hi,

I get the following error-message:

failed to create or init instance of model 'xyz' in scope APPLICATION_SCOPE with instanceId 'null'

Do somebody know this message?

I don't understand it, because I have another applications, which are made in the same way, and there are no problems, only at this application.

Accepted Solutions (0)

Answers (3)

Answers (3)

siarhei_pisarenka3
Active Contributor
0 Kudos

Could you please show the code how you create the model instance?

BR, Siarhei

Former Member
0 Kudos

Hi,

This is the code for executing the Model class.

<FM NAME> inst = new <FM NAME>_Input();

wdcontext.node<FM NAME_Input> .bind(inst);

wdcontext.currentNode<FM_Input>element.modelobject().execute();

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

Please do not get confused with the function modules input node structure and the Model Node structure in the context.

<FM's Input Structure> inst = new <FM's Input Structure>();

wdcontext.node<Model Node in Context> .bind(inst);

inst.set<Attr1>(.....);

........

try{

wdcontext.current<Model Node Name>Element().modelobject().execute();

wdContext.node<OutputNode within Model Node>().invalidate();

}

catch(Exception e){

}

Make sure you do model binding of the model node in your context to the input structure within the function model.

Regards,

Tushar Sinha

Former Member
0 Kudos

Hi Stefan,

1. Test JCOs on portal

2. Check if the function module is working fine in SE37

3. Check that the function module is Remote Enabled in R/3

4. Delete the model if problem persists along with the model node in the context and then freshly import it again.

Regards,

Tushar Sinha

Former Member
0 Kudos

Hi,

Could you please post the complete error stack trace?

And also ensure that JCo connections are configured properly and that function module is working properly in R/3 itself?

Please have a look at this thread

Regards,

Saravanan K