on ‎2019 Jun 24 1:40 PM
Hi All,
I have similar following requirement could anyone tell me whether this is achievable in SCPI. If yes, Pls help?
Input Xml
<Input>
<value>1,2,3,4,5</value>
<Input>
Output Xml
<Output>
<value>1</value>
<value>2</value>
<value>3</value>
<value>4</value>
<value>5</value>
</Output>
Please let me know the possibilities
Thanks
Ansari
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi Ansari
A user-defined function will solve that for you. Add the following function:
import com.sap.it.api.mapping.*
def void splitByComma(String[] s, Output o, MappingContext c) {
s[0].split(',').each { v -> o.addValue(v) }
}Then wire it up as follows:

Simulating with your input data, I get the following result:

Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice to see you giving Message Mapping some love! 😉
Hi 7a519509aed84a2c9e6f627841825b5a , Thanks for your help. but it is not working with my actual scenaio.
I give you my input xsd and output xsd, Please help
I want to split shippingComment field by comma and mapped to TEXT_LINE field
Input_XSD input-xsd.txt
Ouput_XSD output.txt
please remove first letter from output.txt and convert to xsd.
Thanks in Advance
Ansari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.