cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch response message ID in message mapping

Former Member
0 Kudos

Hello Experts!

Is there a way to fetch the message ID of the response message when the request message ID(of a synchronous message) is given? I'd have to access these 2 message IDs in the message mapping.

Regards,

Meghana

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Meghana,

As you said the message IDs are used in a totally different interface, you have to save the message IDs somewhere, value mapping cache can be utilised..

Each time when you run the sync interface, save the request and response message ID by value mapping replication, for more details refer below link.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e07dd2ae-f783-2c10-9aa6-ca69f67dd...

SAP document: Value Mapping Replication for Mass Data - Integration Directory - SAP Library

After this, you can perform the lookup by request message ID given anywhere, and you may also add some logic to insert or delete the message IDs based on your requirement.

Regards,

Hailong

engswee
Active Contributor
0 Kudos

Hi Meghana

I'd assume you need both ID during message mapping of the response message, as during the request message the response ID is not available yet.

If so, you can use the getRefToMessageId() of InputHeader to retrieve the request message ID during response mapping. It is pretty straightforward to get by just using the code below in a simple UDF.


return container.getInputHeader().getRefToMessageId();

Note that the response message ID can be similarly retrieved with the getMessageId() method.

Rgds

Eng Swee

Former Member
0 Kudos

Hi Eng Swee!

Thank you for the reply.

I'll have to get the message ID of the response message in a different mapping (not in the response mapping) using the request message ID.

Regards,

Meghana

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Meghana,

Could you be more specific about the requirement when you say need response message id in a different mapping since in a synchronous interface apart from request and response mappings, we won't have any other ones.

BR

Vishnu

Former Member
0 Kudos

HI Vishnu,

The mapping in which I would like to fetch the message IDs has no connection whatsoever with the sync interface. It belongs to a separate interface.

Regards,

Meghana

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Meghana,

AFAIK, it is not possible for other interface which is not at all connected to the sync interface to get the message id's.

These two interfaces have any dependency on each other.

And how exactly the interface designs have done in PI system like have you used any bpm's etc.