Skip to Content
Technical Articles
Author's profile photo Arnab Datta

Resolve ST22 dump / Exception while generating Runtime object from CDS reference in SAP Gateway Service Builder (SEGW)

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! 🙂

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.