Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
arnabdatta3
Participant
HI all,

If you are creating CDS views and importing it as a reference data source in SEGW, you may face ST22 dump or exception while generating runtime objects. It happens du a very small error in CDS.

 

The below CDS is created. (incorrect One)

 
@AbapCatalog.sqlViewName: 'ZAAA'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CDS'
@OData.entitySet.name: 'accidentSet'
@OData.entityType.name: 'accidentType'
@VDM.viewType: #CONSUMPTION

define view ZAAAA as select from za
{

key za.value as value,
za.text as text
}

Import the CDS view as referecne in SEGW project.


Now if you try to generate the runtime object, you will get the below ST22 dump.


 
To resolve this, please follow the naming 

@OData.entityType.name: 'accidentType'

Entity type name should always end with 'Type'.

 

And entitySet name should be always the entity name without the type, in this case it will be 
@OData.entitySet.name: 'accident'

 
Correct CDS:

@AbapCatalog.sqlViewName: 'ZAAA'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CDS'
@OData.entitySet.name: 'accident'
@OData.entityType.name: 'accidentType'
@VDM.viewType: #CONSUMPTION

define view ZAAAA as select from za
{

key za.value as value,
za.text as text
}

Now, if you regenerate the object, SAP will not give you error. Hope this helps. Good luck coding! 🙂
  • SAP Managed Tags:
Labels in this area