How to map an Object of objects to a SAP List?

The answer to your question is 'NO'. It is not possible to map your complex JSON object (object of objects) to a SAP list <Objects> as it does not make structural sense.

Why This Mapping Doesn't Work

SAP lists expect a flat structure of similar objects, while an object of objects creates a nested, hierarchical structure. This fundamental difference in data organization prevents direct mapping.

Example Structure Comparison

Here's what you might have (object of objects) ?

{
  "employee1": { "name": "John", "age": 30 },
  "employee2": { "name": "Jane", "age": 25 },
  "employee3": { "name": "Bob", "age": 35 }
}

Versus what SAP list expects (array of objects) ?

[
  { "id": "employee1", "name": "John", "age": 30 },
  { "id": "employee2", "name": "Jane", "age": 25 },
  { "id": "employee3", "name": "Bob", "age": 35 }
]

Alternative Solutions

If you want to work with your data structure, you have two main options ?

Option 1: Create a JSONModel that replicates your object structure and work with it directly in SAP UI5 without converting to a list.

Option 2: Transform your object of objects into an array structure first, then map it to the SAP list if this suits your requirements.

Conclusion

Direct mapping of nested object structures to SAP lists isn't supported due to structural incompatibility. Use JSONModel for complex structures or convert to array format first.

Updated on: 2026-03-13T17:57:23+05:30

266 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements