SAP IDoc Write

On this Page

Snap type:Write
Description:

This Snap writes an SAP IDoc to the configured SAP server. Because IDocs are processed asynchronously on the server, Polling interval and Polling timeout are additional configurations that define how to get the processing status.
 

Expected upstream Snaps: The Control record fields of the IDoc Write Snap input view can be mapped using an upstream Mapper Snap.

Expected downstream Snaps: The Snap will output one document for every IDoc write operation, hence any document processing Snap can be used down stream.

Expected input: Document that conforms to the input view schema of the Snap. The input view schema is provided to an upstream Mapper Snap based on the selected service object.

Expected output: Document which represents the record structure of the retrieved IDoc record output definition. Each IDoc write record is represented as one document on the output view.

  • The Processing Type attribute in SAP needs to be set to Remote-Enabled Module for this Snap to work with an SAP Normal Function Module.
  • Before this Snap, you would need to map data to the control_record as defined by SAP IDoc processing. This is done by mapping data to the input view by using either a Mapper or Structure Snap. The Control Record schema is provided. The values to map are dependent on the use case.
  • The Snap records logs of JCoDestination's connection pool's status, the logs can be seen in Dashboard.
Prerequisites:

To make the IDoc Listener snap work with SAP, we have to configure the RFC destination in SAP to use Unicode to communicate with the target system.

The way to set this up, is through the SM59 transaction in SAP. choose the RFC destination being used. In the Unicode tab, set Communication Type with Target System as Unicode.

Support and limitations:Works in Ultra Tasks.
Account:

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring SAP Accounts for information on setting up this type of account.

Views:
InputThe Snap has exactly one input view and consumes documents. The input view must provide the Control record information.
OutputThe Snap has exactly one output view and produces documents in the view. Each successful IDoc write will result in one output record on the output view.
ErrorThe Snap has an error output view  and produces Document(s) in the view. Any status that is not defined in the success codes property of the Snap will trigger to write the result to the error view.

Settings

Label*

Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.

IDOC*


Specify the SAP IDoc type to write.

Default Value: N/A
ExampleMATMAS01

IDOC Extension type

Specify the IDoc Extension Write type of an associated IDOC type.

If the IDoc specified in the "IDOC" Setting needs to be written with a specified custom extension type, provide a valid extension type in addition to the valid IDOC type with which the custom type is associated.

The Snap displays an error in the following cases:

  1. The custom extension type is invalid
  2. The specified IDOC extension type and the IDOC type are valid; however, the two types do not have any association with each other

Default Value: N/A
Example: ZMATMAS01

Success codes*


Specify the comma-separated status codes (with a leading 0) that are considered to be successful for the Snap execution.

Default value: 01,03,06,08,10,11,13,14,16,18,22,24,30,32,33,,35,38,39,41,50,53,55,62,64,66,69,70,71,73,75
Example: 01,03

See the SAP IDoc documentation for status codes for more information.
Polling interval

Specify the polling interval in seconds for obtaining the IDoc processing status. At each polling interval, the Snap checks the status of the IDoc processing.  A value of 0 indicates no polling for the IDoc processing status.

Default Value: 5
Example: 5

Maximum: 60


Polling timeout

Specify the polling timeout in seconds for obtaining the IDoc processing status.  If the timeout occurs while waiting for the status, the Snap displays a SnapExecutionException.

Default Value: 300
Example: 300

Maximum: 1800

IDoc Read BAPI Name

Specify a name for IDOC Read BAPI Name. This field is based on the “IDOC_READ_COMPLETELY” SAP function, which reads the details associated with an IDoc.

Default Value: Z_SNAP_IDOC_READ_COMPLETELY

Max request attempts


Specify the maximum number of SAP connection attempts in case of a failure.

When you enter 0, the Snap makes infinite connection attempts. 

Default Value: 3

Request retry interval

Specify the time in seconds to wait before retrying the request.

Default Value: 5
Route errors

Select this checkbox to write configuration errors to the error view. If the error is non-recoverable, especially connection errors such as exception handling would be routed to the error view with relevant information.

Default Value: Not selected

Reload IDoc Metadata

Select this checkbox to reload the metadata (latest schema) for the current BAPI function before executing the BAPI function.

Loading of metadata may take a while depending on the network speed.

Snap execution


Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.
  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Examples


We will provide one example that executes an SAP IDoc write operation for a given input.

First we provide the input to the SAP IDoc Write Snap, as defined below.


The SAP IDoc Write Snap is configured as:



Which results in:

Downloads

Important steps to successfully reuse Pipelines

  1. Download and import the pipeline into the SnapLogic application.
  2. Configure Snap accounts as applicable.
  3. Provide pipeline parameters as applicable.

  File Modified

File Example_SAP_IDoc_Write.slp

Mar 10, 2022 by Subhajit Sengupta


 Click to view/expand
Release Snap Pack VersionDateType  Updates
November 2024439patches29181 Latest

Enhanced the SAP Execute Snap with the Round to SAP decimal checkbox that enables the Snap to round the decimal value to match the number of Decimal Places defined in the SAP target field. This property only applies to the SAP packed decimal fields, which store data in the BCD (Binary Coded Decimal) format.

November 2024main29029 StableUpdated and certified against the current SnapLogic Platform release.
August 2024438patches28277 Latest

Fixed the SAP IDoc Listener and SAP IDoc Document Listener Snaps as below:

  • The Snaps now interrupt the Snap thread if the JCo server stops.

  • If you attempt to open and modify the Ultra pipeline with the SAP iDoc Listener Snaps in the Designer, the pipeline restarts (the existing Ultra pipeline stops).

August 2024438patches27908 Latest

Fixed an issue with SAP IDoc Listener and SAP IDoc Document Listener Snaps that displayed a Null Pointer Exception if you select the Route errors checkbox (which routes the error to the error view) in the Snaps.

August 2024main27765 Stable

Upgraded the following libraries for the SAP Snap Pack. Learn more about the library upgrade.

  • JCo from 3.1.4 to 3.1.10

  • IDoc from 3.1.1 to 3.1.3

Refer to the Known Issue caused by this upgrade and follow the steps from the workaround to mitigate any pipeline failures.

May 2024

main26341

 

Stable

Updated and certified against the current SnapLogic Platform release.

February 2024main25112 StableUpdated and certified against the current SnapLogic Platform release.
November 2023435patches24068 Latest
  • Enhanced the SAP IDoc Listener and SAP IDoc Document Listener Snaps with a new Halt on SAP error checkbox for better error-handling capability. Select this checkbox to enable the listener to interrupt and halt processing in case of an error from SAP.

  • Removed the unnecessary spring-core dependency from the SAP Snap Pack.

November 2023main23721 StableUpdated and certified against the current SnapLogic Platform release.
August 2023main22460 StableUpdated and certified against the current SnapLogic Platform release.
May 2023

433patches22386

 Latest

Fixed an issue with the SnapLogic SAP Accounts that caused issues when connection pools were exhausted. The minimum value allowed for the Connection pool capacity is now 0 so you can disable the connection pooling.

May 2023

main21015 

Stable

Upgraded with the latest SnapLogic Platform release.

February 2023main19844 StableUpgraded with the latest SnapLogic Platform release.
November 2022431patches19026 Latest

The SAP IDoc Listener Snap now handles the data event from the SAP instance as expected.

November 2022main18944 StableUpgraded with the latest SnapLogic Platform release.
October 2022430patches18854 Latest

The SAP IDoc Read and SAP IDoc Write Snaps do not display the error messages when the IDoc Read BAPI Name field is empty or wrong as a default value IDOC_READ_COMPLETELY is now assigned to the empty field, otherwise, the Snap considers the specified name.

4.30 Patch430patches17344

 

Latest

The SAP Execute Snap is now equipped to send the actual content of the incoming byte arrays (in binary types like XString) instead of their transformed String values.

August 2022main17386 StableUpgraded with the latest SnapLogic Platform release.
4.29 Patch429patches16637 Latest
  • Fixed an issue with the SAP IDoc Write Snap where the Snap wrote the same TID, Document_number, and so on for the different output documents though the I_DOCNUM array contained all the document numbers that are returned from SAP table. Now, the Snap writes different TID, Document_number for different output documents along with the I_DOCNUM array that contains all the document numbers.
  • Fixed an issue with SAP Execute and SAP IDoc Write Snaps where the output preview did not include the original document.
4.29 Patch

429patches16113

 Latest

Fixed an issue with SAP Execute Snap where the Snap incorrectly handled connection exceptions for 104-JCO_ERROR_SYSTEM_FAILURE. Previously, the Snap captured only the output document without the error. Now, the Snap correctly captures both the output and error.

4.29main15993 StableUpgraded with the latest SnapLogic Platform release.
4.29main15993 StableUpgraded with the latest SnapLogic Platform release.
4.28main14627 Stable
  • Upgraded the Java Native Library used by the SAP Java Connector (JCo) to version 3.1.

    Breaking change for Pipelines containing Snaps from the SAP Snap Pack with Java Native Library

    This upgrade may cause your existing Pipelines to break if they contain Snaps from the SAP Snap Pack. You must manually upgrade your SAP Java Connector (JCo) Native Library to version 3.1.4 for these Pipelines to run successfully. See SAP Configurations for more information.

4.27 Patch427patches13992 Latest
  • Enhanced the SAP Execute Snap to support nested tables or structure data in the import parameters.
  • Upgraded the Java Native Library used by the SAP Java Connector (JCo) to 3.1.4 version.

4.27 Patch427patches12999 Latest

Enhanced SAP RFC ListenerSAP IDoc Listener and SAP IDoc Document Listener Snaps with a new field set Advanced JCo Server Properties that allows you to configure Java Connector (JCo) server-related attributes.

4.27

main12833

 

Stable

Upgraded with the latest SnapLogic Platform release.
4.26main11181 StableUpgraded with the latest SnapLogic Platform release.
4.25 Patch425patches10571 Latest

Renamed the RFC Listener Snap as SAP RFC Listener Snap. 

4.25main9554
 
Stable

Introduced the SAP RFC Listener Snap that facilitates Remote Function Calls (RFCs) between two SAP systems. The Snap simulates an RFC server and listens to the incoming RFC calls infinitely. Subsequently, the Snap generates output documents either from the import parameters or triggers a child Pipeline. Business applications can use the RFC mechanism to communicate and exchange information (in predefined formats) with other systems.

4.24main8556
StableUpgraded with the latest SnapLogic Platform release.
4.23main7430
 
StableUpgraded with the latest SnapLogic Platform release.
4.22 Patch 422patches7378 Latest

Enhances the SAP Execute Snap to process the structure that contains nested Table Type fields in the output document by recursively parsing them into a Map or a List set.

4.22 Patch 422patches6796 Latest

Fixes the JCO_ERROR_REQUEST_CANCELLED (connection is closed) error in SAP Execute Snap that occurs even when the session is active after 10 minutes.


4.22 Patch 422patches6601 Latest

Enhances SAP Execute and SAP IDoc Write Snaps by introducing the following fields:

  • Reload Function Metadata: To get latest schema.
  • Reload Metadata and Validate: Allows clearing the JCo Metadata cache on the plex node before each validation.
4.22 Patch 422patches6597 Latest

Enhances the SAP Execute Snap by introducing the following two fields:

  • Commit Timeout (sec): Creates a session to call BAPI and commit.
  • Session ID: Identifies specific sessions for all the Snaps that are in a stateful call sequence.
4.22main6403
 
Stable
  • Enhances the Snap Pack to support SNC-based authentication in SAP Accounts and the execution of BAPI call sequences in a Pipeline.
    • The SAP Accounts, SAP JCo Account and SAP Load Balanced JCo Account, can be used to extend connection security with an additional layer of Secure Network Communications (SNC) configuration by passing advanced JCo parameters.
    • Updates the SAP Execute Snap with the ability to execute a sequence of BAPI calls within the same Pipeline and session. Sequence implies that the output from a BAPI call is needed for the next BAPI call to run.
4.21snapsmrc542

 

Stable

Enhances the SAP Execute Snap to add a new field, Output date time as Text, which enables you to output date and time as a String data type instead of a DateTime object.

4.20 Patchsap8811 Latest

Updates the SAP IDoc Write Snap with the following:

  • Fixes the stack overflow error that occurs while retrying to write the IDoc to the SAP server. 
  • Adds inbound success codes to the default value which otherwise only indicates the IDoc being created.
  • Enhances the error messages for a better user experience.
4.20snapsmrc535
 
StableUpgraded with the latest SnapLogic Platform release.
4.19snaprsmrc528
 
StableUpgraded with the latest SnapLogic Platform release.
4.18snapsmrc523
 
StableUpgraded with the latest SnapLogic Platform release.
4.17ALL7402
 
Latest

Pushed automatic rebuild of the latest version of each Snap Pack to SnapLogic UAT and Elastic servers.

4.17snapsmrc515
 
Latest

Added the Snap Execution field to all Standard-mode Snaps. In some Snaps, this field replaces the existing Execute during preview check box.

4.16snapsmrc508
 
StableUpgraded with the latest SnapLogic Platform release.
4.15snapsmrc500
 
StableUpgraded with the latest SnapLogic Platform release.
4.14snapsmrc490
 
StableUpgraded with the latest SnapLogic Platform release.
4.13

snapsmrc486

 
StableUpgraded with the latest SnapLogic Platform release.
4.12

snapsmrc480

 
Stable
  • Added the retry connection and error routing mechanism to the SAP Execute, SAP iDOC Read, SAP iDOC Write, SAP iDOC Document Listener and SAP iDOC Listener Snaps.
  • Updated the SAP Account with Enable trace property to analyse the connection related errors.
4.11 Patch sap4514 Latest

Addressed an issue with the SAP iDoc Listener and iDoc Document Listener Snaps where the pipeline takes a longer time to stop while performing a manual trigger. 

4.11 Patch sap4342 Latest
  • SAP IDoc Write Snap now supports IDoc Extension type.
  • SAP Self-service/on-demand ability to clear IDoc metadata cache.
4.11snapsmrc465
 
StableUpgraded with the latest SnapLogic Platform release.
4.10

snapsmrc414

 
Stable

Added SAP account to connect to a message server, SAP Load Balanced JCo Account.

4.9 Patch sap3246 Latest
  • Added SAP account to connect to MSHOST (JCo Load Balanced account).
  • Addressed an issue with SAP BAPI call appending duplicate fields to object
  • SAP Execute: Support for "table-type" fields added
  • Addressed an issue in SAP Execute: Changing parameter metadata not imported
4.9 Patch sap3233 Latest

Addressed an issue with SAP Execute failing to call BAPI with integer request parameter

4.9snapsmrc405
 
Stable

Introduced the SAP IDoc Document Listener Snap in this release.

4.8

snapsmrc398

 
Stable

Info tab added to accounts.

4.7

snapsmrc382

 
StableUpgraded with the latest SnapLogic Platform release.
4.6snapsmrc362
 
StableUpgraded with the latest SnapLogic Platform release.
4.5.1

snapsmrc344

 
StableUpgraded with the latest SnapLogic Platform release.