Skip to Content

Is there anyway to add separator in content filter SAP HCI

I want my output like A,B

Is it possible through Content filter

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 28, 2016 at 09:05 AM

    Hello Aditya,

    Below might help you.

    import groovy.xml.XmlUtil
    import com.sap.gateway.ip.core.customdev.util.Message;
    import java.util.HashMap;
    
    def Message processData(Message message)
     {   
       def body = message.getBody(java.lang.String);
       def str=""
       def list = new XmlSlurper().parseText(body)
       list.CompoundEmployee.each
       {
         str=str+it.person.person_id_external.text()+","
       }
       message.setBody(str);
       return message;
    }

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 27, 2016 at 10:05 AM

    Hello Aditya,

    Could you please elaborate more on the requirement.Please share input and what output you are looking for.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sriprasad,

      I am fetching the personnel id from compound employee of the employees having seq_number(Job information) greater than one for that i am using router and after that content filter to fetch ONLY Personal_id_external.

      In Content Filter i gave xpath as

      //person/person_id_external/text()

      Now thing is if more than personal id is there then content filter give output like AB but i want my output like A,B(A and B are personal_id_external)

      Is there any way i can get comma after each personal id by using content filter?

  • Dec 28, 2016 at 04:57 AM

    Hello Aditya,

    There is no option to add a separator in Content Filter.

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded