cancel
Showing results for 
Search instead for 
Did you mean: 

XPATH in Receiver Determination for missing node

Former Member
0 Kudos

I have this situation in a proxy to file/email scenario.

My date from the proxy can look like this:

<RECEIVER_ID>0002000135</RECEIVER_ID>

<EMAILID>foo@fooland.com</EMAILID>

or

<RECEIVER_ID>0002000135</RECEIVER_ID>

{no EMAILID NODE}

I need to route the data to an email (as an attachment) or to a file to be FTP'd. Notice the <RECEIVER_ID> node has the same value in both case. I need to make this determination based on the existance or non-existance of the <EMAILID> node. I read about a million blogs and web pages and what I found does not work.

I have tried as the Xpath rule for a file to be sent as

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[not(exists(EmailID))] EX

and

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[not((EmailID) EX

I have as the XPath for the email

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID EX

What happens is when there is no EMAILID node at all, PI is still trying to send out an email and not trying to send a file. I verified it was finding the [not(exists(EMAILID))] as invalid but finding the "send email" version as valid and failing, of course, as there is no EMAILID node.

Please help!

Accepted Solutions (1)

Accepted Solutions (1)

former_member184789
Active Contributor
0 Kudos

Hi Dave,

Is your scenario such that if Email exists then send as email otherwise file. You can have it such that if email ID exists then send to Email. After that , in your ICO,at the bottom select 'If no receiver found', send to file. You may also consult the below links:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/06/07/customise-your-xpath-expressions-...

http://scn.sap.com/message/13934895

Former Member
0 Kudos

This message was moderated.

Answers (5)

Answers (5)

PeterJonker
Active Contributor
0 Kudos

You could fill the email id in the mapping with a default value (e.g. dummy@dummy.com) and check for this value in your receiver determination..

Former Member
0 Kudos

Had ABAP change the data into the proxy so when there is no email address, they will populate with the word NONE. That I can look for in Standard Receiver Determination. Moving this interface to use Enhanced when time permits

ambrish_mishra
Active Contributor
0 Kudos

Checking for not NULL would have worked too... good to know that you were able to resolve this.

Ambrish

ambrish_mishra
Active Contributor
0 Kudos

Hi,

You can try to make EMAILID mandatory (if custom proxy) and check it for not NULL. Just a suggestion... it may work.

cheers,

Ambrish

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Can you try these conditions?

For File

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[not(EmailID)] EX

For Email

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID/EmailID EX

http://stackoverflow.com/questions/767851/xpath-find-if-node-exists

Or if that does not work, try using the count as your argument e.g

For File

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[count(EmailID)<1] EX

For Email

/p4:CustInvcWandPOS_MT/Records/RECEIVER_ID  = 0002000135 AND

/p4:CustInvcWandPOS_MT/Records/[count(EmailID)>0] EX

Hope this helps,

Mark

Former Member
0 Kudos

Thank you for the suggestions. I had already tried the first one to no avail and the second (count) did not work either.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Dave,

Can you give us a trace on the receiver determination part in sxi_monitor?

Regards,

Mark

Former Member
0 Kudos

Hi,

I would suggest you to go with ERD (Enhanced Receiver Determination).You can comfortably achieve your req in ERD.

Regards

Venkat