SAP (IDoc and RFC)

Discover more about the SAP connector and how to use it on the Digibee Integration Platform.

The SAP connector allows integration with SAP systems by using the RFC protocol and the IDoc standard for data exchange.

Parameters

Take a look at the configuration options for the connector. Parameters supported by Double Braces expressions are marked with (DB).

Authorization tab

Parameter
Description
Default value
Data type

Use Dynamic Account

When active, the connector will use the account dynamically. Otherwise, it will use the account statically. Learn more about Dynamic Accounts.

False

Boolean

Scoped

When active, the stored account is isolated from other subprocesses. In this case, the subprocesses see their own version of the stored account data. It is only available if the Use Dynamic Account parameter is enabled.

False

Boolean

Account Name (DB)

The name of the dynamic account used by the connector. This account must have been previously configured in a Store Account connector in the pipeline for this process to take effect. It is only available if the Use Dynamic Account parameter is enabled.

N/A

String

Account

The account used by the connector. Supported type: Basic (user and password). It is only available if the Use Dynamic Account parameter is disabled.

N/A

Account

Host (DB)

Hostname of the SAP system. To support "IP" and "Port", VPN connectivity is required (you can configure VPN via SAP GUI). To resolve the hostname to an IP address, you must add a mapping entry to the host file on the machine where the agent is installed.

N/A

String

Client ID (DB)

SAP client ID, typically a 3-digit number used to connect to SAP.

400

String

System Number (DB)

SAP system number, typically 2 digits. You can find this information in the SAP GUI.

01

Integer

Language (DB)

Language used for the SAP system connection (for example, "EN" for English).

en

String

General tab

Parameter
Description
Default value
Data type

Alias

Name (alias) for this connector’s output, allowing you to reference it later in the flow using Double Braces expressions. Learn more.

sap-1

String

SAP Operation

SAP system connection type. Supported options: RFC or IDoc.

RFC

String

Parameter
Description
Default value
Data type

RFC (DB)

Name of the RFC used to connect to the SAP system. This value is provided by the client. The import parameters of the SAP function must be mapped.

YYPCL_RFC_ORDEM_FATURA

String

Search Template

Button that automatically populates the Template (XML) parameter with an RFC template when all authorization details and the RFC name are valid.

N/A

Button

Send as File

When enabled, a file can be defined and sent.

False

Boolean

File Name (DB)

File that contains the body to be sent to the SAP server. Use this option when the payload is too large for the Template field. It's recommended to use other connectors like Template Transformer and File Writer to generate the file content.

N/A

String

Template (XML) (DB)

Defines the Apache FreeMarker template for the SOAP message sent in the request. For RFC calls, a template is generated through the Search Template button when authorization details and the RFC name are valid.

N/A

String

Fail On Error

If enabled, interrupts the pipeline execution when an error occurs. If disabled, execution continues, but the "success" property will be set to false.

False

Boolean

Documentation tab

Parameter
Description
Default value
Data type

Documentation

Optional field to describe the connector configuration and any relevant business rules.

N/A

String

SAP connector – Usage guide

File size limits

When using the SAP connector, note the maximum file size per deployment type. These limits apply when the connector is used independently. If other connectors are present in the pipeline, sizes may vary:

  • Small: 10 MB

  • Medium: 28 MB

  • Large: 67 MB

Global variable configuration

To simplify dynamic configuration and promote reusability, it’s recommended to define Global variables in your pipeline.

Required Globals

Variable
Description

environment

SAP environment

Optional Globals for Templates

Variable
Description

[rfc]

RFC function name

[table]

Table related to the RFC call

[columns]

Table columns used in the request

For more details, see the SAP connectivity guide.

RFC integration

JSON input example

For RFC connections, include the "SAP JSON to RFC" capsule before the SAP connector. This ensures the input is properly formatted for the SAP system.

Example of an RFC call in a JSON Generator connector:

{
  "sid": "{{sap-test-sid}}", 
  "rfc": "BAPI_BUPA_ADDRESS_GETDETAIL", 
  "importParameters": { 
    "attributes": { 
      "BUSINESSPARTNER": {{ message.BUSINESSPARTNER }}, 
      "VALID_DATE": {{FORMATDATE(NOW(), "timestamp", "yyyy-MM-dd", null , "GMT-3") }} 
    } 
  }
}

Best practices

  • Always specify the sid (Environment/System Name/System ID).

  • The rfc function can be set in the JSON payload or directly in the connector.

  • Define importParameters with only the necessary fields for the function call.

Template (XML) configuration

The Template (XML) field allows automatic generation for RFCs and also supports manual customization of both RFC and IDoc structures.

Automatic RFC template generation

When an RFC function is selected, the Search Template button becomes available. If the authorization details are correct and the RFC name is valid, clicking it automatically fills the Template (XML) field with a template that only requires you to replace the values.

Example of generated template:

<BBP_RFC_READ_TABLE:Request xmlns:BBP_RFC_READ_TABLE="http://sap.fusesource.org/rfc/EC1/BBP_RFC_READ_TABLE">
    <DELIMITER>${body.DELIMITER}</DELIMITER>
    <NO_DATA>${body.NO_DATA}</NO_DATA>
    <QUERY_TABLE>${body.QUERY_TABLE}</QUERY_TABLE>
    <ROWCOUNT>${body.ROWCOUNT?c}</ROWCOUNT>
    <ROWSKIPS>${body.ROWSKIPS?c}</ROWSKIPS>
    <FIELDS>
        <#if body.FIELDS??>
            <#list body.FIELDS as item>
            <row>
                <FIELDNAME>${item.FIELDNAME}</FIELDNAME>
                <OFFSET>${item.OFFSET}</OFFSET>
                <LENGTH>${item.LENGTH}</LENGTH>
                <TYPE>${item.TYPE}</TYPE>
                <FIELDTEXT>${item.FIELDTEXT}</FIELDTEXT>
            </row>
            </#list>
        </#if>
    </FIELDS>
    <OPTIONS>
        <#if body.OPTIONS??>
            <#list body.OPTIONS as item>
            <row>
                <TEXT>${item.TEXT}</TEXT>
            </row>
            </#list>
        </#if>
    </OPTIONS>
</BBP_RFC_READ_TABLE:Request>

Manual template examples

IDoc template example

<?xml version="1.0" encoding="ASCII"?> 
<idoc:Document 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:FLCUSTOMER_CREATEFROMDATA01---="http://sap.fusesource.org/idoc/{_YOUR_ENVIRONMENT_}/FLCUSTOMER_CREATEFROMDATA01///" 
    xmlns:idoc="http://sap.fusesource.org/idoc" 
    creationDate="2015-01-28T12:39:13.980-0500" 
    creationTime="2015-01-28T12:39:13.980-0500" 
    iDocType="FLCUSTOMER_CREATEFROMDATA01" 
    iDocTypeExtension="" 
    messageType="FLCUSTOMER_CREATEFROMDATA" 
    recipientPartnerNumber="QUICKCLNT" 
    recipientPartnerType="LS" 
    senderPartnerNumber="QUICKSTART" 
    senderPartnerType="LS"> 
  <rootSegment xsi:type="FLCUSTOMER_CREATEFROMDATA01---:ROOT" document="/">
    <segmentChildren parent="//@rootSegment"> 
      <E1SCU_CRE parent="//@rootSegment" document="/"> 
        <segmentChildren parent="//@rootSegment/@segmentChildren/@E1SCU_CRE.0"> 
          <E1BPSCUNEW parent="//@rootSegment/@segmentChildren/@E1SCU_CRE.0" 
              document="/" 
              CUSTNAME="Fred Flintstone" FORM="Mr." 
              STREET="123 Rubble Lane" 
              POSTCODE="01234" 
              CITY="Bedrock" 
              COUNTR="US" 
              PHONE="800-555-1212" 
              EMAIL="[email protected]"
              CUSTTYPE="P" 
              DISCOUNT="005" 
              LANGU="E"/> 
        </segmentChildren> 
      </E1SCU_CRE> 
    </segmentChildren> 
  </rootSegment> 
</idoc:Document>  

RFC – Single Query

Elementary Fields/Import Parameters:

<?xml version="1.0" encoding="ASCII"?> 
<[rfc]:Request xmlns:[rfc]="http://sap.fusesource.org/rfc/{{global.environment}}/[rfc]" 
  [columns]="20180801" 
  [columns]="20180806" 
  [columns]="050" />

Example:

<?xml version="1.0" encoding="ASCII"?> 
<ABCD_RFC_ORDEM_FATURA:Request 
    xmlns:ABCD_RFC_ORDEM_FATURA="http://sap.fusesource.org/rfc/QAS/ABCD_RFC_ORDEM_FATURA" 
    P_ERDAT_INI="2018-07-01T00:00:00.000" 
    P_ERDAT_FIM="2018-08-01T00:00:00.000" 
    CLIENTE="" 
    VKORG="0010" 
    AUART="" /> 

RFC – Table Query

Table fields:

<?xml version="1.0" encoding="ASCII"?> 
<[rfc]:Request ">xmlns:[rfc]="http://sap.fusesource.org/rfc/{{global.environment}}/[rfc]"> 
 <[table]> 
  <row> 
   <[columns]>${VBELN}</[columns]> 
   <[columns]>${ABDC}</[columns]> 
  </row> 
 </[table]> 
</[rfc]:Request> 

Example:

<?xml version="1.0" encoding="ASCII"?> 
<ABCD_RFC_MATERIAIS:Request ">xmlns:ABCD_RFC_MATERIAIS:Request="http://sap.fusesource.org/rfc/{{global.environment}}/ABCD_RFC_MATERIAIS:Request"> 
 <T_TIPO> 
  <row> 
   <MTART>${type}</MTART> 
  </row> 
 </T_TIPO> 
</ABCD_RFC_MATERIAIS:Request>

Input

{  
    "body":{     
        "type": "S"   
    } 
}
  • ${type}: Variable that must be provided inside the body tag.

Template variables and escaping

When using variables like sapRequestTemplate, keep in mind:

  • Special characters (such as -, ., :) in variable names must be escaped with a backslash (\).

  • Use Apache FreeMarker functions for formatting and conversion:

<#assign x=42>
${x}
${x?string} <#-- the same as ${x} -->
${x?string.number}
${x?string.currency}
${x?string.percent}
${x?string.computer}

Outputs:

42
42
42
$42.00
4,200%
42

Message flow

Input

The connector accepts input in any format but looks for a specific path based on the modelPath configuration.

Output

  • The output mirrors the input but replaces the defined model property with the rendered XML string (from the Template).

  • On error, the property property_error is added at the same level as the original model.

Last updated

Was this helpful?