cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with getFunctionTemplate

Former Member
0 Kudos

Hello,

I am trying to use the function template to call my bapi.

So here is my code:

JCO.Repository mRepository;

try

{

mRepository= new JCO.Repository("ARAsoft",connection);

if(mRepository!=null)

{

//Create the function template

IFunctionTemplate ft = mRepository.getFunctionTemplate("GET_VENDOR_DETAILS");

//Create the function from the template

function= ft.getFunction();

}

}

catch (Exception ex) {

throw new Exception("Problem retrieving JCO.Function object.");

}

I have checked that my repository and my connection are not null. So I don't understand why <b>mRepository.getFunctionTemplate(bapi)</b> does not work. I always have an exception at this line.

I would really appreciate any help on this issue.

Thank you and have a nice day.

Maria Duong

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Are you sure the FM name is correct. Our system doesn't have a FM called GET_VENDOR_DETAILS. There is a BAPI called BAPI_VENDOR_GETDETAIL.

Thanks,

Brian

Former Member
0 Kudos

Hi Brian,

Thank you for your answer. In fact, my bapi wasn't remote accessible. That why I got an exception. My problem is fixed.

Have a nice day,

Maria