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.

Similar Messages

  • 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.

  • 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

  • Problem in receiver determination

    hi experts
           I am working on a idoc to file bypass scenario where i am using extended receiver determination ,abap class is being used for abstract interface mapping ,It is working fine with other interfaces.but on a particular idoc its started showing error in sxmb_moni that"Error when determining the receiver: Problem wh
    determining receivers using interface mapping:
    Error in mapping program
    /GLB/CL_ZGTIS_GNERIC_ROUTING (type SAP-ABAP,
    kernel error ID CREATE_OBJECT_CLASS_NOT_FOUND)" so can u tell where is the problem i have crosscheked the abap class very well all entries r right.
    plz update its urgent

    hey i have done a mistake in writing the class name in the mapping ............

  • 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

  • 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!

  • Problems with Receiver Determination

    Hi everybody.
    I have started as XI developer 2 weeks ago.
    I'm trying to replicate de tbit40 exercises in our company system. when i try to make the 'Receiver Determination' somethings happen. It doesn't appear the part to write the system receiver.
    This is my scenario : file->XI->IDOC.
    I've defined in the SLD the hardware, including one PC, the XI server and the SAP 4.6c server.
    This is only a test in order to check the connectivity between the PC and SAP R3. I haven't configured yet the part of the IDOC in the R3 system. Is this necesary to view the 'subwindow' of system receiver?
    Thanks.

    Hi everybody,
    I'm having some problems with the sender agreement and the receiver determination, let me explain you the scenario: i'm trying to translate inbound plain text files to XML to a outbound interface for MDM.
    An XI consultant (expertise) has successfully created the inbound - outbound interface mappings for vendors catalog, it has worked good since he set it up, but now that i'm trying to create the materials mapping according to the manuals step by step, and when i try to create the receiver determination settings, i can't find my interface mappings, the pop-up window return 0 objects for interface mappings (that i have already created and linked with msg types).
    So what can i do? Do you have any idea?
    Regards.
    Gerardo.

  • Problem in Receiver determination in case of BPM ASNElectronicLabelPost

    Hi
      I am working on AII flexible delivery scenario its a RFID scenario.
      XI is part of this architecture.
      In one BPM ASNElectronicLabelPost  receiver service is selected based on <b>condition</b>.
      the condition is ProcessStep=ASNtoAII based on which the concerned service needs to be selected.
       I am getting the following <b>Error</b>
    SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">CX_RD_PLSRV</SAP:Code>
      <SAP:P1>Problem extracting values from the message: The exception occurred (program: CL_SWF_RLS_CONDITION==========CP, include CL_SWF_RLS_CONDITION==========CM00Q, line: 161)</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when determining the receiver: Problem extracting values from the message: The exception occurred (program: CL_SWF_RLS_CONDITION==========CP, include CL_SWF_RLS_CONDITION==========CM00Q, line: 161) Problem extracting values from the message: The exception occurred (program: CL_SWF_RLS_CONDITION==========CP, include CL_SWF_RLS_CONDITION==========CM00Q, line: 161) The exception occurred (program: CL_SWF_RLS_CONDITION==========CP, include CL_SWF_RLS_CONDITION==========CM00Q, line: 161) The exception occurred (program: CL_SWF_RLS_COMPARISON=========CP, include CL_SWF_RLS_COMPARISON=========CM002, line: 63) The exception occurred (program: SAPMSSY1, include , line: 0) The exception occurred (program: CL_SWF_EXP_EXPRESSION=========CP, include CL_SWF_EXP_EXPRESSION=========CM027, line: 50)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Please help me solve this error.
    Thanks in advance.
    Regards,
    Amit Deshpande

    Hi,
    here is the coding
      IF error_id CA 'EAX'.
    <b>**** If a non-trivial error_map is active and an error still occurs,
    this indicates a condition syntax error or a system error.</b>    CLEAR temp_result.
        LOOP AT lt_errors ASSIGNING <swa_error>.
          MOVE-CORRESPONDING <swa_error> TO t100_msg.
          CREATE OBJECT lcx_exception
            EXPORTING
              t100_msg = t100_msg
              previous = lcx_ifs.
          IF m_last_exception IS NOT BOUND.
            m_last_exception = lcx_exception.
    I would check the condition. First simplify the condition and look if the error still exists.
    Regards Mario

  • 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

  • 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

  • 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

  • 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...

  • Using Xpath in Receiver Determination for greater than 500

    Hi,
    I am trying to use Xpath in the receiver Determination step and I want to check a field which is at item level and comes multiple times(0-unbounded) greater than 500.I tried with different options per SDN blogs,Xpath functions,but still I couldn't able to get what i am trying.I want to process the message when "quantity" is greater than 500,else I want to ignore the message with no errors.
    I gave like this    /p1: /LIST/item[quantity>499]     EX
    item loop is 0-unbounded and I need to check for every quantity.I selected the check box multi line as well.
    I played around different options,but still did not get what I am looking for.
    please suggest in this regard ,how I need to give the expression.
    Thank you,
    Sri

    Hi,
    For validating that the item field is occuring more than 500 times you need to choose the
    2.The exact XPath would be in your case *(/p1: /LIST/itemquantity[499]EX)*
    This means if the 500 th occurance of the item exists then the condition satisfies that is always true for 500 and above occurance of the item.
    Please revert if the suggestion proves to be helpful.
    cheers,
    Abhishek.
    Edited by: Abhishek  Paul on May 6, 2010 10:55 PM
    Edited by: Abhishek  Paul on May 6, 2010 11:02 PM
    Edited by: Abhishek  Paul on May 6, 2010 11:08 PM

  • 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

Maybe you are looking for

  • How do I create a db in Oracle 9i Lite?

    I have used Oracle 8i Lite on handheld computers in a replicated environment for quite some time now. I am in the middle of setting up a demo tablet computer, but since Oracle 8i Lite is no longer downloadable from the Oracle website, I instead downl

  • Do I need to buy a transfer charger if I bring my IPAD MINI from US to UK? Or can I just bring the original charger to UK?

    I bought the ipad in US. And I will go to UK fr some days. I'm afraid the charger in UK can't fit my ipad. So do I need to buy a tranfer charger to fit it or just use my pringinal one ?Thx

  • Do all monitors work from MacBook?

    Hello there, Im looking to purchase a 27" monitor for my macbook. Im looking at the benq 27", have asked them the same question. Will it work? I'll be using a mini-DVI connector. Whats best, DVI or HDMI ? im aware you can get converters. The monitor

  • Doubt Regarding Merge Statement in Oracle

    Hi, I have an SP which takes 3 parameters Lets say (in_empid, in_empname,in_age) here in_empid corresponds to the empid ie primary key for update/insert Now which of the approach will be better. Will there be problem in using Merge statements for upd

  • I tunes, cloud, match help

    I recently purchased a new MacBook Pro. I have used I tunes match before quit successfully, However, I have unsuccessfully tried to get music on the new computer. The icon for "matched" shows up but I can not download any of the music. I have searche