cancel
Showing results for 
Search instead for 
Did you mean: 

JSP Dynpage

Former Member
0 Kudos

thru adaptive RFC model we can connect and retrieve the information from R/3.

how is it possible thru JSP Dynpage to connect to SAP system.

can any one assist me related to this.

if possible send some applications.

sekhar.c

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You have to use JCA based on SAP Java Connector.

Have a look at the following code sample.


IConnection connection = null;


	Object connectorService = 
		PortalRuntime.getRuntimeResources().
										getService(IConnectorService.KEY);
	IConnectorGatewayService cgService =
								(IConnectorGatewayService)connectorService;
	connection = cgService.getConnection("<your SAP system name>",ipcRequest);
	if(connection != null)
	{
		IInteraction iInteraction = connection.createInteractionEx();
		IInteractionSpec iInteractionSpec = iInteraction.getInteractionSpec();
		iInteractionSpec.setPropertyValue("Name",functionNameStr);
		RecordFactory recordFactory = iInteraction.getRecordFactory();
				
		MappedRecord inputRecord = recordFactory.createMappedRecord("input"+personnelStr);
//              Setting Import Parameters
		inputRecord.put("<Your field name>",personnelStr.trim());
				
		// Executing the FM
		MappedRecord output = 
			(MappedRecord)iInteraction.execute(iInteractionSpec,inputRecord);
		String abc = output.get("<OUTPUT PARAM NAME>");

					
					output.clear();
					iInteraction.close();
					connection.close();								
				}

The following has to be added to the portalapp.xml in the SharingReference Part so that the program has no problems at runtime.

<b>com.sap.portal.ivs.connectorservice</b>

Try this. In the meanwhile, I shall try to dig up for more documents.

Also follow this link for more info on Connector Framework.

<a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/36b9ac90-0201-0010-8689-ee8405649ce7">Connector Framework</a>

Pradeep