I spun up a new CAP project in SAP Business Application Studio and thought:
“How hard can it be to show a list of incidents from a SQLite database?”
IncidentManagementCAP/
├─ db/schema.cds
├─ srv/incidentsrv.cds
└─ package.jsonschema.cds defined the usual suspects — Incidents, Customers, Status, Urgency.incidentsrv.cds exposed them through an IncidentService.
SQLite was configured as persistence.
Act 1:
[ERROR] Mismatched ‹Identifier›, expecting ‹String›BAS had “helpfully” converted my straight quotes into curly ones. Replacing them with normal ASCII quotes fixed it.
Act 2:
no such table: IncidentService_IncidentsI’d only deployed the db model, not the srv one, so the projection view didn’t exist. Adding this to package.json fixed it:
{
"cds": {
"requires": {
"db": {
"kind": "sqlite",
"credentials": { "database": "db.sqlite" },
"model": [ "db", "srv" ]
}
}
}
}cds deploy --to sqliteAct 3: BAS uses an in-memory SQLite DB by default, so every restart wiped my tables. Pointing to a real file finally made data persist.
/> successfully deployed to db.sqliteand:
IncidentService_Incidents
sap_capire_incidents_IncidentsProgress! I opened the preview app expecting rows of data … and got a pristine white screen reading:
Add columns to see the content
Nothing wrong with my code; Fiori Elements was just hiding every field until I manually selected them.
ID, title, status_code, urgency_code.Suddenly the data appeared — the record I’d seeded in sap.capire.incidents-Incidents.csv.
After days of chasing ghosts, it all came down to a UI checkbox.
using ... from "../db/schema"; line manually.db, srv), not just the schema.package.json; in-memory DBs reset on each run.Sometimes CAP isn’t broken — it’s just very literal. Between invisible characters, hidden tables, and silent checkboxes, getting to that first visible row can feel absurd. But once you’ve fought through it, you understand how the layers fit together:
Layer Purpose
| db/ | Entities and persistence |
| srv/ | OData service / projections |
| app/ | Fiori Elements UI |
| package.json | The glue holding it together |
So when someone in the forums says “My CAP service returns nothing,” you’ll smile knowingly and reply: “Check your quotes. Then click Add Columns.”
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 5 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |