cancel
Showing results for 
Search instead for 
Did you mean: 

manage one empty field from a BAPI (RFC)

Former Member
0 Kudos

Hi I create a model for my RFC.

The model import a BAPI ( 7 input fields , 1 output field)

Into the SAP this function run good but one of the 7 input fields is empty.

I create a view with 7 input and 1 outuput fields, but when I execute the BAPI, I have a null pointer exception.

The problem is setting the value of the empty fields in Bapi function.

This is no my first exsercise, but is my first time that I manage one empty field of a BAPI.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Marco,

Handling of BAPI input fields are same as other attributes.

you can check the value is null before execute the BAPI.

if(wdContext.current<nodeName>Element.get<ElementName>()==null){

wdContext.current<nodeName>Element.get<ElementName>()="";

}

kind Regards,

Mukesh.

Former Member
0 Kudos

Hi Marco,

Out of the 7 fields, set to empty values for the variables which you are not setting/passing any value.

Sample code looks like follows:

wdContext.Current<your node name>.setInputField1("");

Hope this helps you.

Regards,

Shiva Kumar

Former Member
0 Kudos

Marco,

What is the datatype of that field? If it is <i>String</i>, then set it to "null".

Bala