Technical blog
Troubleshooting SAP BTP TPM: Debugging Step 1b and XSLT Transformations
created by DALL-E
Vlado Balko
21. 9. 2024
Integration
Debugging Errors in Trading Partner Management: A Guide
Debugging errors in Trading Partner Management (TPM) isn’t exactly easy or straightforward. Many errors are often summarized with a simple message:
Message ended with Escalation end event
In today’s article, we’ll explore how to troubleshoot an error that occurs during step 1b, which is the second step in the standard process. This step involves the initial extraction of identifiers from the message (based on the message type) and populating headers and properties.
This extraction process often causes issues because the error messages generated during the extraction (via XSLT) don’t appear in either the MPL monitoring or B2B monitoring tools.
So, if we want to understand what’s happening and why the message processing is failing, we’ll need to simulate this step using external tools.
To do that, we need two things:
1. The payload of the incoming message — what is being transformed.
2. The XSLT transformation script — the tool used for the transformation.
The Incoming Message Payload
When a message fails with the aforementioned error, you can find the payload of this message in the B2B monitoring section under “Unassigned Interchanges.”
By applying the correct filter, you should be able to open the incoming message. In the “Unassigned Interchange Payload” section, you’ll find the payload data.
XSLT Transformation
Obtaining the XSLT transformation script is a bit more complex.
In the Partner Directory, you’ll find one entry for each type of incoming message (e.g., IDoc, AS2, SOAP, etc.). If the incoming message is an IDoc, for example, locate the corresponding record in the Partner Directory and note its Partner Directory ID.
The correct entry will contain a binary parameter named EXTRACT_XSLT.
Next, use a REST client (such as Postman) to call the standard SAP API for retrieving Binary parameters. You can find the API here: SAP API for Binary Parameters.
The returned data will include all binary parameters from that Partner Directory. Look for the record with:
A PID matching your Process Directory ID.
An ID containing EXTRACT_XSLT.
In the VALUE element, you’ll find a Base64-encoded ZIP file containing your XSLT transformation script. Copy the entire content of the VALUE element.
Then, decode it and save it as a ZIP file on your local disk. You can use this handy online tool: Base64 Decode.
Once you’ve saved the ZIP file, extract the XSLT transformation script, and you’ll have everything you need to perform the transformation using any tool you’re comfortable with. Personally, I highly recommend using xsltransform.net, a great tool for this task.
Note: Standard scripts contains custom functions setExchangeHeader which tries to set Header. It is obviously not possible in this environment, so comment out those lines.