on 07-18-2011 6:53 AM
Hi Gurus,
I am working on a scenario which is File to JDBC. I need to fail the Interface when the header value is not eaqual to "EN". For example I have the input file format like this below
EN 01\01\2010(Header)
US HJ UU 123
US JJ II 123
002(footer)
I wanted to check the first field of header value is equal to "EN". if not equal to "EN" then I need to fail the mapping. Can I achieve this in the graphical mapping. Please explain..
Regards,
Kevin
What do you mean by Fail the Interface??
you want red flag in Moni with mapping exception?? if yes then refer previous replies.
else let us know what you want to do if condition not satisfies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.. it is solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kevin,
You can use this simple UDF before mapping the EN value to target.
If you use this UDF then you cann see the custom mapping fail reason in SXMB_MONI.
In support phase it will be easier to monitor the interface with custom error message.
public String check(String input, Container container) throws StreamTransformationException{
if(input.equals("EN"))
{
return input;
}
else
{
throw new RuntimeException("Value is not equal to EN");
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kevin,
Keep the cardinatility/ occurance of the field as mandatory. Map the source and the target field with Ifwithout condition.
field-->If (field=EN) then -->target field.
If the value is not equal to EN then it automatically fails.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kevin,
If the target field is mandatory for the Header field that you are mapping then you can fail the mapping(Field Occurence is 1...1).
Just use the If condition and map to target only when it is EN. If not satisfied it will fail.
If the Target is not Mandatory field(Occurance is 0..1) then use an UDF to fail.
Thanks and Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.