Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
francisco-milan opened this issue Sep 30, 2024 · 0 comments

Comments

@francisco-milan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants