本文整理匯總了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());
}
}
}
}
}