Outbound Flat File scenario with 'PI Outbound' interface testing
EXAMPLE CASE:
Testing end-to-end an EDIFACT order confirmation - from IDOC generation in ECC backend till final outbound file.
PREREQUISITES:
- Interface name and namespace
- Message after conversion to flat format (by adapters modules) must be available in SAP PI / PO persistence.
- An existing inbound test case that will generate a message in the backend or inject a message into SAP PO
PROCEDURE:
- Go to transaction /INT4/IFTT_CONF and create a new object definition providing the following data:
- Object Definition ID
- Description
- Name → name of the tested interface
- Namespace → namespace of the tested interface
- The name and the namespace should be the same as in the ICO of the interface. Check the Receiver Interfaces tab of the ICO.
Alternatively, it can be checked in PI Message Monitor:
- Go to Object Variables and define variables names and descriptions. You can declare an unlimited number of variables. Always try to give the variable a meaningful description. The variable will be used to find messages generated by the previous test case.
- After selecting a single variable, move to Variable Processing. Here you define actions for every variable declared in the previous step. For more specific information, check the Variable processing section. Be aware that for constructing XPath Expressions for flat files, you should use Expression language for flat files.
- Add Additional Parameters:
PI Message Version after processing is the parameter that allows defining which version of the message should Int4 IFTT fetch from PI persistence after test case execution.
Messages to be persisted are defined in ICO advanced settings on SAP PI. However, in this particular scenario, we would like to obtain the message version at the stage of being processed by the adapter.
This setting can be done by setting up localejbs/AF_Modules/MessageLoggerBean module in the receiver communication channel Module tab.
log.condition - used to define the interface type, e.g., for asynchronous interfaces, this value should be set to 1.
log.location - user defined parameter - it is used to distinguish the version of the message in PI Monitor. If set to flat, it will be visible as a Log version with the caption: flat.
For more details on this particular module configuration, check this blog: https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ - After processing the message, the new flat version should be visible in PI Monitor as in the example below:
Ensure that the Interface Name and Namespace in your Int4 IFTT object configuration are the same as the values in the message monitor for the "flat" version of the message.
The flat version comes with the Log version status. Message versions with Log version status can be fetched if the 2437778 SAP note is installed. Before reaching out to your basis, check the complete list of support packages containing this note: https://launchpad.support.sap.com/#/notes/2437778.
For getting message versions with Log version status, it is required to use caption values, e.g., flat, AM, etc.
Fill in the additional parameters. Set flat as the PI: Message Version after processing parameter value ( or whichever version name was set in the log.location parameter of the CC ). - Define XPath Exceptions. By default, all differences in values are treated as errors. Xpath Exceptions allow determining alternative rules for the specified fields, e.g., Warning or Ignore.
Again for these XPath Exceptions, Expression language for flat files should be used. - Create a test case in relation to the already existing inbound test case that would trigger an outbound message.
- To assure that the outbound test case will run correctly, it must be run together with the related test case defined in the pre caseID column. Highlight both test cases by selecting them with CTRL and press Execute Selected.
. - Test case execution results:
© 2017 - 2022 Int4 AG All rights reserved