Skip to Content
0
Former Member
Jan 06, 2006 at 05:16 AM

Connection to R/3 system

19 Views

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.