Skip to Content
0
Aug 24, 2020 at 06:28 PM

Filter records in SAP CPI

212 Views

Hi,

I have requirement to filter the records based on compid

incoming xml -

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header/>
   <soap:Body>
      <ns1:Response xmlns:ns1="urn:enoc.com:HTRUAE:OrgMasterData_Portal">
         <OrganizationMaster>
            <OrganizationCompanyID>501</OrganizationCompanyID>
            <OrganizationCompanyName>ABCD</OrganizationCompanyName>
            <OrganizationDepartmentID>10000070</OrganizationDepartmentID>
            <OrganizationDepartmentName>XYZ</OrganizationDepartmentName>
         </OrganizationMaster>
         <OrganizationMaster>
            <OrganizationCompanyID>502</OrganizationCompanyID>
            <OrganizationCompanyName>ABCD1</OrganizationCompanyName>
            <OrganizationDepartmentID>10000070</OrganizationDepartmentID>
            <OrganizationDepartmentName>XYZ</OrganizationDepartmentName>
         </OrganizationMaster>
         <OrganizationMaster>
            <OrganizationCompanyID>507</OrganizationCompanyID>
            <OrganizationCompanyName>ABCD2</OrganizationCompanyName>
            <OrganizationDepartmentID>10000070</OrganizationDepartmentID>
            <OrganizationDepartmentName>XYZ</OrganizationDepartmentName>
         </OrganizationMaster>
      </ns1:Response>
   </soap:Body>
</soap:Envelope>

Filter condition -

/ns1:Response/OrganizationMaster[contains($COMPID,OrganizationCompanyID)]

Output -

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header/>
   <soap:Body/>
</soap:Envelope>

I am trying to filter the output based on the COMPID for which I have created a property.

Can someone please suggest what change i need to make this filter work?

Regards,

Akash