cancel
Showing results for 
Search instead for 
Did you mean: 

Error in value returned from BAPI

Former Member
0 Kudos

Hi,

I have created a RFC model for the BAPI. This has many nodes as context. In my scenario, I have like this.

<b>Node A

-


Node B ( Model node)

-


Var C (Model variable)</b>

When I execute the BAPI, I get size for Node A as 1 but node B as zero. But this is not the case if I execute the BAPI directly from SAP GUI. I get output in both nodes with same inputs. I couldn't trace the problem why I don't get any value in other node. It returns null pointer exception. Kindly help me out.

Regards,

Harini S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Check your invalidate statement for response NodeB.

Former Member
0 Kudos

Hi,

I have tried that also before. It doesn't help. I get the same error.

Regards,

Harini S

Former Member
0 Kudos

Harini,

Post your code (<i>data population / RFC execution</i>) with specific reference to the line of code that gives NPE.

Bala

Former Member
0 Kudos

Hi,

This is the snippet.

String stLow = wdContext.nodeDl_Head().currentDl_HeadElement().getKunnr();
wdContext.nodeOutputCusContact().invalidate();
wdContext.nodeContactaddressdata().invalidate();

// Execute BAPI in getCustomerContactList method
wdThis.wdGetCO_GenerateappController().getCustomerContactList(stLow);
wdComponentAPI.getMessageManager().reportSuccess("Cont:"+ wdContext.nodeContactaddressdata().size());
wdComponentAPI.getMessageManager().reportSuccess("Out:"+ wdContext.nodeOutputCusContact().size());

The BAPI gets executed successfully since we r getting values for other nodes in the same main node. Only one particular node gives this problem.

wdContext.nodeContactaddressdata().size() returns 0. Any get on that node causes null pointer exception. Please guide me.

Regards,

Harini S

Former Member
0 Kudos

Harini,

Then your problem with output is probably caused by invalid input.

As an example: say you have NUMERIC attributes of fixed length in RFC input. SAP GUI prepends leading zeros to your input (so 18 is 0000000018 if fixed length is 10). But for some reasons this conversion functions is not used by WD Adaptive RFC model. You need to prepend leading zeros yourself in this case.

So my advise: check automatic conversions applied to input values in SAP GUI and try to mimic them in WD.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Valery,

Thank you for the suggestion. I'll check that out and come back.

Regards,

Harini S

Former Member
0 Kudos

Hi,

The problem was with invalid input as you have suggested.

Thank you. My problem is solved.

Regards,

Harini S

Answers (0)