on 01-07-2010 8:08 AM
Hi
I have a scenario which is a Idoc to file scenario. Here I want to continue with mapping only if the field MATNR exists on the source side (Idoc) otherwise I should get a message on the target side that the "Mapping failed because MATNR field does not exist " and the mapping should fail.
There are two independant MATNR fields and mapping should fail if I either of them does not exist.Please keep in mind that there indepandant of each other.
Please help
Thanks in advance
Use exists (Node function) for both the MATNR fields and then Boolean function AND so that the result will be true only if both the MATNR fields exists. But here you need to take care of contexts. But as the mapping step failed there won't be any message to target node.
Else use conditional receiver determination and check the existance of MATNR fields in source payload and route the message accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to write an UDF with exception. In exception you can write your message (the reasone of failure).
something like this..
//Mapping trace will add the warning to show in MONI (if trace level is set to 1 atleast in Tcode SXMB_ADM).
MappingTrace trace = container.getTrace();
for (int i = 0; i < MATNR.length; i++)
{
if(MATNR<i>.equals(""))
{
trace.addWarning("MATNR is missing.");
throw new RuntimeException("MATNR is missing.");
}
}
abvoe code is just an example, you have to modify and put the logic as per your need.
Regards,
Sarvesh
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.