Reg:'XPATH' Expressions in Receiver Determination

Hi All,
My scenario is an IDoc type.
Structure:
ZABCD
IDOC
TEST1
FIELD1
FIELD2
TEST2
FIELD3
FIELD4
Condition:
(field1 = "500" OR field1 = "800" ) AND (field3 = "EZTU" OR field4 = "BLKB")
I am trying to achieve the above condition  through own XPATH expression in Receiver determination.
Can anyone help me out in this.
Thanks in Advance,
Lavanya .B

I have just simulated your structure in XML Spy
<ZABCD>
     <IDOC>
          <TEST1>
               <FIELD1>500</FIELD1>
               <FIELD2></FIELD2>
          </TEST1>
          <TEST2>
               <FIELD3>EZTU</FIELD3>
               <FIELD4>BLKB</FIELD4>
          </TEST2>
     </IDOC>
</ZABCD>
and the XPath is /ZABCD/IDOC/TEST1[FIELD1 = '500' or FIELD1= '800' and /ZABCD/IDOC/TEST2[FIELD3 ='EZTU' or /ZABCD/IDOC/TEST2[FIELD4 = 'BLKB'
consider that thread does not show the some character, so, put a ] after 800,'EZTU' and 'BLKB' if i put it the blog consider as a link everithing between [     ]
I mean
'800']
'EZTU']
'BLKB']
refer to this link: /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
Edited by: Rodrigo Alejandro Pertierra on Sep 15, 2010 10:46 AM
Edited by: Rodrigo Alejandro Pertierra on Sep 15, 2010 10:49 AM

Similar Messages

  • Using substring in the XPATH expression for Receiver Determination

    Hello, I need a little help please.  In my receiver determination, I have a condition and I need to do a "not like" check.   Basically, if the first three positions of the source field does not start with a specific code, then I need to execute the condition.   The condition editor does not support a "not like" operand, so I went to the XPATH expression editor.  I tried to used the XPATH substring function to get the first three characters and then do a "not equal" operand, but it doesn't appear to work.  There are not any runtime errors, but the condition is not executing.  Any ideas on this?  Does the XPATH expression support the substring function?

    Hi Jesse,
    Can you please explain what is the meaning of http:// in the statement
    /p1:PRODUCT/MATNRhttp://not(substring(.,string-length(.) - 2) = '123')
    Please explein, I am having same issue. It is not working here.In My case it is
    /p1:ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[http://not(starts-with(.,\"D\"))]
    also tried with
    /p1:ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[http://not(starts-with(.,'D'))]
    Thanks in advance!

  • Xpath expression in Receiver Determination

    Hi All,
    I have a condition where i need to check if WERKS is containg any value starting with IT , then i need to send this IDOC to the target.
    I tried to used the following expression \MARCM\WERKS = IT* in RD , but its not workin when i am sending an IDOC with value as IT03 or other values startign with IT .
    Any idea how to deal with such an issue...
    Regards
    Vinay P.

    Hi,
    Instead of
    \MARCM\WERKS = IT*
    Use
    \MARCM\WERKS ~ IT* 
    [dobule(~)]
    double(~)
    for your help
    http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
    regards
    Ramesh

  • XPATH condition in receiver determination.. Sum one of the filed

    Hi,
    This is my input payload.
    segment "Record" will be coming multiple times.
    <ns:MT_Account xmlns:ns="urn:com.statement">
    -<BalanceRecs>
      - --<Record>
    <field1>CUA</field1>
    <field2>0.00</field2>
    <field3>324612.28</field3>
    <field4> LTD</field4>
        -----<numRecs>0</numRecs>
    </Record>
      --- <Record>
    <field1>CUb</field1>
    <field2>0.00</field2>
    <field3>324612.28</field3>
      <field4> LTD</field4>
      <numRecs>2</numRecs>
    </Record>
      --- <Record>
    <field1>CUc</field1>
      <field2>0.00</field2>
    <field3>324612.28</field3>
       <field4> LTD</field4>
    <numRecs>0</numRecs>
      </Record>
    </BalanceRecs>
    Requirement:
    I need to calculate the sum of field "numrecs".
    If the sum is 0, then pass to BPM(IP_BPM)
    If the sum is > 0 then pass to System B.
    I tried using the below blog from shabarish..
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    /p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) = 0] EX        --> BPM
    /p1:MT_ActBalance/BalanceRecs/BalanceRecord[sum(numRecs) > 0] EX        --> SystemB
    Is there anything im missing .. kindly suggest.
    Thanks
    Deepthi.

    Hi Mark,
    It is working only for one receiver.
    i mean
    <numRecs>0</numRecs>
    <numRecs>0</numRecs>
    <numRecs>0</numRecs>
    The message is going correctly when the sum value is 0. ie to BPM.
    <numRecs>0</numRecs>
    <numRecs>2</numRecs>
    <numRecs>0</numRecs>
    OR
    <numRecs>2</numRecs>
    <numRecs>0</numRecs>
    <numRecs>0</numRecs>
    When I pass the above payloads, it is going to both the receivers.
    Since the total is 2, it should go only to systemB
    Any idea?
    This is working perfectly for enhanced receiver determination. I dont want to use enhance version for this simple case.

  • XPATH problem in Receiver Determination

    Hi Experts, I get stucked in the XPATH expression in the Receriver Determination(RD) :
    The input xml (default namespace settting) is like this :
    <?xml version="1.0" encoding="UTF-8" ?>
    <MT_XML_SENDER xmlns="http://test.com">
    <LAST_NAME>Bryant</LAST_NAME>
    <FIRST_NAME>Kobe10</FIRST_NAME>
    </MT_XML_SENDER>
    In the RD, I tried serveral XPATH expressions :
    /MT_XML_SENDER/LAST_NAME = Bryant
    /MT_XML_SENDER/LAST_NAME = "Bryant"
    /MT_XML_SENDER(LAST_NAME = \"Bryant\") EX
    But in every case, the PI always told me it could not find the receiver, I don't know what to do........
    (BTW,if I remove the condition, PI could work as desired, so it is 100% related to XPATH setting)
    Thanks very very much!!!!!
    Ray

    You probably noticed by yourself, but in the Condition Editor, it is necessary to set the namespace to a prefix and then create the XPath expression based on that prefix. i.e.
    /p1:MT_XML_SENDER/p1:LAST_NAME
    And on the prefix definitions, you set it to your namespace:
    p1 http://test.com
    Easiest way to do it is to go through the message structure, though, since it will fill the prefix automatically as per the definition in the message type in repository.
    Best regards,
    Henrique.

  • X-path expression in Receiver determination

    Hi,
    I am working on JDBC to SOAP interface using BPM in PI7.0.
    I am trying to use the XPath function in creating a condition in my receiver determination to route messages to two different business systems. My issue is that i could not find the JDBC message structure in x-path expression.
    Any one please can help me on this.
    Thanks In Advance!

    Hi,
         For x-path expressions in the receiver determination, you would not be able to choose the sender structure fields like you would do normally. You would have to provide the x-path manually, starting from the root node upto the required field.
    Regards

  • XPath Error in Receiver Determination

    Hi All,
    I hav an outbound message coming out of ERP (Non IDoc). I have to route the message based on the field DESTINATION in the message. The payload in the SXMB_MONI is as follows.
    <?xml version="1.0" encoding="utf-8" ?>
    <nr1:OLabelling_OB xmlns:nr1="http://cpe.com/cpe_ftp_wms/Labelling/OL">
    <Label>
      <b><DESTINATION>XXXX</DESTINATION></b>
      <PRPRORD>0001005683</PRPRORD>
    </Label>
    </nr1:OLabelling_OB>
    In the receiver determination, I hav chosen the XPath button and given the following value
    <b>/nr1:OLabelling_OB/Label/DESTINATION</b>.
    This doesn't work. i had also tried giving the namespace and the prefix as
    <b>nr1</b> <b>http://cpe.com/cpe_ftp_wms/Labelling/OL</b>. but that dint help either.
    If i remove the condition, then it is working fine.
    Any help in this regard?
    Thnx in Advance.
    Anil

    I had activated and checked......it was not getting displayed.......
    But i checked the xpath rules and used a work around solution for this. as per the xpath rules if i enter xpath as //DESTINATION, it picks up the DESTINATION field from anywhere in the document. and that worked.
    Thnx for ur help so far...
    anil

  • Condition "not containing" expression  in Receiver Determination

    Hi guys,
    I have one interface which processes files with lines compossed by two fields, an identificator, and a data field.
    Inside the data field, i have a row of characters and I want to create this condition in the receiver determination:
    If Data contains text "e6212" then, receiver is X
    If Data does not contain text "e6212" then, receiver is Y.
    I know how to create the first condition, but not the second. Could anybody help me? Thanks in advance!

    Hi,
    The condition editor contains 'Contains Pattern (CP)':
    You use this operator to query a string with a pattern. You can use the following characters for this:
    ·        + for any single character
    ·        * for any string
    *mploymenttaxdeclarat+on annualemploymenttaxdeclaration.
    please read more here:
    http://help.sap.com/saphelp_nw04/helpdata/en/67/49767669963545a071a190b77a9a23/content.htm
    regards
    Vijaya

  • XPATH condition in Receiver Determination in PI 7.1

    Hi all,
    I'm doing a Inbound 850 Scenario (no BPM involved)...based on the condition for (/LIST/S_ISA/S_GS/S_ST/S_BEG/D_353 = 00) its should either create ORDERS.ORDERS05 or create ORDCHG.ORDERS05 if (/LIST/S_ISA/S_GS/S_ST/S_BEG/D_353 = 04)...I'm giving the condition in interface determination and multiline selected in the Xpath editor
    I'm using PI 7.1 and irrespective of the condition it always creats Orders.Orders05, I have 2 receiver agreements also for both receiving interfaces...
    Any solution on how to debug?
    Thanks,
    Srini
    Edited by: Srinivas Davuluri on May 12, 2009 10:56 AM

    I forgot to give the prefix...mistake from my side

  • Xpath condition in Receiver Determination

    Hi  Gurus -
    I want to implement a condition, For QUALF=01 AND ORGID=ORG1, then only it should go to some receiver and otherwise some other Receiver.However when i implement this using context object/Xpath, The condition happens to be true which should not be true for following structure as No segment contain "QUALF=01 AND ORGID=ORG1".
    It happens to be true probably because one of the QUALF=01 and one of the ORGID=ORG1, however i doesnt want like that
    - <E1EDK14 SEGMENT="1">
      <QUALF>01</QUALF>
      <ORGID>ORG2</ORGID>
      </E1EDK14>
    - <E1EDK14 SEGMENT="1">
      <QUALF>02</QUALF>
      <ORGID>ORG1</ORGID>
      </E1EDK14>
    - <E1EDK14 SEGMENT="1">
      <QUALF>01</QUALF>
      <ORGID>ORG2</ORGID>
    Expert opinions are invited.
    Regards.
    Jeet,

    Hi Jeet,
    Your Condition should be as
    <b>/p1:ORDERS05/E1EDK14/QUALF=01 AND /p1:ORDERS05/E1EDK14/ORGID=ORG1</b>
    and not as <b>(/p1:ORDERS05/E1EDK14[QUALF="01" and ORGID="ORG1"] EX )</b>
    To acheive this,
    1. Go to condition editor in the RD
    2. Insert a new expression clicking on the + button at the top left.Now u will find the operation AND between the two condition
    3. In both the condition line select the respective XPath of the node and specify the matching condition.
    It should look like..
    Left Operand                                     OP    Right Operand
    /p1:ORDERS05/E1EDK14/QUALF       =           01                   AND
    /p1:ORDERS05/E1EDK14/ORGID        =          ORG1                 
    Regards
    San

  • Receiver determination - Xpath expression problem with count

    I am working with a scenario where I pick up records from a JDBC connection and if the number of records I pick up is less than a certain number I want to call a webservice.  If it is greater than the number I want to write out a file to be processed by a different process on the receiving end.  I have created the receiver determination condition with the following conditions:
    (/p1:MT_HOG_Data/row[count(row) > 3] EX)
    (/p1:MT_HOG_Data/row[count(row) <= 3] EX)
    The integration is always processing the second condition no matter how many records come in.  I have tried with and without the multiline option.  Can anyone help with this?
    I have searched through the forum and checked the following links without any resolution:
    http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    I can't find any examples where a count of records is checked in the expression editor.  Thanks in advance for any help.

    You can not use the EX operator in that case, because that is used only for node existence checks, not for value checks.
    Do you have a row number in your structure ? Then you could write the xpath expression with that counter tag and value
    Example: you want to send to receiver A if count > 3, else to B:
    you set  /rowNumber EQUAL 4 for sender A
    and /rowNumber NOT EQUAL 4 for sender B
    The condition is applied to the whole document. If one of the node/values are true for that condition, then the whole condition is set to true.
    Problem with that is that the second condition also will be true because nodes for that condition will be found
    better would be to have a rowcount tag in the structure. If that is not possible, you can use the "Enhanced Receiver determination" where you can define a mapping which determines the receivers. There you can do anything complicated you want.
    CSY

  • Customizing XPATH in Receiver Determination

    Hello,
    I am using this blog to write conditions /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination and accordingly call the receiver (either Receiver_1 or Receiver_2), never to call both the receivers simultaneously
    I have a sample source message like:
    <?xml version="1.0" encoding="UTF-8"?>
    <ConsumerDetails>
       <UserId>91200024:123456</UserId> To check if UserId starts with 91200024: or not
       <Date>20111301161459</Date> To check if length of Date is 14 or not
       <Billing>RC</Billing> To check if Billing has value RC/ SB or not
       <Type>SE</Type> To check if Type has value SE/ CWE or not
    </ConsumerDetails>
    Accordingly wrote the below conditions:
    Receiver_1 (Conditions working fine):
    UserId (MiddleOperator --> ContainsPattern) --> 91200024:*
    /ConsumerDetails[(string-length(Date)) = "14"] --> EX
    /ConsumerDetails[(Billing = "RC") or (Billing = "SB")] --> EX
    /ConsumerDetails[(Type = "SE") or (Type = "CWE")] --> EX
    Receiver_2 (Conditions not working; except 1st condition):
    /ConsumerDetails[not(starts-with(UserId,'91200024:'))] --> EX
    /ConsumerDetails[(string-length(Date)) != "14"] --> EX
    /ConsumerDetails[(Billing != "RC") or (Billing != "SB")] --> EX
    /ConsumerDetails[(Type != "SE") or (Type != "CWE")] --> EX
    Only Conditions for Receiver_1 are working fine; those for Receiver_2 are not. Can anybody please provide correct conditions to be written in the Condition Editor?
    ~Thanks.

    Hello,
    Have you tried using the condition as mentioned below:
    /ConsumerDetails[not((string-length(Date)) = "14")] --> EX
    /ConsumerDetails[not((Billing = "RC")) or not( (Billing = "SB"))] --> EX
    /ConsumerDetails[not((Type = "SE")) or not((Type = "CWE"))] --> EX
    i.e. use not() instead of '!' ??
    -Rahul

  • XPATH in receiver determination

    Hi,
    We need to dynamically determine the receiver service based on the payload.
    In the extended service editor we have succesfully used a simple XPATH expression to point out a specific field of the payload (just like using af context object) containing the service name.
    However, in most cases the service name is a substring of a field of the payload and furthermore a constant is to be added to give the full service name. We have tried to solve this problem using the XPATH functions 'concat', 'string' and 'substring'. But as soon as we add just the simplest function to the XPATH expression, the receiver determination fails (unable to process the XPATH).
    We have tested the XPATH with the actual message using XML Spy, and it works well.
    The XPATH expression is: "concat('SAPR3_', substring(string(/p1:receipt/p1:identity), 2, 5))"
    Any hints?
    Regards
    Lars

    Hi Lars,
    I just noticed, that you are talking about extended Service Editor - not a Condition - so my answer above is obviously rubbish.
    What remains true is that the XPath you use has to result in a node, than the nodes string is taken as a service.
    So I am afraid there is no easy solution for your problem...
    If you do not have too many receivers and this list is rather static, you could of course use conditions in the receiver determination - something like:
    receiver service = SAPR3_b if /.../ = abc
    but this is of course not really applicable if the list of possible receivers gets too long.
    Another possibility would be to use the substring as a receiver within the configuration. So take it from the payload in the receiver determination and use this 'service' for interface determination and receiver agreement.
    Than, within the receiver agreement you can exchange this name by the 'real' name in the header mapping (which is performed as the very last step in the pipeline). Since you have a receiver agreement per receiver anyway, you would not have to create additional configuration objects. The downfall is of course, that to 'read' the configuration (or the message monitoring) one has to know about this mapping trick...

  • Receiver Determination - condition editor

    Hi,
    I have a receiver determination which receives files and the filename determines where the file is sent/routed. I am using the condition editor for this functionality and need some help. The filename contains the following format 'xxxxxx010xxx20070101.out' where xxx represents different codes depending on the extraction. I used the following in the condition editor:
    ++++++010* I understood each + to represent a character. This is not working, any ideas?
    Thanks,
    Leanne

    you can utilize XPATH functions in your conditions to acheive the same.
    Try to take the help of the following weblog and maybe the string functions of xpath to achieve your results.
    ref:
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    http://www.w3schools.com/xpath/xpath_functions.asp#string

  • Receiver Determination conditions

    Hi All
    We have a scenario where a IDOC is trigerd in the ecc system and multiple IDOC is send to the XI system. Only when a certain field is 3  char or 5 char or 7char long should the file be dumped on the server. Is is possible to have a condition in the receiver determination to say if the field is between 100 and 999 or between 10000 or 99999 or between 1000000 and 9999999 to only create the files?
    Any help will be appreciated.

    hi,
    Its quite easy to achieve this requirement.
    You can edit the xpath in the Recv. Determination and then in combination with xpath standard functions achieve this.
    have a lo0k at my blog - Customise your 'XPATH' Expressions in Receiver Determination
    Also for xpath functions ref: http://www.w3schools.com/Xpath/xpath_functions.asp

Maybe you are looking for

  • High availability error on presence

    Good Day, I have problem with HA on cisco presence cluster , the error is showing that Node status for the high avaliability is (Running in Backup Mode) and Node Reason (Peer Down During Initialization). I have restart Sip proxy service  as request f

  • Problems skinning/styling ComboBox component

    So the first image is the design brief, and below it is my attempt so far. Some ways to go, and the limitations and scarce documentation of this process is getting to me. So i'm putting a call out to see if anyone's well across this process and could

  • HR DB table to find out PERNER using first or last name of the person

    Hi all, just wanted to know from which HR DB table we can find the Personal number by passing First name or last name of the person. Thanks in advance, Vithal

  • Best Practices for Implementing Cryptographic VPN

    With Marcin Latosiewicz Welcome to the Cisco Support Community Ask the Expert conversation.  This  is an opportunity to learn and ask questions about implementing cryptographic VPN and how to prepare it for the future with expert Marcin Latosiewicz. 

  • Why am I getting this error message in my DITA Topic? "Element (concept) is undefined"

    Frame 11 DITA 1.2 I was finally able to create a DITA topic (rather than a reference, concept, or task). However, when I try to insert a task, concept, or reference element after the prolog, I get the following error message:      Element (concept [o