Contents at a Glance
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CRUDQ Using Fiori Elements'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity YV_TABLE_CRUDQ
as select from ytable
{
key field1,
field2,
field3,
field4,
field5
}
What is Metadata Extensions?
A CDS metadata extension (MDE) extends a CDS entity with CDS annotations that are not specified in the DDL source code of the data definition.
CDS metadata extensions can currently only be created for CDS views.
@Metadata.layer: #PARTNER
@UI.headerInfo: {typeName: 'Entry', typeNamePlural: 'Entries', title: {label: 'Happy Learning'}}
annotate view YV_TABLE_CRUDQ with
{
@EndUserText.label: '1st Field'
@UI: {
selectionField: [{ position: 10 }],
lineItem: [{ position: 10}, { cssDefault.width: '8rem' } ],
identification: [{position: 10}]
}
field1;
@EndUserText.label: '2nd Field'
@UI: {
selectionField: [{ position: 20 }],
lineItem: [{ position: 20}, { cssDefault.width: '8rem' } ],
identification: [{position: 20}]
}
field2;
@EndUserText.label: '3rd Field'
@UI: {
lineItem: [{ position: 30}, { cssDefault.width: '8rem' } ],
identification: [{position: 30}]
}
field3;
@EndUserText.label: '4th Field'
@UI: {
lineItem: [{ position: 40}, { cssDefault.width: '8rem' } ],
identification: [{position: 40}]
}
field4;
@EndUserText.label: '5th Field'
@UI: {
lineItem: [{ position: 50}, { cssDefault.width: '8rem' } ],
identification: [{position: 50}]
}
field5;
}
@OData.publish: true
//Data Definition
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CRUDQ Using Fiori Elements'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@OData.publish: true
define view entity YV_TABLE_CRUDQ
as select from ytable
{
key field1,
field2,
field3,
field4,
field5
}
_______________________________________________________________________________________________________
// Metadata Extension
@Metadata.layer: #PARTNER
@UI.headerInfo: {typeName: 'Entry', typeNamePlural: 'Entries', title: {label: 'Happy Learning'}}
annotate view YV_TABLE_CRUDQ with
{
@EndUserText.label: '1st Field'
@UI: {
selectionField: [{ position: 10 }],
lineItem: [{ position: 10}, { cssDefault.width: '8rem' } ],
identification: [{position: 10}]
}
field1;
@EndUserText.label: '2nd Field'
@UI: {
selectionField: [{ position: 20 }],
lineItem: [{ position: 20}, { cssDefault.width: '8rem' } ],
identification: [{position: 20}]
}
field2;
@EndUserText.label: '3rd Field'
@UI: {
lineItem: [{ position: 30}, { cssDefault.width: '8rem' } ],
identification: [{position: 30}]
}
field3;
@EndUserText.label: '4th Field'
@UI: {
lineItem: [{ position: 40}, { cssDefault.width: '8rem' } ],
identification: [{position: 40}]
}
field4;
@EndUserText.label: '5th Field'
@UI: {
lineItem: [{ position: 50}, { cssDefault.width: '8rem' } ],
identification: [{position: 50}]
}
field5;
}
Project Details
"metadataUrlParams": {
"sap-value-list": "all"
}
Application Preview:
Tip: The Table Type can be changed in MANIFEST.JSON
"settings": { "tableSettings": { "type": "GridTable" }
Table types Available:
ResponsiveTable (default)
GridTable
AnalyticalTable
TreeTable
"sap.ui.generic.app": {
"pages": [{
"entitySet": "ZXXXXXXXX",
"component": {
"name": "sap.suite.ui.generic.template.ListReport",
"list": true,
"settings": {
"tableSettings": {
"type": "GridTable"
}
}
},
npm run deploy
info abap-deploy-task ZBSP_CRUD_CDS Deployment Successful.
@ObjectModel:{
modelCategory: #BUSINESS_OBJECT,
compositionRoot: true,
representativeKey: 'field1',
semanticKey: ['field1'],
transactionalProcessingEnabled: true,
writeActivePersistence: 'YTABLE',
// enable crud
createEnabled: true,
updateEnabled: true,
deleteEnabled: true
}
@UI.facet: [
{
label: 'Edit Values',
position: 10,
type: #COLLECTION,
id: 'GeneralInfo'
},
{
label: 'Edit',
purpose: #STANDARD,
position: 10,
type: #IDENTIFICATION_REFERENCE,
parentId: 'GeneralInfo'
}
]
"tableSettings": {
"multiSelect": true,
"multiEdit": { "enabled" : true }
},
"sap.ui.generic.app": {
"pages": [{
"entitySet": "ZXXXXXXXX",
"component": {
"name": "sap.suite.ui.generic.template.ListReport",
"list": true,
"settings": {
"tableSettings": {
"multiSelect": true,
"multiEdit": { "enabled" : true }
}
}
},
"Programming is not about what we know, its about what we can solve"
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 | |
9 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 |