Skip to Content
author's profile photo Former Member
Former Member

Connect to R/3 with the connector framework


I am trying to call a RFC function from R/3 using the new connector framework instead of JCO.

However, I'm not quite sure how to create complex data type for the input parameters. I get the parameter structure but I don't know how to create the IRecordSet object to send in the input parameters record.

Any help would be appreciated.

Thank you.


Rui Gonçalves

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Dec 21, 2003 at 06:37 PM

    Check the JCO examples.

    It is the same. Sap CF just offers the connection management.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member



      public static IConnection getConnection(String sapSystemAlias,

      IPortalComponentRequest componentRequest)

      throws IllegalArgumentException {

      // check if passed attributes are null

      if (componentRequest == null) { throw new IllegalArgumentException(

      "IComponentRequest object can not be null!"); }

      if (sapSystemAlias == null) {

      // use default system alias

      //sapSystemAlias = defaultSAPSystemAlias;


      ILogger logger = PortalLog.getLogger(); user = componentRequest.getUser();

      Locale locale = componentRequest.getLocale();

      ConnectionProperties properties = new ConnectionProperties(locale, user);

      IConnection connection = null;

      try {

      IConnectorGatewayService connectorGatewayService = (IConnectorGatewayService) PortalRuntime


      connection = connectorGatewayService.getConnection(sapSystemAlias,


      } catch (Exception e) {

      logger.severe(e, "Exception while creating a connection.");


      return connection;


      It makes also sense to have a central method to close connections...

      public static boolean closeConnection(IConnection connection) {

      boolean succesful = false;

      if (connection != null) {

      try {


      succesful = true;

      } catch (ResourceException re) {


      "Connection to SAP could not be closed!");



      return succesful;


      and interactions...

      public static boolean closeInteraction(IInteraction interaction) {

      boolean success = false;

      if (interaction != null) {

      try {

      interaction.close(); // close interaction

      success = true;

      } catch (Exception e) {

      String message = "Exception closing interaction.";

      PortalLog.getLogger().severe(e, message);



      return success;




      Message was edited by: Kai