Hi Experts, I have a requiremnet to fail the mapping if value mapping lookup (standard valuemapping) fails...
For example
vendor --111 --valuemaplookup to aaa ---target =aaa
if vendor 222 does not have value defined in value map table it has to fail the mapping...I am not sure its not working its outputting 222 in the target , any idea whats the cause.
Regards
Ravikiran
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as far as i know, i think in 7.0 this option of throw exception in value mapping properties is not available. so you can create a UDF using if condition to check for your source values, in then map it to target values and in else condition (if no condition satisfies) throw an exception using throws statement.
You could find the code that Rajev suggest in http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf4...
Pages 14 to 16.
Regards.
the situation is slightly tough now.........use the below URL to see the class, interface and methods and try to invoke it in your UDF:
http://help.sap.com/saphelp_nwpi711/helpdata/en/f2/dfae3d47afd652e10000000a114084/frameset.htm
the doc provided by inaki above also uses these and has a better detailed description to use these.
use executeMapping function in your UDF. so if it returns null in UDF, then throw exception.
so in graphical msg mapping, the valuemapping node will be replaced by your UDF having all the input parameters as constants except the source value field in your graphical msg mapping for executeMapping function.
If you have a large number of values you should use for example an RFC Lookup function. I don't know if it is available in SAP PI 7.0.
You could use the code from here http://wiki.sdn.sap.com/wiki/display/Snippets/User-defined+Mapping+Function+for+RFC+Lookup
Regards
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 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.