Did you ever wanted to link a message with a business document? Often, messages are generated in the background and in hidden places like a BADI making it difficult to trace.
In my current project for example, an item that has been dunned generates an outbound message. The message is generated in a FM called in the dunning activity and this is not seen in the job logs. Wouldn’t it be interesting to make a link between the message and the item so we don’t need to search in the message payload? Or the other way around, and inbound message creates a document in my system. I would like to link the document with that message.
If the transaction that displays the ‘document’ profits from the Generic object services (GOS), this link is really easy. All we have to do is create a link between the message and the BOR used in the GOS and there are plenty of blogs/posts about it so I wont cover it here.
I’ve done this often with IDOCS, it’s quite easy and quite handy so I wanted to achieve the same, this time with XI/PI messages and …
it turned out to be already foreseen in the standard. Just have a look to methods CL_PROXY_ACCESS=>WRITE_INBOUND_MESSAGE_LINK and CL_PROXY_ACCESS=>WRITE_OUTBOUND_MESSAGE_LINK. The link is stored in table SPROXMSGREL and there is already an standard report SPROX_MESSAGELINK_DELETE for housekeeping.
The class documentation already provides some examples so I won’t duplicate that here. Instead I’ll just show the result.
This is transaction FPE3 and displays a FI-CA document. It has the GOS toolbar enabled and by clicking on the ‘Relationships’ menu, it displays the link to the PI messages.
A double click on the line will take the user to the message monitor transaction.