16 Ağustos 2010 Pazartesi

Communication with the Database

Lesson Overview


SAP systems can be used with a variety of operating systems and databases made

by different manufacturers. The application data in the SAP system is accessed in

the ABAP stack via platform-independent ABAP programs. But the data is stored

database-specifically. Hence, the database queries from the ABAP programs have

to be translated into the respective dialect of the database. This is taken care

of by the database interface.

Lesson Objectives

After completing this lesson, you will be able to:

• Describe how the SAP system communicates with the database

• List the advantages of open SQL statements

Business Example

You want to find out how to access the database using Open SQL statements.

The SAP Web Application Server Database Interface

Relational Database Management Systems (RDBMS) are generally used to

manage large sets of data. An RDBMS saves data and relationships between

data in the form of two-dimensional tables. These are known for their logical

simplicity. Data, tables, and table relationships are defined at database level in the

database catalog (the data dictionary) of the RDBMS.

Within the SAP programming language ABAP, you can use SAP Open SQL (SQL

= Structured Query Language, database query language) to access the application

data in the database, regardless of the RDBMS used. The database interface,

which is part of every work process on the SAP Web Application Server, translates

Open SQL statements from ABAP into the corresponding SQL statements for

the specific database used (“Native SQL”). This allows ABAP programs to be

database-independent.

Note: Open SQL is a database query language based on the (ISO) SQL

standard that also contains enhancements that are not included in the

standard.

When interpreting Open SQL statements, the SAP database interface checks

the syntax of these statements and automatically ensures optimal utilization of

the SAP buffers that are in the shared memory of every SAP Web Application

Server. Data that is frequently required by the applications is stored in these

buffers so that the system does not have to access the database server to read
this data. In particular, all technical data, such as ABAP programs, screens, and


ABAP Dictionary information, as well as a number of business administration

parameters, usually remain unchanged in an operational system and are therefore

ideally suited to buffering.

Figure 57: Database Query Flow


Furthermore, "native" SQL commands can be used directly in ABAP, that is,

without using the local buffers and without the database interface interpreting the

commands. You can do this by including the commands in a EXEC SQL. - END

EXEC. bracket in the ABAP program. The ABAP Interpreter does not check the

syntax of any commands within this bracket. If you use native SQL, you can no

longer maintain the platform independence of the affected programs.

Hiç yorum yok:

Yorum Gönder