cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate a JCo table with a domain type as row type

0 Kudos

Hi colleagues,

I'm a developer of the SAP Cloud SDK and we wonder how to use JCo type JCoTable to populate a table that has a domain type as row type, e.g. "BP_PARTNR". Usually we would just use method JCoTable#setValue(String, Object) but in such cases there is no table column name to address as first argument. Or is there?

Is there a recommended API, that I've missed?

Kind regards

Alexander

Accepted Solutions (1)

Accepted Solutions (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert

Hi Alexander,

In principle this is a table of CHARs or INT if I got you right, so you could call it a vector. Assuming that the element is an int and the table is passed as the import parameter FOO.

JCoFunction function=repository.getFunction();
JCoTable vector=function.getimportParameterList().getTable("FOO");
vector.appendRow():
vector.setValue(0, 123456); //accessing the anonymous only field by using index 0
For getting the value from such a table of int values you'd invoke vector.getInt(0) for each row in order to get it as int again.

Best regards,
Markus

Answers (0)