Skip to content

Enhance an ABAP Core Data Services (CDS) View in SAP Business Technology Platform (BTP) ABAP Environment #2540

Closed
@francisco-milan

Description

@francisco-milan

Tutorials: https://developers.sap.com/tutorials/abap-environment-enhance-cds-view.html

Write here how you think we can improve the tutorial ...

Hello,

I wanted to share some feedback regarding STEP 7 of the tutorial. I struggled a bit due to a few typos and inconsistencies between the position numbers in my code and those presented in the tutorial.

After some troubleshooting, I figured out how to write the code correctly to make it work. Here’s my version of the code, which I hope can help update the instructions so that other learners don’t get stuck like I did:

Complete code from my Metadata Extension:

@Metadata.layer: #CORE

@UI: {
  headerInfo: {
    typeName: 'Travel',
    typeNamePlural: 'Travels',
    title: {
      type: #STANDARD,
      label: 'Travel',
      value: 'TravelID'
    }
  }
}

annotate view Z_I_TRAVEL_R_FMC with
{

  @UI.facet: [ { id:              'Travel',
                  purpose:         #STANDARD,
                  type:            #IDENTIFICATION_REFERENCE,
                  label:           'Travel',
                  position:        10 } ]


  @UI           : {
        lineItem      : [{position: 15, label: 'Agency', importance: #HIGH}],
        identification: [{position: 15 }],
        selectionField: [{position: 15 }]
        }
  AgencyID;

  @UI           : {
        lineItem      : [{position: 20, importance: #HIGH}],
        identification: [{position: 20 }],
        selectionField: [{position: 20 }]
        }
  CustomerID;

  @UI           : {
        lineItem      : [{position: 10, importance: #HIGH}],
        identification: [{position: 10, label: 'Travel' }],
        selectionField: [{position: 10 }]
        }
  TravelID;

  @UI           : {
        lineItem      : [{position: 30, importance: #HIGH}],
        identification: [{position: 30 }],
        selectionField: [{position: 30 }]
        }
  BeginDate;

  @UI           : {
        lineItem      : [{position: 40, importance: #HIGH}],
        identification: [{position: 40 }],
        selectionField: [{position: 40 }]
        }
  EndDate;

  @UI           : {
        lineItem      : [{position: 50, importance: #HIGH}],
        identification: [{position: 50 }]
        }
  TotalPrice;

  @UI           : {
        lineItem      : [{position: 50, importance: #HIGH}]
        }
  Memo;

  @UI           : {
      lineItem      : [{position: 60, importance: #HIGH}],
      selectionField: [{position: 60 }]
      }
  Status;

}

This is the result:

image

I hope this feedback helps improve the tutorial for future learners. Thank you for your work on this resource!

Best regards,

Francisco Milan.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions