cancel
Showing results for 
Search instead for 
Did you mean: 

Connection to R/3 system

Former Member
0 Kudos

hi all,

i am trying the connection to the R/3 system. i have used the following code lines.

IConnectorGatewayService cgservice =

(IConnectorGatewayService) PortalRuntime

.getRuntimeResources()

.getService(

com

.sap

.portal

.services

.api

.connectorgateway

.IConnectorGatewayService

.KEY);

ConnectionProperties cp =

new ConnectionProperties(

request.getLocale(),

request.getUser());

IConnection con = cgservice.getConnection("R3System", cp);

IInteraction ix = con.createInteractionEx();

IInteractionSpec ixspec = ix.getInteractionSpec();

ixspec.setPropertyValue("name", "ZMYFIRSTRFC2");

response.write("after interactionspec");

IFunctionsMetaData functionsMetaData = con.getFunctionsMetaData();

IFunction function = functionsMetaData.getFunction("ZMYFIRSTRFC2");

RecordFactory rf = ix.getRecordFactory();

MappedRecord importParams =

rf.createMappedRecord("CONTAINER_OF_IMPORT_PARAMS");

importParams.put("matnr", matnr);

response.write("Invoking... " + function.getName());

MappedRecord exportParams =

(MappedRecord) ix.execute(ixspec, importParams);

response.write("after execute");

everything is working fine except the last line where i get the exception as

Caused by: com.sap.mw.jco.JCO$Exception: (131) JCO_ERROR_ILLEGAL_ARGUMENT: Function name equals null is not allowed.

at com.sap.mw.jco.JCO$BasicRepository.getFunctionTemplate(JCO.java:19069)

at com.sapportals.connectors.SAPCFConnector.execution.functions.SAPCFConnectorInteraction.execute(SAPCFConnectorInteraction.java:93)

at com.sapportals.connectors.SAPCFConnector.execution.functions.SAPCFConnectorInteraction.execute(SAPCFConnectorInteraction.java:411)

at com.sapportals.connectors.SAPCFConnector.execution.functions.SAPCFConnectorInteraction.execute(SAPCFConnectorInteraction.java:433)

at com.cts.connector.Connector_Dyn$Connector_DynDynPage.getValue(Connector_Dyn.java:90)

can anyone help me out in this regard...

regards,

purushothaman.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

try "Name" instead of "name" when setting the property value of the interaction specs.

Greetz

Christophe

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

first of all thanks for ur reply...

but i am not getting u.....can u be little bit more detailed....

regards,

purushothaman.

Former Member
0 Kudos

Hi Purushotam,

An illegal method argument has been detected so you got to get the method argument from the exception text and check the JAVA application.

regrads,

Viswanadh