创建数据库表

这篇教程详细介绍了如何在ABAP中创建数据库表,包括定义表字段、选择预定义类型或数据元素、创建数据元素、添加键字段、输入检查等步骤。通过这些步骤,你可以创建存储客户银行账户详情的表,并为字段client创建检查表以确保数据正确性。
摘要由CSDN通过智能技术生成

You will learn

  • How to create a table in ABAP, representing a table in your database
  • How to add an input check to a field

Tables are defined independently of the database in the ABAP Dictionary. When you activate the table in the Data Dictionary, the table is created in the underlying database.

The table in this tutorial will store bank account details for customers. The table will have the following columns (or fields):

  • Company_name
  • account_number
  • balance
  • bank_name
  • account_category
  • city
  • last_entry

For more information on:

  • Database tables and their properties, see the SAP Help Portal: Database Tables

  • Using the ABAP Development Tools (ADT) editor for database tables, see the application help in ADT: click on the editor and choose F1


Step 1: Create a table

Create a table in your package:

  1. Select (right-click) the package and choose New > Other ABAP Repository Object from the context menu:

    Image depicting step1-new-repo-object

  2. Enter the filter text Table, choose Database table, then choose Next.

  3. Enter a name such as Zxx_ACCOUNT - always replacing xx with your initials - and a description, then choose Next:

  4. Accept the proposed transport request and choose Finish.

The code for the table appears in a new editor. Ignore the annotations at the top for now.

Image depicting step1d-table-editor

完成

Log on to answer question

Step 2: Understand the table fields concept

In the next step, you will define the table fields. First you need to understand your options:There are 3 ways to create a field for a database table:

  • Built-in type: The quickest: You specify a (pre-defined) primitive type, length, and description, but no more. You cannot then reuse this field. For more information, see ABAP Keyword Documentation: Predefined Dictionary Types.

  • Use an existing data element: The most powerful: A data element describes the semantics of a field, such as a currency, or a customer name. You can defi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值