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.

Similar Messages

  • 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

  • Error evaluation condition in receiver determination

    Hi,
    In XI 3.0 stack 11, for the incoming file, the receivers are determined based on the content of the input data.
    In the receiver determination the conditions were given for each receiver and it was working fine.
    Now, all of a sudden, its giving error as 'error in evaluating the condition in receiver determination' with some program name as CL_SAI_SWF_RULE_ENGINE (CX_RD_PLSRV).
    Could any one help me resolving this issue? Let me know if you need any more details w.r.t the issue.
    Thanks in advance!!
    Regards,
    Sasikumar

    Hi,
    I'm experiencing the same problem.  See message below. Also running SP11.  What might be wrong with the xpath expression?  I have removed all namespaces from the xpath and the input xml message.  Any suggestion is more than welcome!
    Kind regards, Guy Crets
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <!--  Receiver Identification
      -->
    <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 evaluating a condition: The exception occurred (program: CL_SWF_RLS_CONDITION==========CP, include CL_SWF_RLS_CONDITION==========CM00Q, line: 160)</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error when determining the receiver: Problem evaluating a condition: The exception occurred (program: CL_SWF_RLS_CONDITION==========CP, include CL_SWF_RLS_CONDITION==========CM00Q, line: 160)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

  • 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 in receiver determination

    Hi,
    I am using PI 7.1. My input message is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_EODReport xmlns:ns0="http://hsbc.com">
       <Record>
          <ReportDate></ReportDate>
          <ACHEODReportFlag></ACHEODReportFlag>
       </Record>
    </ns0:MT_EODReport>
    I want to put a condition in Receiver Determination to check whether   <ACHEODReportFlag> tag contains value 'X' . How should i put this condition?

    >
    Shilpa Korad wrote:
    > Hi,
    >
    > I am using PI 7.1. My input message is
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <ns0:MT_EODReport xmlns:ns0="http://hsbc.com">
    >    <Record>
    >       <ReportDate></ReportDate>
    >       <ACHEODReportFlag></ACHEODReportFlag>
    >    </Record>
    > </ns0:MT_EODReport>
    >
    > I want to put a condition in Receiver Determination to check whether   <ACHEODReportFlag> tag contains value 'X' . How should i put this condition?
    Condition Editor of RD....Left operand select Xpath and choose the node that you want  click Ok.......from the dropdown select = operator.....Right Operand select Constant and give the value as X....

  • Conditions in Receiver Determination

    Hi
            I am doing a scenario in which we are sending PO from R3 to one of two different web-services through XI using RFC.We have already transported our scenario to Production.Using RFC we are executing Webservice.
            Now there on production we want to put conditions in receiver determination according to message data. In F4 help of condition it is not showing message feilds so I filled condition manually but it is not woking. Is there any other way to put conditions there?
           Have anyone face this problem?
           what is the soution of this problem.
           Its urgent!!
    thanks in advance
    Regards
    Sami
    Message was edited by:
            sami qureshi

    Hi Sami,
    Strongly suggested: Do the changes in Dev and re-transport.
    in dev u may create a context obj and assign that to ur msg interface. and use this context obj for conditional routing.
    Hope it helps.
    Regards,
    Latika.

  • 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

  • Reg. condition based receiver Determination

    Hi,
        I need to send the records to two systems based upon the value
    For Ex. All the material group record letz say (1,2,3,4,5,6) Shuld go to Receiver1 and only the records which belongs to material grp shud go to Receiver2.
    I am trying using Condition based Receiver Determination
       For Receiver 1 :-
                  I didnot give any condition.Coz all the records have to go to Reciver1.
       For Receiver 2 :-
                     I have written the condn in the Interface determination
                i.e) Material Group = 2.
    But  All the records are going to these two receivers.I have tried everything.
    Thanks in advance
    Regards
    Anandan

    Anandan,
    Similar situation has worked for me. Please check the condition you have mention in Interface Determination.
    In the Interface determination you need to have 2 inbound interfaces. Specify the respective condition for each inbound interface.
    Example: if the Response field has the value as "Success" or "Failure" the message has to go to first interface. The message has to go to second interface only if the response is "Failure". so you can provided following condition in the interface determination:
    <b>Condition 1:For first inbound interface</b> (/p1:MessageType/RecordSet/Response = F) OR (/p1:MT_RESPONSE_FROM_PS_BI/RS/Response = S)
    <b>Condition 2:For second inbound interface</b> (/p1:MessageType/RecordSet/Response = F)
    The above condition has worked for me. Hope this would be helpful to you.
    Regards,
    Sridhar

  • Special characters conditions in receiver determination

    hi there,
    i have the following problem:
    There are conditions in receiver determination to find the proper xsl mapping for different segments in IDocs.
    That works fine.
    But if there are special characters like &, the interface mappings can't be found, because for the conditions the xml is already corrupt.
    So, i've tried to replace all occurrences of & with &amp; in a java mapping that is called before the xsl mappings.
    It doesn't work, because in that case conditions are processed before the java and xsl mappings.
    Do you have any idea how to replace special characters before conditions in receiver determination are processed?
    thx in advance
    Stefan

    Handling the Special Characters in XI
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    Find out which character encoding the receiver system expects and put the same to the receiver channel.
    By default the file adapter would create a file with UTF-8, which might not be useable for the receiver.
    check this thread.
    Handling Special Characters
    check the document :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Depends upon encoding methods handling will differ,
    you can use ISO-8859-1 or ISO-8859-2 instead of UTF-8 for some special characters.
    check this blog:
    Unicode File Handling in ABAP
    *Suppress Special Character *
    Suppress Special Character

  • PI 7.1 - condition during receiver determination

    Hi,
    I am trying to do the receiver determination condition in the condition editor of integration directory but XPATH or context objects of my interface (corresponding to my software component version) do not appear in the window for maintaining the condition.
    I had no difficulty when following the same process during 7.0 or earlier versions but it seems to be issue in PI 7.1.
    Anyone else also faced a similar situation or is there any extra step I need to ensure before going for receiver determination (standard not enhanced)?
    Your help would be appreciated.
    Cheers.

    My scenario is:
    Source system -> PI (ccBPM) -> Target system
    Now I have number of ccBPMs and there would be one picked up based on the payload from source system interface. For this my configuration objects are as follows:
    Sender agreement with (source comm component and source system outbound interface)
    Receiver determination - at this stage I want to figure out which ccBPM should get executed and hence condition based on payload
    interface determination - goes to receiver step of ccBPM with message type same as outbound interface from source system
    I have another receiver determination, interface determination for target system interfaces from ccBPM and then receiver agreement.
    But in this overall scenario key part is first receiver determination step where ccBPM as receiver is to be determined.
    I checked up all my objects again to find out any missing gap from my understanding. But I am not able to get the interface (source system interface) in the condition editor. I tried maintaining the XPATH manually but it ends in error during execution suggesting that receiver could not be determined.
    Any more suggestions please?

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

  • Routing condition in receiver determination

    Hi,
    In my RFC to JMS scenario, i encountered with a strange routing condition for the receiver determination.
    I have routing condition like " string length (one field in Bapi)<1" .
    Could any one help me how to implement this?
    Regards,
    Vishnu.

    HI check the below links for reference
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=transactional
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a1a0eb43-0b01-0010-23aa-908cc4eaabcd
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.sdn.folder.sdn!2fco...
    note:reward points if solution found helpfull.....
    regards
    chandrakanth.k

  • Generic condition in Receiver Determination

    hi,
    in receiver determination, we can define a Condition, but in condition editor, under "context object", we have only some standard parameters of PI adapter like "FileName" like http://sap.com./xi/XI/System/file used in Dynamicconfiguration. I saw also some of seeburger... so...
    How can we define our own "_generic_" condition ? Do I need to create an Adapter ?
    Note: I do NOT want to define a context object (in ESR) and affect it to a field of a service service, because it's limited to one interface , and I want a generic context which could be used for all interfaces (already developped and to be developped).
    Thanks.
    Mickael

    hi Himadri,
    thanks for your interest, but no, that's not my subject. I want neither a specific context object based on only one service interface (your blog) nor to define dynamically the receiver by using mapping functions... I would like to have my own predefined context in Context Objects like these of SAP, example: Filename from DynamicConfiguration of a FILE adapter.
    I know my topic is a litle too technic... but it's a part of a more global solution (*) to do a pre-control on all my existing interfaces (!). so the solution should be as less intrusive as possible: I do not want to change in depth all my interfaces... supens...
    Regards.
    Mickael
    (*) I'm studying different ways, and this topic is one of them

Maybe you are looking for

  • How do i delete all my pictures from iphone

    I need to delete photos from iPhone 5.  Need to delete them ALL as I need space on the phone and I don't want to individually click 1000+ pix. They are already backed up to Dropbox. There appears to be no way to do this. Any suggestions (other than s

  • Logical database AA- *Accumulated depreciation* & *Original Acquistion Cost

    Hi I am creating a SAP QUERY report with logical data base AA in asset accounting.Can anyone suggest me on what fields to be taken for the below values: Accumulated depreciation   - Depreciation posted till date (including the ACC dep +current year d

  • Can I dismount Drive E safely to free up space to continue reinstalling software

    I have reinstalled all software back to factory settings.  While reinstallation occurred, computer game me "Warning Low Disk Space".   Can I condense programs so they don't take up so much space?  or Can I dismount Drive E safely to free up 4 to 6 GB

  • Lost folder from import to lightroom5

    i just installed Lightroom5 and imported some folders from Picasa. now when i try to develop photos from a particular folder Lightroom says that it can not find the folder. and the folder is missing from Picasa. but there are images from the folder w

  • Trouble with IE 7 CSS

    I don't know what is happening, but for some reason IE 7 seems to be the only browser with this issue. If you view this page: http://www.parkwaygaming.com/index2.php you will notice that the spry menu works, but the background feature is not loading