码迷,mamicode.com
首页 > 数据库 > 详细

翻译:逻辑数据库(1):组成

时间:2016-08-18 21:12:07      阅读:343      评论:0      收藏:0      [点我收藏+]

标签:

调试SAP标准程序的时候遇到了逻辑数据库相关的部分,顺便翻译一下ABAP的官方帮助文件作为练习。欢迎指正。

逻辑数据库

     逻辑数据库是一种特别的开发对象,它在Logical Database Builder中编辑,并且可以通过一个层次树结构(hierarchical tree structure)中的节点们为其它ABAP程序提供数据。逻辑数据库最通常的目的是从数据库表中释放数据,尽管其它的应用也可以做到这点。


     通过使用外键关系,逻辑数据库提供一个跨数据库表的层次视图。如果这些关系中的部分组成了类树形层次结构(tree-like hierarchical structures),逻辑数据库可以从这些结构的组件的数据库表中读取数据。在传统ABAP中,逻辑数据库通常依据输入、处理和输出的原则用于这些层次结构。实际数据库的记录在此之后被逻辑数据库所包装。逻辑数据库读取数据,将它放在程序中进行本地存储(如果需要的话),并且将它一行一行地传递到一个接口工作区(interface work area)。

     逻辑数据库既可用于重用预定义的从数据库表中读取数据的方法,也可以被用于实现进一步核心的任务,比如定义统一的选择屏幕、中央权限检查,或者对性能的集中增强。

     逻辑数据库的主要特征包括:

  • 层次结构

     结构定义了逻辑数据库的数据视图。他通常继承给出由外键关系定义的逻辑数据库层次,并且控制应用程序传输数据的顺序。通过这种方式,结构决定了其它自对象如何构造以及他们的运行时行为。

  • 可以作为独立的标准选择屏幕的selections

     selections定义了一个标准的选择屏幕,可以用作一个使用逻辑数据库的用户接口。屏幕的出现默认由结构定义。selections可以按用户的需求进行修改和增强。

  • 使用ABAP写成的数据库程序

     数据库程序包含用于读取数据和传输数据到应用程序的的ABAP语句。它基本上是一个包含了逻辑数据库实现的函数的特殊子例程的容器。运行时环境(runtime environment)的报表处理器(reporting processor)按照结构定义的顺序调用这些子例程。数据库程序由结构定义,并且selections可以被修改或者增强以满足用户的需求。

  • 可以添加到函数中的更多元素

     当一个可执行程序被创建时,可以通过Logical Database属性为它分配一个逻辑数据库。这将允许标准选择屏幕和程序流通过选择屏幕和逻辑数据库流结合到一起。

     此外,逻辑数据库可以调用函数模块LDB_PROCESS。这个函数模块可以用于从单个程序中调用多个逻辑数据库并且根据需要嵌套。一个逻辑数据库也可以在同一个程序中被调用多次,如果使用相应的方式编程的话。

注:

     当你在Logical Database Builder中创建一个逻辑数据库时,应保持如下顺序,因为这将使得已创建的组件更容易为尚未创建的组件生成建议。某些逻辑数据库最重要的属性是同它的结构一起被创建的。在定义了结构之后,一个建议将被selection include所创建。这个结构和selection include用于生成一个逻辑数据库程序的模板。之后,这些组件可快速用于创建一个就绪状态的逻辑数据库,基于这些,进一步的需求可以被实现。

  1. 生成基于根节点的结构。
  2. 使它关联一个搜索帮助。
  3. 生成并编辑selection include。
  4. 生成并编辑逻辑数据库。
  5. 进一步编辑其它元素。

英文原文:

A logical database is a special development object that is edited in Logical Database Builder and which provides other ABAP programs with data from the nodes of a hierarchical tree structure. The most common purpose of logical databases is to extract data from database tables, however other applications are feasible.

Logical databases provide a hierarchical view across database tables associated using foreign key relationships. If parts of these relationships construct tree-like hierarchical structures, logical databases can read data from database tables that are components of these structures. In classic ABAP, logical databases are usually used in these hierarchical structures in accordance with the principle of input, processing, and output. The actual database reads are then wrapped in the logical database. The logical database reads the data, saves it locally in the program (if necessary) and passes it row by row to an interface work area.

As well as reusing predefined functions for reading data from database tables, logical databases can be implemented for further central tasks, such as defining uniform selection screens, central authorization checks, or making centralized enhancements to performance.

The main features of a logical database are

a hierarchical structure
The structure defines the data view of the logical database. It generally inherits the given hierarchy of database tables defined by foreign key relationships and controls the order in which the data is passed to the application program. In this way, the structure determines how the other subobjects are constructed and the runtime behavior.
selections as a standalone standard selection screen
The selections define a standard selection screen to be used as a user interface for programs that use the logical database. The appearance of the screen is defined by the structure by default. The selections can be modified and enhanced to meet the requirements of the user.
a database program written in ABAP
The database program contains the ABAP statements for reading the data and passing it to an application program. It is basically a container for special subroutines in which the functions of the logical database are implemented. The reporting processor of the runtime environment calls these subroutines in the order defined by the structure. The database program is defined by the structure and the selections and can be modified or enhanced to meet the requirements of the user.
Further elements, which add to the functions.
When an executable program is created, it can be assigned to a logical database using the Logical Database attribute. This allows the standard selection screen and the program flow to be combined with the selection screen and flow of the logical database.

Furthermore, logical databases can call the function module LDB_PROCESS. This function module can be used to call multiple logical database from a single program and nested as required. A logical database can also be called more than once in a program, if programmed accordingly.

Note

When creating a logical database in Logical Database Builder, the following order should be kept, since this then makes it easier to generate proposal for the remaining components from the those already created. Some of the most important properties of a logical database are defined at the same time as its structure. After the definition of the structure, a proposal is created for the selection include. The structure and selection include are used to generate a template for the database program. These components can then quickly be used to create a ready-to-run logical database, in which further requirements can be implemented.

Create the structure based on a root node.
Associate it with a search help.
Generate and edit the selection include.
Generate and edit the database program.
Edit further elements.





 

翻译:逻辑数据库(1):组成

标签:

原文地址:http://www.cnblogs.com/hhelibeb/p/5785232.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!