本文整理汇总了Java中com.sap.conn.jco.JCoStructure类的典型用法代码示例。如果您正苦于以下问题:Java JCoStructure类的具体用法?Java JCoStructure怎么用?Java JCoStructure使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JCoStructure类属于com.sap.conn.jco包,在下文中一共展示了JCoStructure类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStructureParameter
import com.sap.conn.jco.JCoStructure; //导入依赖的package包/类
/**
* Sets a single Importing or Changing parameter that is a structure
* @param name the name of the parameter
* @param map the value of the parameter
*/
public void setStructureParameter(String name, LinkedHashMap map)
{
//Find structure parameter with this name and set the appropriate values
JCoFieldIterator iter = function.getImportParameterList().getFieldIterator();
while(iter.hasNextField())
{
JCoField f = iter.nextField();
if(f.getName().equals(name) & f.isStructure())
{
Iterator fieldIter = map.entrySet().iterator();
JCoStructure structure = f.getStructure();
while(fieldIter.hasNext())
{
Entry field = (Map.Entry)fieldIter.next();
structure.setValue(field.getKey().toString(), field.getValue().toString());
}
}
}
}
示例2: message2FunctionCall
import com.sap.conn.jco.JCoStructure; //导入依赖的package包/类
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);
}
}
示例3: StructureHandler
import com.sap.conn.jco.JCoStructure; //导入依赖的package包/类
public StructureHandler(JCoStructure structure) {
super(structure);
}