on 10-04-2018 6:59 AM
Hi Experts,
I have requirement in message mapping of iFlow, which is to read a collection of strings and concatenate it together and map to one of the target fields.
I am not sure how to do it as I am new to CPI side. Please help me out how to map it.
I have a source node which comes as list, I have to read this and set to target field
Thanks in Advance
Hello Ansari,
Below will do the same.Make sure you have set the right context in source field and set the P1 in your custom function as array like below
import com.sap.it.api.mapping.*
def String extParam(String[] P1 , MappingContext context)
{
//Your processing will go here
//P1[0] will have first value P1[1] will have second and so on....
String v = P1[0].toString();
return pval;
}
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sriprasad,
The moment add [](square bracket in the String param, I am unable to save the script. It keep gives me error saying Script contain no valid function.
Removing [] square bracket from String param works fine. No clue.
getting below error for above code while click on OK button in SAP CPI Web UI
Pls help me out on this
Hi,
On top of the GSH shared above, when input will be given in this custom function in the MM user remove context node function before providing the input.
To concatenate modify the script like below -
for (int i=0; i<p1.length; i++)
String v = P1[i].toString().concat("");
return v;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.