Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of ballerinax/sap.jco module #6650

Closed
niveathika opened this issue Jun 21, 2024 · 3 comments
Closed

Implementation of ballerinax/sap.jco module #6650

niveathika opened this issue Jun 21, 2024 · 3 comments
Assignees
Labels
module/sap.jco Issues related to Ballerina SAPJCo module module/sap Type/NewFeature

Comments

@niveathika
Copy link
Contributor

Description:
$subject

To be based on initial research #6649

@RDPerera
Copy link
Member

RDPerera commented Jul 19, 2024

Improvements for Ballerina SAP JCo Connector

We have identified several areas for improvement in the Ballerina SAP JCo connector :

  • Writing a Specification: Develop a detailed specification for the SAP JCo connector to ensure comprehensive documentation and clearer guidelines for contributors.

  • Support for Additional Parameter Types: Extend the connector to support more parameter types in import and export.

    Currently, under version 0.1.0, we have decided to support only the basic data types string, int, float, decimal as input parameter types. In future versions, we plan to implement support for more complex data types, including char[], Date, long, double, byte[], BigInteger, JCoTable, JCoAbapObject, and other object types to enhance the versatility and functionality of our system.

  • Writing Tests: Create and implement robust test cases to ensure the connector functions as expected across various scenarios.

  • Compiler Plugin for Listener: Develop a compiler plugin to enhance the listener validation, to validate attaching multiple services to a listener and service types validation.

  • Handling Transaction for RFC Develop transaction support for RFC remote module execution.

@RDPerera RDPerera added the module/sap.jco Issues related to Ballerina SAPJCo module label Jul 24, 2024
@RDPerera
Copy link
Member

How Does the SAP JCo Listener Work?

The first step is to set up a JCo server in Java application. This server acts as a listener for incoming IDocs. Configure the server with necessary details like the program ID, gateway host, gateway service, and the SAP system that will send the IDocs.

diagram (5)

Program ID: The SAP system uses the Program ID to identify the JCo server. This ID must be unique and configured in the SAP system's RFC destination settings.

RFC Destination: In the SAP system, an RFC destination is created that points to the JCo server using the Program ID. This RFC destination is used by SAP to send the IDocs to the JCo server. This is different from jco.client.repository_destination, which is used by the SAP JCo program to make RFC requests to the SAP system. In this case, the SAP system registers the JCo Server as the repository destination.

Implementing IDoc Listener:

IDoc Server Factory: SAP JCo provides an IDocServerFactory that allows the creation of an IDoc server instance. This server listens for incoming IDocs.

IDoc Handler Implementation: You need to define the method handleRequest(IDocDocumentList idocDocumentList). This method is invoked when an IDoc is received, allowing you to process the IDoc within it. In our case, the IDoc is converted to XML.

Starting the JCo Server: Once the configuration is complete and the IDoc handler is implemented, the JCo server can be started.

The SAP system may expect an acknowledgment after an IDoc is successfully processed. This acknowledgment can be sent back to the SAP system using the JCo server.

@RDPerera
Copy link
Member

RDPerera commented Sep 6, 2024

The 1.0.0 version of the connecter was released after testing its RFC and iDoc functions with the real system.

Closing since all mandatory requirements of the connector were fulfilled. Identified further improvements are tracked under this issue: #6973 .

@RDPerera RDPerera closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/sap.jco Issues related to Ballerina SAPJCo module module/sap Type/NewFeature
Projects
Archived in project
Development

No branches or pull requests

2 participants