Skip to main content

Command Palette

Search for a command to run...

DAY-6: Understanding Views in SAP ABAP (Database View & Projection View Explained)

Published
5 min read
DAY-6: Understanding Views in SAP ABAP (Database View & Projection View Explained)
R

On a journey of continuous learning 🚀 I share the concepts I learn daily through blogs. Learn concepts with me — one topic at a time.

#LearningInPublic #ContinuousLearning

What is a View in SAP ABAP?

  • In simple terms, a View in SAP is like a virtual table.

    It does not store data physically.
    Instead, it shows data from one or more existing tables in a logical way.

    Think of it like this:

    • A Table stores data permanently.

    • A View only displays data by combining or filtering tables.


Real-World Analogy

Imagine you have:

  • One Excel sheet with customer details

  • Another Excel sheet with customer orders

If you combine them into one filtered sheet to see:

Customer Name + Order Number

That combined sheet is like a View.

The original sheets remain unchanged.


Why Do We Use Views?

Views are used to:

  • Combine multiple tables

  • Hide unwanted fields

  • Simplify data access

  • Support search help (F4)

  • Allow maintenance across related tables

Views make SAP cleaner and easier to use.


Types of Views in SAP

View TypeWhat It MeansUsed For
Database ViewCombines multiple tables using relationshipsRead-only combined data
Projection ViewShows selected fields from one tableHide unnecessary fields
Maintenance ViewAllows updating related tables togetherMaster data maintenance
Help ViewUsed for search help (F4)Value selection support

Display vs View (Important Difference)

Many beginners confuse this.

AspectDisplayView
DefinitionDisplay refers to how data is shown to the user in the SAP GUI or reports.A View is a logical definition in the ABAP Dictionary that combines or projects data from tables.
PurposeTo present existing data in a readable format (output only).To simplify data access by joining tables, hiding fields, or enabling maintenance/search help.
Data HandlingRead-only; no structural definition, just presentation.Can be read-only (Database/Projection views) or allow maintenance (Maintenance views).
ScopeLimited to the user interface (screen, ALV grid, report output).Defined centrally in ABAP Dictionary (SE11) or via CDS, reusable across programs.
StorageNo separate storage; just a representation of existing data.No physical storage; references underlying tables dynamically.
Examples- ALV report showing sales orders- SE16N table display- Output list- Database View joining VBAK + VBAP- Projection View hiding sensitive fields- Help View for F4 search
User InteractionUser can only see or navigate data.Developers can define views for specific business logic, and users may maintain data via Maintenance Views.
FlexibilityDepends on how the program formats output.Highly flexible—can be reused in multiple programs, reports, and search helps.

Simple Explanation

  • Display = How data appears on screen

  • View = How data is logically defined

If you open SE16N, you are just displaying.

If you create something in SE11 → View, you are creating a logical object.


DATABASE VIEW (Step-by-Step)

A Database View combines multiple tables using relationships (foreign keys).

It is mostly read-only.


Step 1: Open SE11

  • Go to SE11

  • Select View

  • Enter a custom name (starting with Z or Y)

  • Click Create


Step 2: Select “Database View”

When prompted, select:

Database View

This tells SAP:

“I want to combine multiple tables.”


Step 3: Enter Description & Base Tables

  • Enter Short Description

  • Enter the Header Table

  • Click Relationships

  • Select the related Item Table

This ensures SAP uses the correct join conditions.

Example:

  • Header Table → Sales Order Header

  • Item Table → Sales Order Items


Step 4: Select View Fields

  • Go to View Fields

  • Click Table Fields

  • Choose fields from either table

  • Select required columns

Now the view contains only chosen fields.


Step 5: Save & Activate

  • Click Save

  • Assign Package

  • Capture Transport Request (TR)

  • Activate

Activation is mandatory.


Step 6: Display View in SE16N

  • Go to SE16N

  • Enter View Name

  • Execute

Now SAP displays combined data from both tables.


PROJECTION VIEW (Step-by-Step)

A Projection View is based on only one table.

It simply hides unwanted fields.


When to Use Projection View?

Example:
You have Employee Table with:

  • Employee ID

  • Name

  • Department

  • Salary

But you want users to see only:

  • Name

  • Department

Projection View solves this.


Step 1: Open SE11

  • Select View

  • Enter Name

  • Choose Projection View


Step 2: Enter Base Table

  • Enter only one table

  • Provide short description


Step 3: Select Fields

  • Go to View Fields

  • Choose only required columns


Step 4: Save & Activate

  • Save

  • Assign Package

  • Capture TR

  • Activate


Step 5: Display in SE16N

Enter the projection view name in SE16N.

You will see:

  • Only selected fields

  • Data from original table


Important Concepts About Views

  1. Views Do Not Store Data: They only reference original tables. If the base table changes, the view reflects changes.

  2. Database View = Join Logic: Used when you need combined reporting or simplified access.

  3. Projection View = Field Restriction: Used when you want limited access or to hide sensitive fields.


When to Use Each View

ScenarioBest View Type
Combine Header & ItemDatabase View
Hide Salary FieldProjection View
Maintain Customer + AddressMaintenance View
Support F4 HelpHelp View

Key Takeaway

  • Table = Stores data

  • View = Shows data logically

  • Display = Just shows output

  • Database View = Join tables

  • Projection View = Hide fields

Conclusion

Understanding the different types of views in SAP ABAP and their applications can greatly enhance data management and accessibility. By using views effectively, you can streamline processes, protect sensitive information, and improve overall system efficiency.

More from this blog

A

ABAP Essentials for Beginners

13 posts