本文整理汇总了Java中com.sap.conn.jco.JCoField.getTable方法的典型用法代码示例。如果您正苦于以下问题:Java JCoField.getTable方法的具体用法?Java JCoField.getTable怎么用?Java JCoField.getTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sap.conn.jco.JCoField
的用法示例。
在下文中一共展示了JCoField.getTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTableParameter
import com.sap.conn.jco.JCoField; //导入方法依赖的package包/类
private LinkedList getTableParameter(JCoField table)
{
LinkedList l = new LinkedList();
JCoTable t = table.getTable();
for (int i = 0; i < t.getNumRows(); i++)
{
t.setRow(i);
JCoFieldIterator iter = t.getFieldIterator();
LinkedHashMap m = new LinkedHashMap();
while(iter.hasNextField())
{
JCoField f = iter.nextField();
m.put(f.getName(), t.getValue(f.getName()));
}
l.add(m);
}
return l;
}
示例2: mapToMap
import com.sap.conn.jco.JCoField; //导入方法依赖的package包/类
private Map<String, Object> mapToMap(final JCoRecord record) {
final Map<String, Object> map = new HashMap<String, Object>();
if (record == null) {
return map;
}
final JCoFieldIterator iter = record.getFieldIterator();
while (iter.hasNextField()) {
final JCoField jcoField = iter.nextField();
final String sapFieldName = jcoField.getName();
if (jcoField.isStructure()) {
map.put(sapFieldName, mapToMap(jcoField.getStructure()));
} else if (jcoField.isTable()) {
final List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
final JCoTable table = jcoField.getTable();
for (int j = 0; j < table.getNumRows(); j++) {
table.setRow(j);
list.add(mapToMap(table));
}
map.put(sapFieldName, list);
} else {
final Object value = jcoField.getValue();
map.put(sapFieldName, value);
}
}
return map;
}
示例3: setTableParameter
import com.sap.conn.jco.JCoField; //导入方法依赖的package包/类
/**
* Sets a single Table parameter that is a structure
* @param name the name of the parameter
* @param list The value of the parameter (A LinkedList of LinkedHashmaps)
*/
public void setTableParameter(String name, LinkedList list)
{
//Find table parameter with this name and set the appropriate valies
JCoFieldIterator iter = function.getTableParameterList().getFieldIterator();
while(iter.hasNextField())
{
JCoField f = iter.nextField();
if(f.getName().equals(name) & f.isTable() )
{
Iterator recordIter = list.listIterator();
JCoTable table = f.getTable();
while(recordIter.hasNext())
{
table.appendRow();
LinkedHashMap fields = (LinkedHashMap)recordIter.next();
Iterator fieldIter = fields.entrySet().iterator();
while(fieldIter.hasNext())
{
Entry field = (Map.Entry)fieldIter.next();
table.setValue(field.getKey().toString(), field.getValue().toString());
}
}
}
}
}