on 2025 Feb 10 4:21 PM
Hi,
I am facing an issue with SAP CPI Message Mapping, where I need to control the creation of a Address field based on the CountryCode. The problem arises when CountryCode is null or empty, causing the mapping to fail.
I have tried various Mapping approaches, including ifWithoutElse(), equals(), exists(), and not(), but I still cannot get the desired output in all cases. I am reaching out to see if anyone has encountered a similar issue or can suggest a working solution.
CountryCode (Input)Processed CountryCodeOutput
"NO" | "NO" | false |
"SE" | "SE" | true |
"" (empty) | "Empty" | true |
null | "Empty" | true |
"US" | "US" | true |
This means:
I have tried the following Message Mapping functions:
Ensure CountryCode is never null before checking "NO"
Check if CountryCode is "NO"
Check if CountryCode is "Empty"
Use or() to check if CountryCode is "NO" or "Empty"
Use Not(or()) to determine if Address should be created
We attempted a Groovy script to handle null, "NO", and empty values, but encountered:
I have attached a picture of what i have. The input "CountryCode" as well as the "and" function that "CountryCode" has to be connected to with either the value "true" or "false" depending on the rules stated earlier in this post.
Thanks in advance!
Request clarification before answering.
Hi @NS502079 ,
I hope that works for you, I tested with CountryCode and without. You can also try it.
Have a nice day
Burak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.