cancel
Showing results for 
Search instead for 
Did you mean: 

Failing to initialize an RFC in WDJ application

Former Member
0 Kudos

Dear All,

I have created an RFC enabled function module in $TMP.

I am trying to invoke this RFC passing a paramter value in my WDJ application.

The RFC is not even getting initialized and the entire thing ends with a null pointer exception.

Please help me out.

Regards,

Prosenjit.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

tahnks

Former Member
0 Kudos

thanks

Former Member
0 Kudos

Hi,

Option 1: Try to reimport the model and see if there is any information coming.

Option 2: Create a bapi with TR and check.

Best wishes

Idhaya R

Former Member
0 Kudos

Hi,

If possible can you post the code here. There should be some issue in the code.

Check you are passing all the mandatory parameters while executing RFC?

Regards,

Charan

Former Member
0 Kudos

Hi Krishna,

I am pasting the instantiation part code below.

Zcno_Rfc_Test_Input setNode = new Zcno_Rfc_Test_Input();

wdContext.nodeZcno_Rfc_Test_Input().bind(setNode);

This part itself its giving null pointer exception.

Regards,

Prosenjit.

Former Member
0 Kudos

Hi,

Before this instatiate the model object and check.

ZRFCTestModel objModel=new ZRFCTestModel();

Zcno_Rfc_Test_Input setNode = new Zcno_Rfc_Test_Input();

wdContext.nodeZcno_Rfc_Test_Input().bind(setNode);

And are you sure you are getting the error here itself or you are getting the error at modelObject.execute().

Regards,

Charan

Former Member
0 Kudos

Hi,

Can you print the following messages in catch block and let us know what is the exact exception it is throwing after model execution.

try

{

Zcno_Rfc_Test_Input setNode = new Zcno_Rfc_Test_Input();

wdContext.nodeZcno_Rfc_Test_Input().bind(setNode);

wdContext.currentRequestZcno_Rfc_Test_InputElement().modelObject().execute();

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("Error Message "+e.getMessage,true);

wdComponentAPI.getMessageManager().reportException("Error Cause "+e.getCause,true);

}

Regards,

Saleem

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Prosenjit

In the posted snipped the only place where NPE can occur is wdContext.nodeZcno_Rfc_Test_Input(). This might happen if your node Zcno_Rfc_Test_Input is located not in the root context node, but in some parent context node. If this is your case then ensure that the parent node has at least one element, before invoking wdContext.nodeZcno_Rfc_Test_Input().

BR, Sergei