on 09-11-2009 4:42 PM
I am using the example java code "RetrieveLimitedRecords" that can be found at :
https://help.sap.com/javadocs/MDM71/current/API/index.html
The code give the expected result and retrieves the record count for the main table
Now I want to get the values of the fields for one record
I added the lines:
Record[] records = recordResultSet.getRecords() ;
FieldId[] fields = records[0].getFields();
System.out.println ("Field Length = "+fields.length);
and the output is::
Field Length = 0
How can I get the fields of the record and read their values?
Thanks
Nicolas
Nicolas did you put fields in the ResultDefinition object? You have to tell MDM what fields you want to retrieve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assuming you want every field, the equivalent of "SELECT *" in SQL, you can use the RepositorySchema object to get a TableSchema, and with that get all FieldIds for the table.
If your RepositorySchema variable is rs it would be something along the lines of:
TableSchema mainTableSchema = rs.getTableSchema(mainTableId);
ResultDefinition rd = new ResultDefinition(mainTableId);
rd.setSelectFields(mainTableSchema.getFieldIds());
Hope this helps,
Greg
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.