Kaidris Forge docs
Kaidris Cast (CDS & RAP)
Generates CDS view entities, behaviour definitions, service definitions, access controls and metadata extensions.
Preview · describes products that are not released yet; details are confirmed at release
Status
In development · coming soon. Get notified when it is released.
What Cast does
Kaidris Cast (CDS & RAP), part of the Kaidris Forge suite, writes ABAP CDS and RAP source files from a plain-language request. It runs locally as part of Kaidris Forge.
| File type | Extension | What Cast writes |
|---|---|---|
| CDS data definition | .ddls.asddls | view entities (interface / basic views), root + child views with compositions and associations, transactional projection views, value-help views, aggregating (analytical) views, custom entities, abstract entities (action parameters), classic DDIC-based views |
| Metadata extension | .ddlx.asddlxs | Fiori elements UI annotations: header info, facets, list columns, identification, selection fields, action buttons |
| Access control | .dcls.asdcls | DCL roles: pfcg_auth checks, user aspect, literal conditions, inheritance from another entity, several grants in one role |
| Behaviour definition | .bdef.asbdef | managed, managed with draft, unmanaged and projection BDEFs: operations, actions and functions, determinations, validations, draft actions, field control, numbering, mapping |
| Service definition | .srvd.srvdsrv | services exposing projection views with aliases |
Answers come back as one fenced block per file, each preceded by File: <file name>, ready to paste into ADT.
Quality statement (preview): Syntax- and structure-verified by Kaidris; not validated on a licensed SAP system. The verification covers syntax, the language rules the compiler enforces, the requested structure (names, keys, associations, annotations, behaviour) and consistency between files (see How verification works). Review the output as you would a colleague's code.
Worked examples (preview model output, unedited)
All object names are invented (Z namespace). Every example output is a real, unedited answer of the preview model, passed by our validator. Prompts are shortened where marked […]; table definitions and existing objects are part of the prompt (see Customer context below).
1. CDS view entity: aggregating view
Prompt
Create CDS view entity ZVV_I_VisitStats as an aggregating view on zvv_vetvisit. […table definition…] Header annotations: @AccessControl.authorizationCheck: #NOT_REQUIRED and @EndUserText.label: 'Veterinary visit statistics'. Elements, with the key elements as grouping dimensions: key SpeciesCode (from species), key Status (from status), VisitCount = count of all rows, TotalInvoiceAmount = sum of invoice with its currency, CurrencyCode.
Output zvv_i_visitstats.ddls.asddls
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Veterinary visit statistics'
define view entity ZVV_I_VisitStats
as select from zvv_vetvisit
{
key species as SpeciesCode,
key status as Status,
count(*) as VisitCount,
@Semantics.amount.currencyCode: 'CurrencyCode'
sum(invoice) as TotalInvoiceAmount,
currency_code as CurrencyCode
}
group by species, status, currency_code2. CDS view entity: value help
Prompt
We need a value help view entity called ZVV_I_SpeciesVH on table zvv_species (key code, description). Header: authorization check not required, label 'Species value help', result set size category #XS, searchable. Elements: key SpeciesCode from code, with the text element Description and default search; Description, marked as text, default search, fuzziness threshold 0.9.
Output zvv_i_speciesvh.ddls.asddls
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Species value help'
@ObjectModel.resultSet.sizeCategory: #XS
@Search.searchable: true
define view entity ZVV_I_SpeciesVH
as select from zvv_species
{
@ObjectModel.text.element: [ 'Description' ]
@Search.defaultSearchElement: true
key code as SpeciesCode,
@Semantics.text: true
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.9
description as Description
}3. Metadata extension (Fiori elements)
Prompt
Metadata extension for the projection view ZVV_C_Visit (list report + object page), layer #CUSTOMER. Header info 'Veterinary visit' / 'Veterinary visits', title VisitId. Facets: identification, plus a line-item facet for _Treatment. Hide VisitUuid. List and object page: VisitId, AnimalId, Status, SpeciesCode in that order; filters: SpeciesCode, then Status. […existing projection views…]
Output zvv_c_visit.ddlx.asddlxs (abridged: the remaining elements follow the same pattern)
@Metadata.layer: #CUSTOMER
@UI.headerInfo: {
typeName: 'Veterinary visit',
typeNamePlural: 'Veterinary visits',
title: { value: 'VisitId' }
}
annotate entity ZVV_C_Visit with
{
@UI.facet: [
{ id: 'Visit', purpose: #STANDARD, type: #IDENTIFICATION_REFERENCE, label: 'Veterinary visit', position: 10 },
{ id: 'Treatment', purpose: #STANDARD, type: #LINEITEM_REFERENCE, label: 'Treatment', position: 20,
targetElement: '_Treatment' }
]
@UI.hidden: true
VisitUuid;
@UI.lineItem: [ { position: 10 } ]
@UI.identification: [ { position: 10 } ]
VisitId;
@UI.lineItem: [ { position: 30 } ]
@UI.identification: [ { position: 30 } ]
@UI.selectionField: [ { position: 20 } ]
Status;
@UI.lineItem: [ { position: 40 } ]
@UI.identification: [ { position: 40 } ]
@UI.selectionField: [ { position: 10 } ]
SpeciesCode;
}4. Access control (DCL)
Prompt
Create the access control ZVV_R_Visit for the view ZVV_R_Visit: the element SpeciesCode is checked against authorization object ZVV_VISIT, field ZVV_SPEC, with ACTVT fixed to '03'. Mapping role. […existing view…]
Output zvv_r_visit.dcls.asdcls
@MappingRole: true
define role ZVV_R_Visit {
grant select on ZVV_R_Visit
where SpeciesCode = aspect pfcg_auth(ZVV_VISIT, ZVV_SPEC, ACTVT = '03');
}5. Behaviour definition (managed RAP)
Prompt
Behaviour definition for the managed business object ZVV_R_Visit with child ZVV_R_Treatment, strict mode 2, implementation class zbp_vv_r_visit. Root: persistent table zvv_vetvisit, lock master, etag LocalLastChangedAt, instance authorization; create/update/delete; create-by-association for _Treatment; managed numbering for VisitUuid; read-only and mandatory fields as listed; action treat (instance features, returns $self); determination setVisitId on save; validations for AnimalId and VisitDate; mapping to zvv_vetvisit. Child: dependent lock and authorization via _Visit, update/delete only. […views and table definitions…]
Output zvv_r_visit.bdef.asbdef (root entity shown)
managed implementation in class zbp_vv_r_visit unique;
strict ( 2 );
define behavior for ZVV_R_Visit alias Visit
persistent table zvv_vetvisit
lock master
etag master LocalLastChangedAt
authorization master ( instance )
{
create;
update;
delete;
association _Treatment { create; }
field ( numbering : managed, readonly ) VisitUuid;
field ( readonly ) VisitId, Status, CreatedBy, CreatedAt, LocalLastChangedBy, LocalLastChangedAt, LastChangedAt;
field ( mandatory ) AnimalId, VisitDate;
action ( features : instance ) treat result [1] $self;
determination setVisitId on save { create; }
validation validateAnimalId on save { create; field AnimalId; }
validation validateVisitDate on save { create; field VisitDate; }
mapping for zvv_vetvisit
{
VisitUuid = vetvisit_uuid;
VisitId = vetvisit_id;
AnimalId = animal_id;
[…remaining fields…]
}
}6. Service definition
Prompt
Create service definition ZVV_UI_Visit_O4 exposing ZVV_C_Visit as Visit and ZVV_C_Treatment as Treatment.
Output zvv_ui_visit_o4.srvd.srvdsrv
@EndUserText.label: 'Veterinary visit OData service'
define service ZVV_UI_Visit_O4 {
expose ZVV_C_Visit as Visit;
expose ZVV_C_Treatment as Treatment;
}What input Cast needs
- A clear request: the object to create or change, by name (
ZVV_I_VisitStats), and what it must contain (keys, elements and their sources, associations and cardinality, annotations, behaviour). The more precise the names, the closer the result. - Your data model: the tables and CDS views the new object builds on. With the setup wizard (next section), Forge adds their definitions automatically. Without it, paste the table definitions or the existing view / BDEF source into the request.
- Naming: Cast keeps the names you give it, and otherwise follows the common RAP conventions it was trained on:
Z…_I_interface views,Z…_R_root/BO views,Z…_C_projections,Z…_A_abstract entities,_Associationnames with a leading underscore,Z…_UI_…_O4services,zbp_…behaviour pools. Your own namespace (/ACME/…) is kept as given. - Relationships: the wizard's relationship diagram shows which tables and views are linked (foreign keys, associations, compositions). Those links are what Forge uses to pick related objects for the prompt, so a correct diagram means better context. Check it once after the first scan.
How verification works
Every answer Cast learned from, and every example on this page, is syntax- and structure-verified with open tools:
- syntax: our own open parsers for CDS data definitions, metadata extensions, access controls, behaviour definitions and service definitions, cross-checked with the open-source abaplint parser where it applies;
- language rules: rules the compiler enforces (e.g. key elements first,
sqlViewNameonly on classic views, lock master / draft tables / total etag in draft behaviour,pfcg_authfield mapping); - structure: the requested names, keys, associations, cardinalities, annotations, operations, actions, determinations and validations are all present and correct;
- consistency: across files, e.g. every field a BDEF mentions exists in its view, and compositions match
to parentassociations.
In short: Syntax- and structure-verified by Kaidris; not validated on a licensed SAP system. A definition can be structurally right and still need adjusting to your landscape (authorization objects, data elements, existing objects).
Customer context: how Cast uses the setup wizard
The Forge setup wizard builds a local index of your own objects (tables, CDS views, behaviour definitions and their relations) from an abapGit/ADT export, an SE11/SE16 CSV export or a read-only ADT connection. Nothing leaves your computer.
Cast can use your table definitions and source files as context. Full integration with the setup wizard (view summaries and relations) arrives in a later update.
Limits and configuration (preview)
- Not covered in the preview:<br>• DCL
combination modeandredefinition;<br>• behaviour implementations (the ABAP behaviour pool / handler classes and EML);<br>• analytical queries (@Analytics.query, transient view entities);<br>• CDS table functions with AMDP implementations;<br>• extensibility (extension includes, C0 release contracts);<br>• side-effects semantics beyond declaring them. Treat any output in these areas as unverified. - Verification: Syntax- and structure-verified by Kaidris; not validated on a licensed SAP system. Review the output and run your own code and authorization checks before transport.
- Output format: one fenced block per file with a
File:line; Cast does not create transport requests or objects in your system. - Context size: Forge selects the objects that fit the prompt budget, ranked by the names in your request and their direct relations. Name the objects you mean for best results.
- Runs locally with the rest of Kaidris Forge. Hardware and installation follow the Forge installation guide (see Getting started).
Configuration (preview)
The exact switches come with the release. Planned options:
- Use wizard context: on by default when an index exists; can be switched off for a request.
- Show what was injected: displays which tables and views Forge added to the prompt, and why.
- Context budget: how much of the prompt is used for your definitions; larger budgets help with big data models.
FAQ
Does Cast need a connection to my system? No. It runs locally. The setup wizard can read definitions read-only from an export or a read-only ADT connection, but Cast itself never connects to your system and never creates objects there.
Does my data leave my computer? No. The wizard's index holds definitions only (names, fields, types, CDS/BDEF source), stored locally. No table contents.
Is the generated code ready to use as it is? Syntax- and structure-verified by Kaidris; not validated on a licensed SAP system. Expect to review it and to adjust names of authorization objects, data elements or existing objects to your landscape.
Can Cast implement the behaviour pool (handler classes)? Not in this preview. It writes the behaviour definition; the ABAP implementation of actions, determinations and validations is outside what it covers.
Which RAP flavours are covered? Managed, managed with draft, unmanaged and projection behaviour definitions in strict mode.
Which access-control features are covered? pfcg_auth checks, user aspect, literal conditions, inheritance from another entity, several grants per role. Not covered: combination mode and redefinition.
Does it work with classic (DDIC-based) CDS views? Yes: it can write classic define view with @AbapCatalog.sqlViewName. For new development it defaults to view entities.
Requirements
Estimates, confirmed at release: Windows 10/11 64-bit (macOS coming) · 16 GB RAM recommended, 8 GB minimum · about 6 GB of disk for the shared base model, plus about 150 MB per model · a GPU is optional and makes it faster.