on 10-19-2009 3:14 PM
Hi All,
How to make mapping to fail in XI before it reaches R/3 (file to Idoc) if the source field doesnt exist. I do not want to send any empty string or any error message etc, Mapping has to fail in XI.
Any clues please?
Cheers,
Paul
use this UDF (choose value and one argument to this UDF is a(vendor))
//write your code here
if(a.trim().equals(""))
throw new RuntimeException("No Value in Vendor Field");
else return a;
map as shown below
Vendor(source Field)-------------->UDF--------->TargetField
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
You might also take the approach to check for field level validity at the Reciever Determination step.
Under Type of Reciever Determination you can build a condition for your Configured Recievers.
After creating data rules here you can end a message without error by selecting End Message Processing Without Error in the section under If No Receiver is Found, Proceed as Follows.
We've used this for transactions that we don't want to send on for mapping, but at the same time don't want to raise as an exception at the adapter layer or mapping layer.
Regards,
Aaron
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the concept of Raising Exceptions in Message Mapping.
Check these for the same
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
Regards
Seshagiri
Edited by: N V Seshagiri on Oct 19, 2009 4:55 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> Hi All,
>
> How to make mapping to fail in XI before it reaches R/3 (file to Idoc) if the source field doesnt exist. I do not want to send any empty string or any error message etc, Mapping has to fail in XI.
>
> Any clues please?
>
> Cheers,
>
> Paul
is the target field mandatory?
only in case it is mandatory it will fail in the mapping if the source data for it doesnt come.
else even if the target field is not mandatory, then you can do a check in your receiver determination and fail the message using the option Terminate Message Processing with Error (Restart Possible). for this provide a dummy receiver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for all your inputs. However, i couldnt acheive the required. My source has a field called vendor (occurance 0 to 1) and target idoc has field vendor (0 to 1). If source field vendor has some value in it then map it to target field vendor and if the source vendor doesnt have any value , then the mapping has to fail without going any further. I have used conditions like if exists / if not exists/ if exists and not equals = constant etc, but none of them helped to fail mapping.
Cheers,
Hi Paul,
>>How to make mapping to fail in XI before it reaches R/3 (file to Idoc)
Make the target field mandatry (so if source is not there target will not be created and it will fail). But in thi scase since yo have idoc in receiver you need to see the occurence of the field.. if it is 1..1 then this will help
Can you paste here what field you are trying to map in the target and what is it occurence?
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Simply check in graphical mapping with condition with "if" and "exist" function.
You may then pass this to UDF and follow this
/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prateek,
I have used if, exists, not, etc, but the mapping is not failing. It will execute with creating either empty string or not creating target element in mapping. But i want the message mapping to fail, which is like [not passing a value to a mandatory field]. I would like to see something like message mapping error in moni.
Hope, you're getting me.
Cheers,
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.