Skip to Content
Personal Insights
Author's profile photo Anuja Kawadiwale

Getting started with ABAP: How to Create Table Part 1

This is the fourth blog post in this series. Here is the previous blog post Getting Started with ABAP: Data Dictionary Introduction

In the previous blog post, we learn what is Data Dictionary.

In this blog post you will learn how to create table, data elements and domain

 

How to a Create Table

Step 1: Enter transaction code SE11 from where we can create a table and press Enter.

Step 2: You will get below window. Enter the table name which you want to create.

Note: Table name should start with Y or Z only.

Step 3: Click on Create button. You will get below window.

Step 4: Enter Short Description. Enter Delivery Class as A. Select Display/Maintenance Allowed from the dropdown Data Browser/Table View Editing.

What is Delivery Class?

Delivery class is how database table is going to be transported during installation, upgrade, and copies within landscapes, clients and customer systems.

Types of Delivery Class

There is a total of 7 Delivery Classes in SAP ABAP.

  1. A

If we select this delivery class type that means we are creating application table which contain master data or transaction data. Application Tables are transported to the customer as empty.

Master data means the data which rarely gets changed. For example, Customer data, Address data.

Transaction Data means the data which change frequently. For example, Sales Data.

  1. C

These are client specific customer table used for customize application. Here data is only entered by the customer.

  1. L

These tables used to store temporary data. Tables are delivered to customer as empty.

  1. G

Customer table where SAP can add data but can not modify or delete it.

  1. E

System table in which customers can make entries. System tables are delivered with some data.

  1. S

These tables are System table delivered by SAP with predefined data as part of system.

  1. W

System table for system administration data. A system table in the delivery class W usually delivered with predefined data by SAP.

Data Browser/Table View Editing

Data browser/table view editing allows you to edit the contents of the table, create entries into the table, delete entries from the table using table maintenance tools.

Table maintenance tools are data browser (Transaction SE16), table/view maintenance (Transaction SM30/SM31) and Generate Table maintenance Dialog (Transaction SE54).

There are four options in data browser/table view editing

  1. Display/Maintenance allowed with restrictions

If we select this option in dropdown, using data browser (Transaction SE16) display of the table contents is possible but no maintenance is allowed.

Using table/view maintenance (Transaction SM30/SM31) display and maintenance of the table/view is not allowed.

Using Generate Table Maintenance Dialog (Transaction SE54) tool only display of the table contents is allowed no maintenance.

  1. Display/Maintenance Allowed

If we select this option in dropdown, using data browser (Transaction SE16) display of the table contents as well as maintenance of table/view is allowed.

Using table/view maintenance (Transaction SM30/SM31) display and maintenance of the table/view is allowed.

Using Generate Table Maintenance Dialog (Transaction SE54) tool display of the table contents and maintenance is allowed.

  1. Display/Maintenance Not Allowed

If we select this option in dropdown, using data browser (Transaction SE16) display of the table contents as well as maintenance is not allowed.

Using table/view maintenance (Transaction SM30/SM31) display and maintenance of the table/view is not allowed.

Using Generate Table Maintenance Dialog (Transaction SE54) tool display of the table contents as well as maintenance is not allowed.

  1. Only Display Allowed

If we select this option in dropdown, using data browser (Transaction SE16) display of the table contents is possible but no maintenance is allowed.

Using table/view maintenance (Transaction SM30/SM31) display is allowed and maintenance of the table/view is not allowed.

Using Generate Table Maintenance Dialog (Transaction SE54) tool only display of the table contents is allowed no maintenance.

Step 5: Press Save button and save it in your existing package. Click on Fields Tab. You will get below window.

Step 6: Add fields into the table. First add MANDT field and make it key also add the MANDT as a data element. Press Enter.

What is MANDT?

MANDT is a client field. Here client means area. If we have MANDT field in our table that means table is client dependent and if we don’t have that field that means table is client independent.

Client dependent means if we create table in one client it will be accessible only in that client and it is not accessible in other clients.

Client independent means if we create table in one client it will be accessible in that client and other client also.

MANDT is a standard data element which is already created by SAP. Hence, we are reusing it here.

Step 7: Double click on MANDT element. Below window will get open. Here we can see MANDT is a data element and it is already created.

Here we can see that MANDT domain is already created by SAP.

Note: To add field into table first we require to create Data Element first.

 

How to Create Data Element

Two ways we can create Data Element

First Method

Step 1: Add Field name as Employee_id and Data element name as ZAK_Employee_id.

Step 2: Double click on ZAK_employee_id data element. It will show you below window. Click on yes and save it in your package.

Step 3: Then it will ask you to create data element. Click on yes.

Step 4: Give Short Description.

Step 5: Here to create data element we need to specify the data type. That means which type of it is.

In Elementary Type, we can specify type by creating domain or using built-in type.

First, we will see built-in type.

Click on built-in type and then click on data type field. Just beside the data type field there is input help means there is a list of data type that we can use it.

Below you can see the list of data type.

Step 6: I want employee_id field of type CHAR hence I selected CHAR.

Step 7: Specify length of the value which we want to store in employee_id field.

Give length 20 if you select numeric data type then you can also specify decimal places.

Step 8: Click on Field Label tab. It is compulsory to give field label. It is used to display heading for that particular field in the report.

Step 9: Save it in your package and activate it.

Step 10: Click on back. Here your data element is created.

I am going to continue this blog post in next blog post.

Here you can check next blog post Getting started with ABAP: How to Create Table Part 2

Follow my profile to be notified of the next blog post. Please feel free to ask any questions you have in the comments section below.

 

 

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.