cancel
Showing results for 
Search instead for 
Did you mean: 

XPath Expression to Check if certain condition

deva_gembali2
Participant
0 Kudos

Hi Experts,

    I need to control some kind of messages need to ignore at SAP PI side. So, I am trying to ignore by config at Receiver configuration at ICO.

Here I need to ignore transaction types like - T*, W* ( starts with T /Starts with W).

In this case, what type of operator can we use ? How to ignore messages which start with something ?

Deva

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor
0 Kudos


Hi,

Write T* or W* in condition and keep operator aproximately .

EG :

Regards,

Manoj

deva_gembali2
Participant
0 Kudos

hi Manoj,

    If I put Approximate, it only consider T* & W* , I want to exclude those .

deva_gembali2
Participant
0 Kudos

Hi Manoj,

   This is the logic I am trying . Here, For country = MY  & Transaction type = I* - allow all messages , for other countries there is no restriction.

I am not able to send any messages to SAP.

manoj_khavatkopp
Active Contributor
0 Kudos

Hi ,

You can check with   HEADER[substring(TransactionType,1,1)] NE T or

you may go for Count function in XML.

Through count you can check if starting with I is 0 or not and then map to respective receiver.

XPath, XQuery, and XSLT Function Reference

Br,

Manoj

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Deva,

When you want to have no receiver for messages where country = MY AND TransactionType starts with T you need a receiver determination for

//p1:MT_InventoryMovement/MessageHeader/country NE MY

OR //p1:MT_InventoryMovement/HEADER[substring(TransactionType,1,1)] NE T

Kind regards,

Bert

Former Member
0 Kudos

Hello Deva,

You can try below condition in condition editor by selecting TransactionType field:

(/p1:MT_InventoryMovement/MessageHeader/country=MY)

AND

(/p1:MT_InventoryMovement/HEADER/TransactionType ≠ T*)

AND

(/p1:MT_InventoryMovement/HEADER/TransactionType ≠ W*)

Regards,

Soumyadip

deva_gembali2
Participant
0 Kudos

HI Sowmyadip,

   If I try above code , if country = ID /AU, still failing .

I only ignore country = MY , Transaction type = T* & W*.

Note : in editor, can I click multiline ?

Deva

Former Member
0 Kudos

Hello Deva,

If you want to ignore the messages which are having country as 'MY' and TransactionType as 'T*' or 'W*' then you can try below code.

(/p1:MT_InventoryMovement/MessageHeader/country≠MY)

AND

(/p1:MT_InventoryMovement/HEADER/TransactionType ≠ T*)

AND

(/p1:MT_InventoryMovement/HEADER/TransactionType ≠ W*)

As your root node occurance is 1..1 you can uncheck multiline option I guess.

Regards,

Soumyadip

Message was edited by: soumyadip basu roy

praveen_sutra
Active Contributor
0 Kudos

Hi Deva,

could you please send the message structure for a better picture.

In the meanwhile this blog might help.

Xpath Condition in Receiver Determination - Process Integration - SCN Wiki

Hope this helps.

thanks and regards,

Praveen T

deva_gembali2
Participant
0 Kudos

If Country (Messageheader-country) = MY and

If transactionType starts with T ( T01,T02, T03, etc ) we have to ignore those messages.

sendhil_kumar
Active Participant
0 Kudos

Hi Deva,

This condtion should work.

/MT_InventoryMovement/Header/TransactionType[not(T0*)] EX

Please Check and let me know .

--

Sendhil

praveen_sutra
Active Contributor
0 Kudos

hi Deva,

Did you tried.

MR_InvetoryMovement/Header/TransactionType != T01

MR_InvetoryMovement/Header/TransactionType != T02



thanks and regards,

Praveen T