Skip to content

Instantly share code, notes, and snippets.

@SriniBlog
Created December 16, 2015 14:27
Show Gist options
  • Save SriniBlog/96e7b868ea191d79241b to your computer and use it in GitHub Desktop.
Save SriniBlog/96e7b868ea191d79241b to your computer and use it in GitHub Desktop.
This snippet shows how to read parameters from Java Mapping in SAP PI
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException
{
try{
String Parameter1 = arg0.getInputParameters().getString("PARAM1");
String Parameter2 = arg0.getInputParameters().getString("PARAM2");
String Parameter3 = arg0.getInputParameters().getString("PARAM3");
OutputStream out = (OutputStream) arg1.getOutputPayload().getOutputStream();
out.write( ("PARAM1 = " + Parameter1 + "\r\n").getBytes() );
out.write( ("PARAM2 = " + Parameter2 + "\r\n").getBytes() );
out.write( ("PARAM3 = " + Parameter3 + "\r\n").getBytes() );
}catch(Exception ee){
throw new StreamTransformationException("Error while reading the parameterized mapping.".concat(ee.getMessage()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment