Saturday, June 28, 2025

πŸ‘️ Views in SAP ABAP


πŸ“Œ
 What is a View?

  • It is a logical table (virtual table) that is created based on other tables.
  • It inherits fields and data from other existing tables.

 

πŸ”„ Difference Between Table and View

Table

View

1. Has its own fields and data

1. Always created based on one or more existing tables

2. It holds either master data or transactional data

2. It can hold both master and transactional data

 

🧩 Types of Views in SAP ABAP

  1. Database View
  2. Projection View
  3. Help View
  4. Maintenance View

 

πŸ”Ή Database View

  • Always created based on two or more tables having relationships between them.

πŸ”§ Steps to Create a Database View

  • Go to SE11
  • Select View option: ZMM_DNTR
  • Click Create
  • In the pop-up, select Database View
  • Provide Short Description: Database View
  • Tables: ZMM_TR, ZMM_DCTR
  • Click Relationships
    • In the pop-up, double-click on the checkbox under "Referenced Table" and press Enter
  • Click View Fields
    • Choose Tables Fields
    • Double-click ZMM_TR → Select all fields → Press Enter
    • Then double-click ZMM_DCTR → Select DCNO, DCdate → Press Enter
  • Activate View using Ctrl + F3

Testing the Database View

  • Click Contents
  • Click the Clock Symbol (F8)

Note: A View always holds common data (linked data between two or more tables)

 

πŸ”Ή Projection View

  • Created based on a single table with selected specific fields.

πŸ”§ Steps to Create a Projection View

  • Go to SE11
  • Select View option: ZPROJ_VIEW
  • Click Create
  • In the pop-up, select Projection View and press Enter
  • Provide Short Description: Projection View
  • Provide Basis Table: KNA1
  • Go to Table Fields tab
    • Select fields: KUNNR, NAME1, ORT01, PSTLZ
  • Press Enter
  • Activate View using Ctrl + F3

Testing the Projection View

  • Click Contents
  • Click the Clock Symbol (F8)

πŸ”Ή Maintenance View

It is also known as a Table maintenance generator. Its purpose is to maintain multiple table.
The tables must have relationship between them. Take mandt field in the maintenance view.

πŸ”ΉHelp View

It is also called search help. The tables must have relationship between them.

Important Points: Not more than 1 record should exist in the dependent/Secondary table.

 

No comments:

Post a Comment