cancel
Showing results for 
Search instead for 
Did you mean: 

RFC API error

Former Member
0 Kudos
359

Hi,

I have a RFC receiver. The mapping contains a UDF which has a call to a RFC. While testing the mapping the following error comes up:

Error while lookup Exception during processing the payload.Problem when calling an adapter by using communication channel rfc_recr_cc (Party: , Service: B47CLNT200, Object ID: 16d73bffb3d8321d8a070dffa7f3f1c4) XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.af.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: functiontemplate from repository was <null>'. Cause Exception: 'error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: functiontemplate from repository was <null>'.

Please help.

-kshitija.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

check

question 16 from SAP note : 730870

Also

In Receiver Agreement,make sure that

the interface of receiver is a SAP function module,

the namespace of receiver is

urn:sap-com:document:sap:rfc:functions,

the receiver CC should be RFC type.

In interface determination,the inbound interface should be the SAP function module above,and you have to assign

a interface mapping for it.

Regards

krishna

Message was edited by:

Krishnamoorthy Ramakrishnan

bhavesh_kantilal
Active Contributor
0 Kudos

1.What is the code you are using in the RFC Look up?

2 . Is the Business System, name and Comm Channel ( RFC receiver adapter ) valid?

3. What is the status of thereceiver RFC adapter?

4. Make sure that this adapter is no used in any Receiver Agreements.

Regards

Bhavesh

Former Member
0 Kudos

1.) This is the code :

//write your code here

//write your code here

String content = "";

MappingTrace importanttrace;

importanttrace = container.getTrace();

// filling the string with our RFC-XML (with values)

String m = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:ZGET_VENDORNAME" +

"xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\""+

"><VENDOR_NO>0000000001</VENDOR_NO></ns0:ZGET_VENDORNAME>";

RfcAccessor accessor = null;

ByteArrayOutputStream out = null;

try

{

// 1. Determine a channel (Business system, Communication channel)

Channel channel = LookupService.getChannel("B47CLNT200","rfc_recr_cc");

// 2. Get a RFC accessor for a channel.

accessor = LookupService.getRfcAccessor(channel);

// 3. Create a xml input stream representing the function module request message.

InputStream inputStream = new ByteArrayInputStream(m.getBytes());

// 4. Create xml payload

XmlPayload payload = LookupService.getXmlPayload(inputStream);

// 5. Execute lookup.

Payload result = accessor.call(payload);

InputStream in = result.getContent();

out = new ByteArrayOutputStream(1024);

byte[] buffer = new byte[1024];

for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {

out.write(buffer, 0, read);

}

content = out.toString();

}

catch(LookupException e)

{

importanttrace.addWarning("Error while lookup " + e.getMessage() );

}

catch(IOException e)

{

importanttrace.addWarning("Error " + e.getMessage() );

}

finally

{

if (out!=null) {

try {

out.close();

} catch (IOException e) {

importanttrace.addWarning("Error while closing stream " + e.getMessage() );

}

}

// 7. close the accessor in order to free resources.

if (accessor!=null) {

try {

accessor.close();

} catch (LookupException e) {

importanttrace.addWarning("Error while closing accessor " + e.getMessage() );

}

}

}

//returning the result – RFC-XML.response

return content;

RFC name : ZGET_VENDORNAME

Communication channel is : rfc_recr_cc

Business system : B47CLNT200

2.) Business System name and Comm Channel ( RFC receiver adapter ) are valid.

3.) Status of the receiver RFC adapter is active.

4.) I have still not created any receiver agreements. I am just testing the mapping.

bhavesh_kantilal
Active Contributor
0 Kudos

Is this Z Rfc available andremote enabaled in your SAP system?

If yes, try to reactivate the RFC adapter and check this again.

Regards

Bhavesh

Former Member
0 Kudos

i have tried that..but it is not working..m getting the same error...