Skip to Content
0

Is there anyway to add separator in content filter SAP HCI

Dec 27, 2016 at 09:23 AM

79

avatar image

I want my output like A,B

Is it possible through Content filter

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Sriprasad Shivaram Bhat Dec 28, 2016 at 09:05 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks alot !!!

Script is working :)

0
Sriprasad Shivaram Bhat Dec 27, 2016 at 10:05 AM
0

Hello Aditya,

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

Regards,

Sriprasad Shivaram Bhat

Show 1 Share
10 |10000 characters needed characters left 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?

0
Sriprasad Shivaram Bhat Dec 28, 2016 at 04:57 AM
0

Hello Aditya,

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

Regards,

Sriprasad Shivaram Bhat

Show 2 Share
10 |10000 characters needed characters left characters exceeded

ok, Thanks for reply :)

0

Do you have any script for that ?

0