diff --git a/docs/components/sap/btp-integration.md b/docs/components/sap/btp-integration.md new file mode 100644 index 0000000000..5626a1acf0 --- /dev/null +++ b/docs/components/sap/btp-integration.md @@ -0,0 +1,15 @@ +--- +id: btp-integration +title: SAP BTP integration +description: "Learn about the Camunda SAP Business Technology Platform (BTP) integration, an artifact run on BTP." +--- + +The Camunda SAP Business Technology Platform (BTP) integration is an artifact run on BTP. This connects to Camunda 8 SaaS to provide: + +- A generic Fiori app for starting BPMN processes and displaying [Camunda Forms](/components/modeler/forms/camunda-forms-reference.md) in the Fiori design language. +- The select exposure of SAP BTP services to [BPMN tasks](/components/modeler/bpmn/bpmn.md) and vice versa. +- A generic endpoint to start BPMN processes with. + +:::note Important! +The SAP BTP integration is an alpha feature available upon request. Visit [https://camunda.com/contact](https://camunda.com/contact) to contact us. +::: diff --git a/docs/components/sap/camunda-sap-integration.md b/docs/components/sap/camunda-sap-integration.md new file mode 100644 index 0000000000..1c45ce3ac1 --- /dev/null +++ b/docs/components/sap/camunda-sap-integration.md @@ -0,0 +1,18 @@ +--- +id: sap-integration +title: SAP integration +description: "Camunda's SAP integration consists of several features that can be used independently of one another: SAP OData, RFC, and BTP." +--- + +Camunda's SAP integration consists of several features that can be used independently of one another: SAP OData, RFC, and BTP. + +- [SAP OData Connector](./odata-connector.md): Interact with a S/4HANA or ECC System via OData v2 + v4 APIs, directly from your BPMN model. +- [SAP RFC outbound Connector](./rfc-connector.md): Query BAPIs and remote-enabled function modules on SAP ECC systems. +- [SAP BTP integration](./btp-integration.md) + - Use [Tasklist's](/components/tasklist/introduction-to-tasklist.md) forms in the Fiori UI + - Operate SAP BTP services from [BPMN tasks](/components/modeler/bpmn/bpmn.md) + - Inbound proxy endpoint to start process instances of BPMN models, including custom variables + +These features run in the customer's [SAP BTP instance](https://www.sap.com/products/technology-platform.html). They do not require a proprietary Camunda setup, and instead re-use an existing infrastructure with minimal prerequisites. + +![SAP integration overview](./img/sap-integration-overview.png) diff --git a/docs/components/sap/img/btp-destination-rfc.png b/docs/components/sap/img/btp-destination-rfc.png new file mode 100644 index 0000000000..5c3e01daec Binary files /dev/null and b/docs/components/sap/img/btp-destination-rfc.png differ diff --git a/docs/components/sap/img/btp-destination.png b/docs/components/sap/img/btp-destination.png new file mode 100644 index 0000000000..0fcbf3d5a7 Binary files /dev/null and b/docs/components/sap/img/btp-destination.png differ diff --git a/docs/components/sap/img/odata-connector-error-expression.png b/docs/components/sap/img/odata-connector-error-expression.png new file mode 100644 index 0000000000..6a70eb55ed Binary files /dev/null and b/docs/components/sap/img/odata-connector-error-expression.png differ diff --git a/docs/components/sap/img/odata-steps.png b/docs/components/sap/img/odata-steps.png new file mode 100644 index 0000000000..d94742a26d Binary files /dev/null and b/docs/components/sap/img/odata-steps.png differ diff --git a/docs/components/sap/img/rfc-overview.png b/docs/components/sap/img/rfc-overview.png new file mode 100644 index 0000000000..919650ad49 Binary files /dev/null and b/docs/components/sap/img/rfc-overview.png differ diff --git a/docs/components/sap/img/sap-integration-overview.png b/docs/components/sap/img/sap-integration-overview.png new file mode 100644 index 0000000000..91b2356c10 Binary files /dev/null and b/docs/components/sap/img/sap-integration-overview.png differ diff --git a/docs/components/sap/img/sap-odata-connector-element-template-advanced.png b/docs/components/sap/img/sap-odata-connector-element-template-advanced.png new file mode 100644 index 0000000000..f62fe06fd1 Binary files /dev/null and b/docs/components/sap/img/sap-odata-connector-element-template-advanced.png differ diff --git a/docs/components/sap/img/sap-odata-connector-element-template-result.png b/docs/components/sap/img/sap-odata-connector-element-template-result.png new file mode 100644 index 0000000000..eb543c080b Binary files /dev/null and b/docs/components/sap/img/sap-odata-connector-element-template-result.png differ diff --git a/docs/components/sap/img/sap-odata-connector-element-template.png b/docs/components/sap/img/sap-odata-connector-element-template.png new file mode 100644 index 0000000000..8d06c4b645 Binary files /dev/null and b/docs/components/sap/img/sap-odata-connector-element-template.png differ diff --git a/docs/components/sap/img/sap-odata-connector-task-error-handling1.png b/docs/components/sap/img/sap-odata-connector-task-error-handling1.png new file mode 100644 index 0000000000..7c06848d52 Binary files /dev/null and b/docs/components/sap/img/sap-odata-connector-task-error-handling1.png differ diff --git a/docs/components/sap/img/sap-odata-connector-task-error-handling2.png b/docs/components/sap/img/sap-odata-connector-task-error-handling2.png new file mode 100644 index 0000000000..06c0b472f2 Binary files /dev/null and b/docs/components/sap/img/sap-odata-connector-task-error-handling2.png differ diff --git a/docs/components/sap/img/sap-odata-connector-task-in-model.png b/docs/components/sap/img/sap-odata-connector-task-in-model.png new file mode 100644 index 0000000000..b5ada529d1 Binary files /dev/null and b/docs/components/sap/img/sap-odata-connector-task-in-model.png differ diff --git a/docs/components/sap/img/sap-rfc-connector-element-template.png b/docs/components/sap/img/sap-rfc-connector-element-template.png new file mode 100644 index 0000000000..c3bfcef8fc Binary files /dev/null and b/docs/components/sap/img/sap-rfc-connector-element-template.png differ diff --git a/docs/components/sap/img/sap-rfc-connector-task-in-model.png b/docs/components/sap/img/sap-rfc-connector-task-in-model.png new file mode 100644 index 0000000000..42efdfa09d Binary files /dev/null and b/docs/components/sap/img/sap-rfc-connector-task-in-model.png differ diff --git a/docs/components/sap/odata-connector.md b/docs/components/sap/odata-connector.md new file mode 100644 index 0000000000..9e3863d4bb --- /dev/null +++ b/docs/components/sap/odata-connector.md @@ -0,0 +1,171 @@ +--- +id: odata-connector +title: SAP OData Connector +description: "The SAP OData Connector is a protocol and outbound Connector that runs as a Docker image on the SAP Business Technology Platform (BTP)." +--- + +The SAP OData Connector is a protocol and outbound [Connector](/components/connectors/introduction.md) that runs as a Docker image on the SAP Business Technology Platform (BTP). + +This Connector is designed to run in [hybrid mode](/guides/use-connectors-in-hybrid-mode.md), hosted in the customer's SAP BTP sub-account in the [Cloud Foundry environment](https://discovery-center.cloud.sap/serviceCatalog/cloud-foundry-runtime?region=all). + +This Connector works with Camunda 8 SaaS, and utilizes SAP BTP's [Destination](https://learning.sap.com/learning-journeys/administrating-sap-business-technology-platform/using-destinations) and [Connectivity](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/what-is-sap-btp-connectivity) concepts to query a SAP system via both OData v2 and v4. + +:::note Important! +This Connector is an alpha feature and available upon request. Visit [https://camunda.com/contact](https://camunda.com/contact) to contact us. +::: + +## Overview + +For a standard overview of the steps involved in the SAP OData Connector, see the following diagram: + +![OData steps](./img/odata-steps.png) + +## Prerequisites + +To run the SAP OData Connector Docker image, the following SAP infrastructure setup is required: + +- [Cloud Foundry CLI](https://github.com/cloudfoundry/cli) with [multiapps plugin](https://github.com/cloudfoundry/multiapps-cli-plugin) installed on the machine executing the deployment. +- SAP BTP subaccount with a [Cloud Foundry environment](https://discovery-center.cloud.sap/serviceCatalog/cloud-foundry-runtime?region=all) enabled and a [created space](https://help.sap.com/docs/btp/sap-business-technology-platform/create-spaces). +- Minimum of [1 GB storage quota and 2 GB runtime memory](https://help.sap.com/docs/btp/sap-business-technology-platform/managing-space-quota-plans). +- [Entitlements](https://help.sap.com/docs/btp/sap-business-technology-platform/managing-entitlements-and-quotas-using-cockpit) for: + - [Connectivity Service](https://discovery-center.cloud.sap/serviceCatalog/connectivity-service?region=all), `lite` plan (to connect to the SAP is on-premises). + - [Destination Service](https://discovery-center.cloud.sap/serviceCatalog/destination?service_plan=lite®ion=all&commercialModel=btpea), `lite` plan. +- One or more instance- or subaccount-level destinations, pointing to the SAP systems to communicate with. + ![sample BTP destination configuration](./img/btp-destination.png) +- Ensure `Additional Properties` are correctly set on the Destination. For example: + +```json +HTML5.DynamicDestination: true +sap-client: +WebIDEEnabled: true +WebIDESystem: +WebIDEUsage: odata_gen +``` + +:::warning +Currently, only `BasicAuthentication` is supported on the Destination by the SAP OData Connector. +::: + +## Deployment to BTP + +A descriptor file is required to deploy the SAP OData Connector to a space in a SAP BTP subaccount. An exemplary deployment descriptor `mtad.yaml.example` is provided by Camunda. This is a standard format in SAP BTP's Cloud Foundry environment to describe the application that needs deployment. Take the following steps: + +1. Adjust the values to match those of the targeted Camunda 8 SaaS environment and rename it to `mtad.yaml`. +2. Adjust the names of the SAP BTP Destination and Connectivity instances to your liking - both will be created automatically for you upon deployment. If instances in your subaccount of any of the two services exist, they will be reused. +3. After creating the `mtad.yaml` file, log into the desired SAP BTP subaccount via the [Cloud Foundry `cli`](https://github.com/cloudfoundry/cli) (cf-cli): + +```shell +$> cf login +API endpoint: https://api.cf. ... +... +``` + +4. Deploy the SAP OData Connector via the `cf-cli`. Note that this requires [the "multiapps" plugin of Cloud Foundry](https://github.com/cloudfoundry/multiapps-cli-plugin) to be installed on the machine the deployment runs on: + +```shell +$> cf deploy ./ # append the -f flag to shortcircuit ongoing deployments +Deploying multi-target app archive /Some/path/sap-odata-connector.mtar in org / space as you@example.org .. +... +Application "sap-odata-connector" started and available at "some.url.hana.ondemand.com" +``` + +## Deployment in Camunda 8 SaaS + +- If using Web Modeler, [import the SAP OData Connector's element template](/components/connectors/manage-connector-templates.md#importing-existing-connector-templates) for design use. + +![sample BPMN diagram with SAP OData connector](./img/sap-odata-connector-task-in-model.png) + +- If using Desktop Modeler, [follow the standard importing procedure](/components/modeler/desktop-modeler/element-templates/configuring-templates.md). + +## Working with the SAP OData Connector in Camunda Modeler + +### Modeling options + +To use the **SAP OData Connector** in your process, either change the type of existing task by clicking on it and using the **wrench-shaped** change type context menu icon, or create a new Connector task by using the **Append Connector** context menu. Follow our [guide to using Connectors](/components/connectors/use-connectors/index.md) to learn more. + +:::note +The configuration options will dynamically change with the selected HTTP method and the OData protocol version. For example, a `payload` field is only displayed when the HTTP method is something other than "GET". +::: + +![SAP OData connector element template](./img/sap-odata-connector-element-template.png) + +Specifying the `BTP destination name` allows you to reuse existing Destinations from the subaccount or instance level. Authentication and authorizations are maintained at this level, which is why it's not necessary to maintain credentials for the Connector. + +### Advanced capabilities + +In addition to the basic OData settings such as Service, Entity, EntitySet, Method, and OData version, the **Advanced** section allows you to fine tune `GET` queries to the SAP method with all standard parameters. + +For example, supplying `$filter` and `$select` parameters helps in reducing data transferred over the wire, while `$expand` helps in retrieving additional entities with a single query. + +![Advanced options of the SAP OData connector element template](./img/sap-odata-connector-element-template-advanced.png) + +### Query result structure + +The result of any query, whether it is reading or writing to the SAP system, is in JSON format in the following structure: + +```json +{ + result: , + statusCode: , + countOrInlineCount: +} +``` + +- `result` contains the result of the query, whether it is content retrieved from a SAP system via `GET` or the result of a write or update operation via `POST`, `PUT`, `PATCH`, or `DELETE`. (Note that with the latter, the `result` is always empty.) +- `statusCode` holds the [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) of the operation. +- `countOrInlineCount` is only present in the response when the corresponding option `$inlinecount` (for OData v2) or `$count` (for OData v4) was checked in the design time of the BPMN task. It then shows the number of results from the `GET` query to the SAP system. + +![the output mapping of the SAP OData element template](./img/sap-odata-connector-element-template-result.png) + +The query result can either be mapped to a single result variable or worked on [via FEEL with an expression](/components/connectors/use-connectors.md#result-expression). The same is applicable to `getResponse`, as a result variable contains the described query JSON in its entirety. The result expression `{getStatusCode: statusCode}` would only hold the HTTP status code in the `getStatusCode` process variable. + +### Error handling + +The SAP OData Connector allows handling of query errors directly in the model. This means an OData error is relayed to the process instance in the reserved variables `bpmnError` and `error` and can be processed accordingly. + +1. Equip the Connector task with an error handling expression such as: + +```js +if error.code = "400" then + bpmnError("400", "client request is bad", { errorMessage: error.message, errorCode: error.code }) +else if error.code = "404" then + bpmnError("404", "queried resource not found", { errorMessage: error.message, errorCode: error.code }) +else if error.code = "500" then + bpmnError("500", "server error", { errorMessage: error.message, errorCode: error.code }) +else if error.code = "503" then + bpmnError("503", "I'm just an proxy teapot", { errorMessage: error.message, errorCode: error.code }) +else + null +``` + +![image-20241010160419616](./img/odata-connector-error-expression.png) + +2. Specifically note the third parameter to `bpmnError`: + +```js +{ errorMessage: error.message, errorCode: error.code } +``` + +This relays the error message and code to the next step in the process flow. + +3. Equip the BPMN task with an error boundary event: + +![error boundary event on SAP OData connector](./img/sap-odata-connector-task-error-handling2.png) + +If the SAP OData Connector encounters an error, the boundary event will catch the error and continue the process flow. The error boundary event can receive these configuration parameters to contain further error details: + +![error output mapping](./img/sap-odata-connector-task-error-handling1.png) + +- `errorMessage`: Contains a verbose version of the error message and cause and relays it into the process scope as `ov_errorMessage`. +- `errorCode`: Holds a predefined value describing the scope of the error, relaying it to the process scope as `errorCode`. It can be one of the following: + - `INVALID_PAYLOAD`: The payload of the request was detected as erroneous by the server. + - `REQUEST_ERROR`: The request contained an error, for example, a wrong combination of `GET` query parameters. + - `GENERIC_ERROR` + - `DESTINATION_ERROR`: An error occurred while claiming the Destination from the runtime environment. +- `error`: The serialized Error object, available in the example above as `ov_error`. + +## Tips + +- Ensure the connection from the Cloud Foundry environment via the destination to the SAP systems works. Using the [Terminal in Business Application Studio](https://community.sap.com/t5/technology-blogs-by-sap/how-to-check-the-connectivity-to-your-backend-system-in-business/ba-p/13479832) is a quick way to verify this. +- Validate requests first in an API client before trying with the SAP OData Connector in Modeler. Then, copy over to the element template fields. This saves time and reduces potential error. +- Any payload size <= 2.5MB can be considered safe. diff --git a/docs/components/sap/rfc-connector.md b/docs/components/sap/rfc-connector.md new file mode 100644 index 0000000000..5d4ea9417f --- /dev/null +++ b/docs/components/sap/rfc-connector.md @@ -0,0 +1,271 @@ +--- +id: rfc-connector +title: SAP RFC Connector +description: "The SAP RFC Connector is a Java Spring Boot application that runs on SAP BTP." +--- + +The SAP RFC [Connector](/components/connectors/introduction.md) is a [protocol and outbound Connector](/components/connectors/connector-types.md). This Connector is a Java Spring Boot application that runs on SAP Business Technology Platform (BTP). + +It connects to Camunda 8 SaaS, and utilizes SAP BTP's [Destination](https://learning.sap.com/learning-journeys/administrating-sap-business-technology-platform/using-destinations) and [Connectivity](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/what-is-sap-btp-connectivity) concepts to query a SAP system via the RFC protocol to interact with remote-enabled Function Modules and BAPIs. + +:::note Important! +This Connector is an alpha feature available upon request. Visit [https://camunda.com/contact](https://camunda.com/contact) to contact us. +::: + +## Overview + +For a standard overview of the steps involved in the SAP RFC Connector, see the following diagram: + +![RFC overview](./img/rfc-overview.png) + +## Prerequisites + +To run the SAP RFC Connector Docker image, the following SAP infrastructure setup is required: + +- [Cloud Foundry CLI](https://github.com/cloudfoundry/cli) with the [multiapps plugin](https://github.com/cloudfoundry/multiapps-cli-plugin) installed on the machine executing the deployment. +- SAP BTP subaccount with a [Cloud Foundry environment](https://discovery-center.cloud.sap/serviceCatalog/cloud-foundry-runtime?region=all) enabled and a [created space](https://help.sap.com/docs/btp/sap-business-technology-platform/create-spaces). +- A minimum of [1 GB storage quota and 2 GB runtime memory](https://help.sap.com/docs/btp/sap-business-technology-platform/managing-space-quota-plans). +- [Entitlements](https://help.sap.com/docs/btp/sap-business-technology-platform/managing-entitlements-and-quotas-using-cockpit) for: + - [Connectivity Service](https://discovery-center.cloud.sap/serviceCatalog/connectivity-service?region=all), `lite` plan (to connect to the SAP is on-premises). + - [Destination Service](https://discovery-center.cloud.sap/serviceCatalog/destination?service_plan=lite®ion=all&commercialModel=btpea), `lite` plan. + - [Authorization and Trust Management Service](https://discovery-center.cloud.sap/serviceCatalog/authorization-and-trust-management-service?region=all), `application` plan. +- One or more instance- or subaccount-level Destinations, pointing to the SAP systems to communicate with. + ![btp-destination-rfc](./img/btp-destination-rfc.png) +- Ensure `Additional Properties` set on the Destination are aligned with those of your Connector or remote SAP system. + +## Deployment to BTP + +Unlike other Camunda Connectors, the SAP RFC Connector must be deployed as a Java application. This is because it uses SAP's [JCo Java library](https://support.sap.com/en/product/connectors/jco.html) to connect via RFC to the configured SAP system. You must build the application yourself as the JCo library's license prohibits redistribution, so Camunda cannot pre-build it for you. + +### Building the Java application + +1. In the application folder, navigate to `src/main/resources/application.properties` and insert the credentials for the cluster the SAP RFC Connector should connect to: + +```properties +zeebe.client.cloud.region=xxx +zeebe.client.cloud.clusterId=guid +zeebe.client.cloud.clientId=yyy +zeebe.client.cloud.clientSecret=zzz +camunda.connector.polling.enabled=false +``` + +2. Copy the deployment descriptor `mta.yaml.example` to `mta.yaml` and enter the same credentials in the `modules.properties` scope: + +```yaml +_schema-version: 3.3.0 +ID: sap-rfc-connector +# ... +modules: + - name: sap-rfc-connector + # ... + properties: + ZEEBE_CLIENT_CLOUD_CLUSTERID: 'guid' + ZEEBE_CLIENT_CLOUD_CLIENTID: 'xxx' + ZEEBE_CLIENT_CLOUD_CLIENT_SECRET: 'yyy' + ZEEBE_CLIENT_CLOUD_REGION: 'zzz' +``` + +3. Adjust any property describing an infrastructure setting to your requirements. For example, if a pre-existing destination instance is to be used, adjust the respective resource name. Otherwise, the deployment will create any of the services listed in `resources` for you. +4. Build the deployable archive via `$> mbt build`. + +### Deploying the Java application + +1. Log in to the desired SAP BTP subaccount via the [Cloud Foundry `cli`](https://github.com/cloudfoundry/cli) (cf-cli): + +```shell +$> cf login +API endpoint: https://api.cf. ... +... +``` + +2. Deploy the SAP RFC Connector via the `cf-cli`. Note that this requires [the "multiapps" plugin of Cloud Foundry](https://github.com/cloudfoundry/multiapps-cli-plugin) to be installed on the machine the deployment runs on. + +```shell +$> cf deploy mta_archives/*.mtar # append the -f flag to shortcircuit ongoing deployments +Deploying multi-target app archive .mtar in org / space as you@example.org .. +... +Application "sap-rfc-connector" started and available at "some.url.hana.ondemand.com" +``` + +### Deployment in Camunda 8 SaaS + +- If using Web Modeler, [import the SAP RFC Connector's element template](/components/connectors/manage-connector-templates.md#importing-existing-connector-templates) contained in the repository in `element-templates/sap-rfc-connector.json` for design use. + +![sap-rfc-connector-task-in-model](./img/sap-rfc-connector-task-in-model.png) + +- If using Desktop Modeler, [follow the standard importing procedure](/components/modeler/desktop-modeler/element-templates/configuring-templates.md). + +## Working with the SAP RFC Connector in Camunda Modeler + +### Modeling options + +To use the **SAP RFC Connector** in your process, either change the type of existing task by clicking on it and using the **wrench-shaped** change type context menu icon, or create a new Connector task by using the **Append Connector** context menu. Follow our [guide to using Connectors](/components/connectors/use-connectors/index.md) to learn more. + +![sap-rfc-connector-task-in-model](./img/sap-rfc-connector-element-template.png) + +First, choose whether to call a `BAPI` or a Function Module (`FM`). + +Then, provide the `exporting`-, `importing-`, and `tables` parameters as lists of objects. + +All object entries in the list look similar to `[{name:"param", type:"type"}]`, pointing to the parameter name of the BAPI/FM and its type. For example, `[{name:"PERSON_IN_CHARGE_FROM", type:"BAPI0012_GEN-PERS_IN_CHRG"}]`. + +For those with experience in `ABAP`, the configuration options are similar. + +### Sending variables to the RFC target + +The `exporting parameter` is sent to the RFC target. The object structure generally looks like `[{name: "param", type: "type", value: }]`. + +Example: + +```json +[ + { + "name": "CONTROLLINGAREA", + "type": "BAPI0012_GEN-CO_AREA", + "value": "1000" + } +] +``` + +This corresponds with the BAPI's/FM's `importing` definition, meaning it imports these variables from the RFC call: + +```ABAP +*" IMPORTING <-- this is the BAPI/FM - don't be confused! In Camunda, this is "exporting" :) +*" VALUE(CONTROLLINGAREA) LIKE BAPI0012_GEN-CO_AREA +``` + +### Receiving variables from the RFC target + +`Importing parameter` is what is expected back from the RFC target. They are configured in the same "list of objects" style pattern in the element template as the other parameters and generally look like `[{name: "param", type: "type"}]`. + +Example: + +```json +[ + { + "name": "DETAIL_DATA", + "type": " BAPI1079_DETAIL" + } +] +``` + +This corresponds with the BAPI's/FM's `exporting` definition, meaning it exports these variables to the caller: + +```ABAP +*" EXPORTING +*" VALUE(DETAIL_DATA) LIKE BAPI1079_DETAIL +``` + +### Special cases: sending and/or receiving a "table" and a "changing" structure + +#### tables + +The `tables parameter` can be both "exporting" and "importing". + +:::warning +Sending tables as tabular data to an RFC target is not yet supported. +::: + +```json +{ + "name": "COSTCENTERLIST", + "type": "BAPI0012_CCLIST" +} +``` + +The above example is an object parameter in the `tables parameter` section that describes a result table to be received back from the RFC call. In conforms with the BAPI `BAPI_COSTCENTER_GETLIST1` parameter definition on the SAP system: + +```ABAP +*" TABLES +*" COSTCENTERLIST STRUCTURE BAPI0012_CCLIST +``` + +The same is applicable for the return structure `BAPIRET2` that denotes the result status of the RFC call: + +```json +{ + "name": "BAPIRET2", + "isReturn": true +} +``` + +This aligns with the BAPI definition: + +```ABAP +*" TABLES +*" .... +*" RETURN STRUCTURE BAPIRET2 +``` + +#### changing + +A `changing parameter` is a variable received by an RFC target that is processed, changed, and returned. It is only available for `FM`-type RFC targets in the SAP RFC Connector. The overall structure is `[{name: "param", type: "type", value: }]`. + +Example: + +```json +[ + { + "name": "CV_RESULT", + "type": "I", + "value": "100" + } +] +``` + +The value `100` is sent to the Fuction Module and sent back as `CV_RESULT`. + +## Query result structure + +### BAPI + +The result of a call to a BAPI holds the following JSON structure: + +```json +{ + tables: [ + { ... } + ], + importing: { + { ... } + } +] +``` + +`tables` holds a representation of the result tables configured. + +`importing` is the result of what was sent to the BAPI in the `exporting` section above. + +### Function Module + +The result of a call to a Function Module holds the following JSON structure: + +```json +{ + tables: [ + { ... } + ], + importing: [ + { ... } + ], + changing: [ + { ... } + ] +] +``` + +- `tables` holds a representation of the result tables configured. +- `importing` is the result of what was sent to the Function Module in the `exporting` section above. +- `changing` is the result of what was sent to the Function Module in the `changing` section above. + +## Error handling + +The SAP RFC Connector allows handling of query errors directly in the model. This means an RFC error is relayed to the process instance in the reserved variables `bpmnError` and `error` and can be processed accordingly: + +``` +DESTINATION_ERROR, +REQUEST_EXECUTION_ERROR, +REQUEST_SERIALIZATION_ERROR, +JCO_RUNTIME_ERROR, +GENERIC_ERROR +```