cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I'm trying to build a query using the standard Node.JS CAP library via the SELECT.from(...).columns(...), and inside the columns function, I'm expanding some column, such as SELECT.from(...).columns((item) => item.column((c) => c`.*`)). So, the question is: how can I get a result with c`.*` columns as a flatten structure, not directly provided as an object?

I mean, after this query execution, I got the following structure:

{
   "ID": "some-id",
   "name": "some column value",
   "column": {
       "ID": "some-id-from-nested-column",
       ...
   }
   ...
}

But, I want to receive something like:

{
   "ID": "some-id",
   "name": "some column value",
   "column_ID": "some-id-from-nested-column"
   ...
}

Thanks!

View Entire Topic
gregorw
SAP Mentor
SAP Mentor
0 Likes

Have you tried creating a view that solves your requirement. That way you maybe don't need any additional coding.