ERPClimb logoERPClimb
RAP Basics
Architect / Cross-trackintermediate 8 min read

RAP Basics Part 3: Projection Layer and Metadata Extensions

Preview · a free account unlocks the full lesson

Key takeaway

Build the projection layer of a RAP BO: projection view entities (ZC ), provider contract transactional query, redirecting compositions, value helps, search and text annotations, and moving UI annotations into metadata extensions so one BO can serve several apps.

In this lessonShow sections

Visual overview

RAP Basics Part 3: Projection Layer and Metadata Extensions — learning sheetFlow: Create ZC_Travel as projection on ZI_Travel with provider contract → Add value helps, search and text annotations → Redirect compositions in root and child projections → Create a metadata extension with UI annotations. Key ideas: PROJECTION VIEW ENTITY; SEARCH AND TEXTS; REDIRECTING COMPOSITIONS; METADATA EXTENSIONS. Watch out: Putting @UI annotations directly into the projection view makes it hard to read and to adapt — use a metadata extension (@Metadata.allowExtensions: true).ERPClimb.com / ARCH / LESSON 3/11 / LEARNING SHEETRAP Basics Part 3: Projection Layer and MetadataExtensions1 · HOW IT FLOWS1Create ZC_Travelas projection onZI_Travel with…2Add value helps,search and textannotations3Redirectcompositions inroot and child…4Create ametadataextension with…2 · KEY IDEAS EXPLAINEDProjection View Entitydefine root view entity ZC_Travel providercontract transactional_query as projection onZI_Travel.Only list the fields the app needs.Search And Texts@Search.searchable: true on the view,@Search.defaultSearchElement on fields.@ObjectModel.text.element: ['AgencyName'] showstext next to the ID.Redirecting CompositionsInterface: composition [0..*] of ZI_Booking as_Booking.Projection: _Booking : redirected to compositionchild ZC_Booking.Metadata Extensions@Metadata.layer: #CORE (or #CUSTOMER) annotateview ZC_Travel with { … }.Holds @UI.headerInfo, @UI.facet, @UI.lineItem,@UI.identification, @UI.selectionField.3 · REMEMBER · WATCH OUTRememberThe projection layer is the app-specific view of a BO: it selectsfields, adds value helps, search and texts, and restricts operations —…Projection views use "as projection on" and, fortransactional services, provider contract transactional_query.Compositions must be redirected in the projection (redirected tocomposition child ZC_Booking) so navigation stays inside the…!Watch outPutting @UI annotations directlyinto the projection view makes ithard to read and to adapt — use ametadata extension(@Metadata.allowExtensions: true).4 · IN A REAL PROJECTA consumer-health client needed two apps on the same promotion BO: a planner app with full editing and aread-mostly approver app. The first build duplicated the BO — two interface stacks with copied validations,which drifted apart within a month. The architect consolidated to one interface BO with two projections…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 2 built tables and interface views; the projection layer sits on top of those and is what services actually expose. The projection layer is the app-specific view of a business object: it selects fields, adds value helps, search, and texts, and restricts which operations are allowed — but it adds no business logic of its own.

A projection view entity uses "as projection on", and for transactional services carries provider contract transactional_query, for example: define root view entity ZC_Travel provider contract transactional_query as projection on ZI_Travel. You only list the fields the app actually needs, and add things like @Consumption.valueHelpDefinition for fields such as AgencyID or CustomerID.

Search and display text are handled with their own annotations: @Search.searchable: true on the view and @Search.defaultSearchElement on specific fields enable search, while @ObjectModel.text.element: ['AgencyName'] shows a readable name next to an ID, with names typically denormalized through associations such as _Agency.Name.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.