Skip to Content
0
Former Member
May 04, 2011 at 07:55 AM

How to fail message in Java mapping

171 Views

Hi All,

My requirement is very simple.

i have to check value of a field "RFCResponse" , it will have 2 values ( S ,F) means sucsess or failure.

If "RFCResponse" = "F". I need to fail the Java mapping and in the SXMB_MONI , error step i should get a message

"Java mapping failed since RFC look up failed.

below is part of my code

public class JavaMapping extends AbstractTransformation {

..................
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {

try (if RFCResponse = "S")
	{
	//8. The JAVA mapping output payload is returned using the TransformationOutput class
	// arg1.getOutputPayload().getOutputStream()
		arg1.getOutputPayload().getOutputStream().write(RFCResponse.getBytes("UTF-8"));
	}
	catch(Exception exception1) { }


}
}

Please kindly let me know how to write code when RFCResponse = "F"