SAP IDoc Connector Guide > SAP IDoc connections > Search filter
  

Search filter

You must add filters to read the IDoc metadata. The event used in a process is an object that contains a process object with a payload representing the IDoc message. The message consists of two main parts:
When you use specific IDoc types like MATMAS05, configure a search filter in the custom attributes section to represent the IDoc type format. The search filter uses the syntax to specify the IDoc type, message type, and extension type.
For example, configure the search filters as follows:
{
"searchFilter": [
{ "IDoctype": "MATMAS05",
"MessageType": "MATMAS",
"extType": ""
}
]
}
Including this filter ensures that when you publish the connection, metadata specific to that IDoc type is fetched automatically.
Handling multiple IDoc types in a single listener
If the listener receives multiple IDoc types on the same connection, such as MATMAS05 and MATMAS07, specify multiple search filters to fetch the metadata for all these types simultaneously.
For example, the search filter would appear as:
{
"searchFilter": [
{
"IDoctype": "MATMAS05",
"MessageType": "MATMAS",
"extType": ""
},
{
"IDoctype": "MATMAS07",
"MessageType": "MATMAS",
"extType": ""
}
]
}
With this configuration, you fetch metadata for both MATMAS05 and MATMAS07, enabling the listener to process both the IDoc types.
At the message structure level, the Headers remain consistent with the same keys regardless of the IDoc type. The Body is a string that can represent different IDoc types, such as MATMAS05 and MATMAS07, depending on the SAP settings, allowing you to handle multiple IDoc message formats.