cancel
Showing results for 
Search instead for 
Did you mean: 

Xpath Content or use Extended Receiver Determination

Former Member
0 Kudos

Hi guys,

I have a message outbound in PI, and I have to determine to use one mapping or another depending on a string in our XML. Our XML is like:

<MT_TEST>

     <row>

          <text>There has been an Error in program...</text>

     </row>

     ....

I have to look for string 'Error' in one of the rows to determine the receiver mapping. There are multiple rows. I have seen old blogs, but in the interface determination I don't see the xpath expression to use function 'contains' for example, and is not a pattern.

I have seen the possibility of extended receiver determination, but this is to determine the receiver, then how you put the mapping after determining the receiver?

Many thanks,

XAvier.

Accepted Solutions (1)

Accepted Solutions (1)

former_member192343
Active Contributor
0 Kudos

Hi Xavier,


You can enter the following values:

  • EQ for equal (=)
  • NE for not equal (≠)
  • CP for contains pattern (≈)
  • EX for exist

Is CP (≈) work?

former_member192343
Active Contributor
0 Kudos

or try this Xparh expression:

contains(//MT_TEST/row/text, 'Error') = 0

Former Member
0 Kudos

Hello Mikhail,

I have tested the Xpath expression, but always goes to the Service interface without error, and the payload contains string 'Error'.

Former Member
0 Kudos

Hi Mikhail,

If I put (//MT_TEST/row/text, 'Error') = 0 for the first and (//MT_TEST/row/text, 'Error') != 0 always goes for the second. If I put true and false despite 0, doesn't determine the service interface.

The xpath check all the lines? Because the string 'Error' could come only in the first row, and maybe this could be the problem.

Many thanks,

Xavier.

former_member184720
Active Contributor
0 Kudos

HI Xavier -

Can you try with the below

MT_TEST/row[contains(text, 'Error')] ex

Former Member
0 Kudos

Hello Hareesh,

with this condition it works properly.

Many thanks,

Xavier.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

U can use multimapping concept, so while doing message mapping u can check if text field contains "Error" string then output first structure and if not then create second structure.

Check this:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

I have tried this solution but I have the error in monitoring that Split mapping created no messages.

I have two operations in the Inbound Service Interface. Created the message mapping and operation mapping with Occurrence 0..unbounded and configured the interface determination, but it doesn't work.

I have tried also with two service interface despite one, but I have the same error message.

I don't know what could be wrong in this case.

Kind Regards,

Xavier.

Muniyappan
Active Contributor
0 Kudos

Hi Xavier,

Did you test the message mapping? is it creating the messages as expected?

check this

Regards,

Muni.

Former Member
0 Kudos

Hello,

As already suggested above, it seems that ur mapping is not working properly. So u have to check the same.

Thanks

Amit Srivastava