View all integrations since Day 1

I am troubleshooting an issue with our SAP to CM integration . I am looking at all the integrations but what I need to see is the body to know if the ones that are failing are all from the same customer. I tried to look into the database under integrationmessages but I see some of the columns are encrypted. Is there a way to decrypt?

Are the messages stored locally ?

Thanks

Judi

Hi Judi,

What is the kind of SAP-MES integration: direct connection using iDocs and BAPIs or custom integration (for example, middleware)?

In the simplest example, the Integration Message is just a group of bytes that represent the payload, so you can have a simple C# snippet to decode back:

const string hex = "<payload copied from Message column in T_IntegrationMessage>";

byte[] bytes = Convert.FromHexString(hex.StartsWith("0x", StringComparison.OrdinalIgnoreCase) ? hex[2..] : hex);

Console.WriteLine(Encoding.UTF8.GetString(bytes));

I tested this in a custom implementation and it worked, but for IDocs/BAPIs it might be different (I couldn’t test in a real example, maybe someone else can perform that test).

Thanks
Ricardo

Hi Judi,

You’re on the right path, as the body of the Integration Entries are indeed stored on the CoreDataModel.T_IntegrationMessage.

The columns which appear to be encrypted are the ones of type varbinary, as the Message one:

One approach to read this data directly on SQL Server would be to convert the data for an more legible form as varchar, eg:

Best,
Ivo

Thank you Ricardo, nice to hear from you. :slight_smile: It has been a while.
It is an iDoc for this particular one.

I will test it out

Judi

Thank you Ivo, let me try this also.

Judi

I tried this and I did not get the same as you.

USE SDOPrd
select Message,
CONVERT(varchar(max), Message) AS DecodedMessage
from [CoreDataModel].[T_IntegrationMessage]

and all my decoded messages look like this

PK-

Hi Judi,

Alternatively, you can view the body of the integration entry messages in the UI. Unfortunately, there is no option to see only the body in the columns.

Only the result description for the failed IEs:

This will enable you to view the failure reasons in the grid. For the body, the only option is to check each IE individually.:

While it may not be exactly what you need, it can assist if you lack access to the database.

Yes I can view them but there are only so many in the GUI. I was trying to go all the way back to the beginning.

Judi

Hi Judi,

An update from my part, since I went to confirm and the IDoc content is stored as a binary zip file and not text, so the snippet above will not work (the same reason the SQL query will also not work and just output gibberish).

You can try to use the following snippet:

using System.IO.Compression;
using System.Text;
using System.Xml.Linq;

const string hex = "<copied from Message column>";
byte[] bytes = Convert.FromHexString(hex.Trim().StartsWith("0x", StringComparison.OrdinalIgnoreCase) ? hex.Trim()[2..] : hex.Trim());

using var zip = new ZipArchive(new MemoryStream(bytes), ZipArchiveMode.Read);
using var reader = new StreamReader(zip.Entries[0].Open(), Encoding.UTF8);

Console.WriteLine(XDocument.Parse(reader.ReadToEnd()));

Thanks again. I will give this a try. Ivo and I figured out it was zipped.

Judi