use of com.sap.conn.jco.JCoStructure in project iaf by ibissource.
the class SapFunctionFacade method message2FunctionCall.
public void message2FunctionCall(JCoFunction function, String request, String correlationId, ParameterValueList pvl) throws SapException {
JCoParameterList input = function.getImportParameterList();
int requestFieldIndex = findFieldIndex(input, getRequestFieldIndex(), getRequestFieldName());
setParameters(input, function.getTableParameterList(), request, requestFieldIndex);
if (pvl != null) {
for (int i = 0; i < pvl.size(); i++) {
ParameterValue pv = pvl.getParameterValue(i);
String name = pv.getDefinition().getName();
String value = pv.asStringValue("");
int slashPos = name.indexOf('/');
if (slashPos < 0) {
input.setValue(name, value);
} else {
String structName = name.substring(0, slashPos);
String elemName = name.substring(slashPos + 1);
JCoStructure struct = input.getStructure(structName);
struct.setValue(elemName, value);
}
}
}
int correlationIdFieldIndex = findFieldIndex(input, getCorrelationIdFieldIndex(), getCorrelationIdFieldName());
if (correlationIdFieldIndex > 0 && input != null) {
input.setValue(correlationIdFieldIndex - 1, correlationId);
}
}
Aggregations