Response "SAP ALE"

This Response implements the connection to an SAP system via the SAP ALE interface. For the appropriate target structure see sections Loading internal IDoc structure and Loading IDoc structure from SAP repository.

Settings


(1) SAP alias: The SAP alias of the connected system (see section SAP).

(2) Additional parameters: The following additional parameters are accepted.

<empty field>

All segments are sent to SAP. That is the default case.

mode=default

Only segments starting with "E", "Y" or "Z" are sent to SAP.

mode=uppercase

Only segments that do not begin with a lowercase letter are sent to SAP.

mode=regex;regex=...

Only segments that match the regular expression are sent to SAP.

<any other, non-empty content>

Only segments that do not start with lowercase letters "r" or "p" are sent to SAP.

You can also specify the path to a text file in the additional parameter. The file then contains the parameter. The purpose of this parameter is to send only parts of the target tree to SAP and to be able to also use the target tree for another Response. You could, for example, trigger a subsequent profile before or after you send to SAP, which then receives additional data (the rest of the target tree) in addition to the IDoc segments. To mention another example, you could implement the profile as a web service and send back a response with data to the web service client.

(3) Check DOCNUMs: Before sending, the integrity of the DOCNUMs is checked.

(4) Mark whole job as failed if this response fails: Normally a job is not necessarily considered to be erroneous if a single Response fails (see section Status of Response - Error Behaviour). But it can be enforced with this option here.

(5) Additional text on error: Here you can specify an additional log text for the error case.

SAP TID


Each call of the SAP ALE Response generates a transaction in which one or more IDocs are sent. The transaction is identified within the SAP system by a Transaction ID (TID).

Internally generated TID


Normally this TID is created internally in the Response from four components (the IP address of the SAP system, the start time of the job, the last four digits of the job number and a counter). If, as a result of the set checkbox "Enter output channels for each record", the Response is executed several times within a job, the record number is used as the counter.

For repeated transmissions in the Response (within the same job), it is guaranteed that this is done with the same TID as used in the first transmission attempt (because the TID is generated from the same components). This is necessary to avoid unwanted multiple processing in the target system.

When an error job is restarted, however, a different TID is used due to the new job number. To avoid this, the creation of the IDocs and the transmission of the IDocs to the SAP system can be divided into two profiles (a profile that creates the IDoc and a manual TID and another profile that sends them to the SAP system, using the manually created TID). See the following sections on this.

Manually generated TID


If you don't want to use the internally generated TID, it is possible to generate one manually with function create-sap-tid(). To use this manually generated TID in the SAP ALE Response, the system variable VAR_SYS_SAP_TID (type "String") must be defined and the TID must be assigned to it (otherwise the internally generated TID is used). Important note: The user is then responsible for ensuring that each IDoc is sent with a unique TID, but repeats of a transmission with the same TID.

Separation of IDoc creation and IDoc transmission


If there are frequent interruptions when sending IDocs to an SAP system, or the SAP system is sometimes unavailable, it is advantageous to separate IDoc creation from IDoc transmission.

Creation profile


The profile that generates the IDocs sends them as fix record data via Message to a subsequent profile (the transmission profile), which then transmits the IDocs to the SAP system. We recommend persistent messages, because then transmission errors do not cause an error in the creation profile.

In addition, a manual TID is created with function create-sap-tid(). This TID can be placed in the IDoc in an additional data record/segment whose data record match code starts with a lower case letter (preferably "r" or "p"). This additional segment can contain further parameters, e.g. the SAP alias of the SAP system you want to sent to. More about this in the following section.

Transmission profile


The transmission profile can send the received fix record IDocs as received with the "SAP ALE" Response. Note: If the transmission profile has the checkbox Profile may only run in one instance (strict serial processing) set, you can avoid that blockages within the SAP system strongly affect the performance of your other processes. If the amount of data is too large for this serial processing, the transmission profile should at least run with a higher priority.

The transmission profile then only evaluates the additional segment in the IDoc (and possibly "EDI_DC40" if containing values are also needed) and can then control the transmission process with the parameter values of the additional segment. If, for example, the TID from the additional segment of each IDoc or IDoc group is assigned to the variable VAR_SYS_SAP_TID, it ensures that restarts of the transmission profile use the same TID as in the first transmission attempt (since the restarted profile uses the backup file, i.e. the IDoc that contains the TID in the additional segment, which is then assigned to variable VAR_SYS_SAP_TID again, which is then used as TID in the Response instead of the internally generated TID).

To finally prevent the additional segment from being sent to the SAP system, the additional parameter "mode=uppercase" (see above) is used.