SAP

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

SAP enables SAP connection (RFC only) for requirements dispatch.

Parameters

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

Pay attention to the maximum file size for each deploy type in a pipeline with the SAP component only. Note that these values can change if the pipeline contains other components: Small: 10 MB

Medium: 28 MB

Large: 67 MB

Use recommendation

We recommend you to set Globals for the SAP environment, as shown below:

  • Globals:

  • environment = SAP environment

See the examples of the items listed, that must be replaced according to your need:

  • [rfc] = RFC name

  • [table] = Table related to RFC

  • [columns] = Table columns

Read the article for more information about connectivity related to SAP.

Component structure for RFC connections

For RFC connections, use the "SAP Json to RFC" capsule before the SAP component. That way, the call is transformed in the format expected by SAP. This is an example of RFC call syntax inside SAP:

Function call (RFC) BAPI_BUPA_ADDRESS_GETDETAIL inside JSON Generator component

{
  "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") }} 
    } 
  } 
}

For a RFC call, it's important to pay attention to the following points:

  • Always inform Sid - field Enviroment/SystemName/System Id previously mentioned.

  • RFC field - can be in the JSON file, as well as informed inside the component.

  • ImportParameters - function call inside SAP. Be specific only with the fields that must be filled out in the call.

About SAP Intermediate Document (IDOC)

  • IDOC Type: has a specific structure, that put into sequence the data transfered from one system to another.

  • IDOC TYPE EXTENSION (optional): specifies the IDOC extension, if it exists, of an IDOC produced by this endpoint.

  • SYSTEM RELEASE (optional): specifies the SAP Basis Release associated, if it exists, to an IDOC produced by this endpoint.

  • APPLICATION RELEASE (optional): specifies the Application Release associated, if it exists, to an IDOC produced by this endpoint.

Keep in mind that IDOCs are processed asynchronously via SAP. When an IDOC is sent, it does not indicate whether it was successful or not. In case of failure, the user must process the IDOC again.

Component structure for the use of the Template XML field

See an example of template (XML):

<?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="fred@bedrock.com"
              CUSTTYPE="P" 
              DISCOUNT="005" 
              LANGU="E"/> 
        </segmentChildren> 
      </E1SCU_CRE> 
    </segmentChildren> 
  </rootSegment> 
</idoc:Document>  

{YOUR_ENVIRONMENT} must be replaced by your SAP SID.

If it's a single query, you can use the following syntax:

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="" /> 

If it's a table query, use this syntax:

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 a tag "body"

For the variable sapRequestTemplate, it's important to pay attention to these points:

  • the variable name can have the following signs: minus (-), period (.) and colon (:) in any position. But these characters need to be escaped with backslash (\). Otherwise, they'll be interpreted as operators.

  • it might be more convenient to use variables and conversion functions:

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

Output

42
42
42
$42.00
4,200%
42

Messages flow

Input

The component expects a message under any format. However, it will look for a path inside the "modelPath" configuration property.

Output

The output message will be the same as the input message, but replacing the model property according to the template definition (as a string). If there's an error, the "property_error" property will be created on the same level of the original property.

Last updated