SAP的架構

 

SAP R/3的架構是基於三層的client/server模式
表示服務器(客戶端)
應用服務器
數據庫服務器
表示服務器(客戶端)
表示服務器一般安裝在用戶的終端上,程序名爲sapgui.exe. 表示服務器將接收用戶輸入,並將這些請求發送給應用服務器。應用服務器接收到請求進行處理,並將處理結果發送回表示服務器,表示服務器(SAPGUI)將結果格式化的輸出大到用戶的屏幕上。
應用服務器
應用服務器An application server is a set of executables that collectively interpret the ABAP/4 programs and manage the input and output for them. When an application server is started, these executables all start at the same time. When an application server is stopped, they all shut down together. The number of processes that start up when you bring up the application server is defined in a single configuration file called the application server profile.
每個應用服務器都有各自的參數文件. 例如,一個應用服務器可以配置以下參數:
•進程數量和進程類型
•每個進程可用內存
•系統自動註銷的時間間隔
應用服務器將解釋執行ABAP/4程序(ABAP程序不是運行在客戶端). ABAP/4程序是有表示服務器(客戶端)啓動,由應用服務器將解釋並在應用服務器上執行ABAP/4程序(ABAP程序不是運行在客戶端) .
如果ABAP/4 程序需要訪問數據庫,應用服務器將訪問請求轉化爲數據語句併發送到數據庫服務器.
數據庫服務器
The database server is a set of executables that accept database requests from the application server. These requests are passed on to the RDBMS (Relation Database Management System). The RDBMS sends the data back to the database server, which then passes the information back to the application server. The application server in turn passes that information to your ABAP/4 program.
There is usually a separate computer dedicated to house the database server, and the RDBMS may run on that computer also, or may be installed on its own computer.
配置服務器
In a three-tier client/server configuration, the presentation servers, applications servers, and database server all run on separate machines. This is the most common configuration for large systems, and is common in production.
In the distribution presentation configuration, the application and database servers are combined on one computer and the presentation servers run separately. This is used for smaller systems, and is often seen on a development system.
In the two-tier client/server configuration, the presentation and application servers are combined and the database server is separate. This configuration is used in conjunction with other application servers. It is used for a batch server when the batch is segregated from the online servers. A SAPGUI is installed on it to provide local control.
When all servers are combined onto a single machine, you have a central configuration. This is rarely seen because it describes a standalone R/3 system with only a single user.
定義R/3 系統
The simplest definition of an R/3 system is "one database." In one R/3 system, there is only one database. To expand the definition, R/3 is considered to be all of the components attached to that one database. One R/3 system is composed of one database server accessing a single database, one or more application servers, and one or more presentation servers. By definition, it is all of the components attached to one database. If you have one database, you have one system. If you have one system, you have one database. During an implementation, there is usually one system (or one database) assigned to development, one or more systems designated for testing, and one assigned to production.
The term R/3 system landscape denotes a description of the number of systems within an SAP installation and how they are designated, such as development, test, or production.
定義R/3 Instance
When you hear someone say the word instance, most of the time, that person will be referring to an application server. The term instance is synonymous with application server.
The term central instance refers to the database server. If an application server and database server both reside on the same machine, the term central instance refers to the computer on which both reside.
In the most general terms,一個實例就是一個服務器.它由一組爲R/3系統提供服務的進程組成.
應用服務器架構
所有來自客戶端的請求首先發送到任務分配器. 任務分配器首先將請求寫到分配隊列中。任務分配器採用先進先出的原則給每個請求分配工作進程。每個工作進程在同一個時刻只能處理一個請求.
爲了處理用戶請求,工作進程需要用戶上下文和程序回滾區.
用戶上下文(User Context)
用戶上下文其實是一塊由sap r/3在用戶登錄時分配的內存區域,該內存區域記載了用戶信息,如:
•用戶當前設置
•用戶權限
•用戶當前運行的程序名稱
當一個用戶登錄,用戶上下文就會被創建。反之當用戶退出系統,用戶上下文就會被釋放. 用戶上下文會被處理程序使用,它非常重要,具體將在下面相關章節介紹.
回滾區(Roll Area)
回滾區是一塊由工作進程爲一個運行程序實例分配的內存區域。它包含了SAP R/3運行程序需要的信息如:
•變量的值
•動態分配的內存
•當前程序的指針
每當用戶啓動一個程序,R/3系統就會自動爲該實例創建回滾區。如果在同一時刻有兩個用戶運行同一個程序,系統會爲每個用戶創建各自的回滾區。回滾區在程序結束時釋放
NOTE
When speaking to a Basis consultant, you might hear the term roll area used to refer to all roll areas for one user or even all roll areas on one application server. You usually can determine the intended meaning from the context in which it is used.

回滾區和用戶上下文在sap的會話處理中扮演了非常重要的角色.
 
會話處理( Dialog Step)
NOTE
會話處理是basis顧問測試系統響應時間的最小單位.

 A dialog step is the processing needed to get from one screen to the next. It includes all processing that occurs after the user issues a request, up to and including the processing needed to display the next screen. For example, when the user clicks the Enter key on the Change Vendor: Initial Screen, he initiates a dialog step and the hourglass appears, preventing further input. The sapmf02k program retrieves the vendor information and displays it on the Change Vendor: Address screen, and the hourglass disappears. This marks the end of the dialog step and the user is now able to make another request.
There are four ways the user can initiate a dialog step. From the SAPGUI:
•輸入回車鍵.
•輸入一個功能鍵.
•點擊屏幕的一個按鈕.
•選擇一個菜單項.
It is important for an ABAP/4 programmer to know about dialog steps because they form a discrete unit of processing for an ABAP/4 program.
 
Understanding Roll-In/Roll-Out Processing
An ABAP/4 program only occupies a work process for one dialog step. At the beginning of the dialog step, the roll area and user context are rolled in to the work process. At the end of the dialog step, they are rolled out.
During the roll-in, pointers to the roll area and user context are populated in the work process. This enables the work process to access the data in those areas and so perform processing for that user and that program. Processing continues until the program sends a screen to the user. At that time, both areas are rolled out. Roll-out invalidates the pointers and disassociates these areas from the work process. That work process is now free to perform processing for other requests. The program is now only occupying memory, and not consuming any CPU. The user is looking at the screen that was sent, and will soon send another request.
When the next request is sent from the user to continue processing, the dispatcher allocates that request to the first available work process. It can be the same or a different work process. The user context and roll area for that program are again rolled in to the work process, and processing resumes from the point at which it was left off. Processing continues until the next screen is shown, or until the program terminates. If another screen is sent, the areas are again rolled out. When the program terminates, the roll area is freed. The user context remains allocated until the user logs off.
In a system with many users running many programs, only a few of those programs will be active in work processes at any one time. When they are not occupying a work process, they are rolled out to extended memory and only occupy RAM. This conserves CPU and enables the R/3 system to achieve high transaction throughput.
 
NOTE
ABAP/4 programs do not have the capability to intercept many common Windows events. The events that generate a lot of messages such as key presses, focus changes, and mouse movements are not passed to ABAP/4 programs. As a result, there is no way of performing some of the functions that are found in other Windows programs. For example, in ABAP/4, you cannot validate the contents of a field when the user presses the Tab key. You must instead wait until the user initiates a dialog step.

數據是如何和表示層服務器(客戶端)交互的
在表示層服務器和應用服務器之間採用sap專有的信息格式進行數據傳替.  SAPGUI接收從應用服務器發送來的屏幕信息,並將根據客戶端平臺的進行格式化信息和顯示。這樣可以有多種平臺同時連接同一個應用服務器。例如, OS/2 PC和 Windows PC可以同時連接同一個應用服務器.
工作進程的部件組成
每個工作進程由以下部件組成:
•任務處理器
•ABAP/4解釋器
•屏幕解釋器
•數據庫接口
所有請求都是通過任務處理器處理,由任務處理器爲請求分配處理進程.
解釋器是解釋執行ABAP/4代碼. Sap裏有兩個解釋器: ABAP/4解釋器和屏幕解釋器. 一個用來解釋ABAP/4語言進行數據除了,另一個用來解釋屏幕處理. 每個進程都擁有自己的解釋器.
數據庫接口主要負責與數據庫服務器的通訊處理.
工作進程的類型(TCODE RZ10)
Sap中有七種類型工作進程,每種進程處理一類用戶請求. 具體類型見Table 1.2.
Table 1.2  進程類型列表
工作進程類型 說明
D (Dialog) 處理會話請求
V (Update) 處理數據庫更新
B (Background) 處理後臺作業
S (Spool) 處理打印請求
E (Enqueue) 處理鎖請求
M (Message) 處理應用服務器之間的消息
G (Gateway) 消息隊列網關

Understanding the Logon Client
The term logon client has nothing to do with Client/Server-it is completely different.
The number entered here by the user corresponds to a set of rows within each client-dependent table within the database.
 
跨Client表(client-dependent)和非跨Client表(client-independent)
There are two types of tables in an R/3 database: client-dependent and client-independent. A table is client-dependent if the first field is of type CLNT. The length will always be 3, and by convention, this field is always named mandt. If the first field is not of type CLNT, the table is client-independent.
 This program selects rows from table lfa1 and writes out lfa1-lifnr. When this program is run, only two rows are selected: only those where mandt equals 800. This happens automatically because the first field in the table is of type CLNT. There are five rows in the table, but the program writes out only those rows where mandt equals 800. If the user were to log on to client 700 and run the same program, three rows of data would be found and written out. If the user were to log on to client 900, only one row of data would be found.
The logon client mechanism divides the rows within a client-dependant table into distinct groups. To access a different set of data, the user logs on and specifies a different client number.
 
NOTE
用戶主數據是跨Client的. 因此,to gain access to a client, the security administrator must create a new user ID for you within that client.

Developers and testers use the logon client mechanism to create and access multiple, independent sets of data within a single table.
For example, assume two typical, asocial programmers are working on an enhancement to the billing system. Jim is modifying the update transaction and Jane is creating a new report to go with Jim's modifications.
Jane sets up data for her test run, executes her report and obtains output. Jim works in the next cubicle, but due to his antisocial tendencies is blissfully unaware that his transaction uses the same tables as Jane's report. He runs his transaction and updates the data. Jim got what he wanted, but Jane then modifies her code and runs her program again. Her output differs from the last run, and the differences many not result from her changes, but rather they may result from Jim's changes. What we have here is a failure to communicate.
If the tables used by Jim and Jane's programs were client-dependent, they could each log in to separate clients, set up independent sets of data, and test their programs without ever talking to each other. They could perform all of their testing in the comfort of their cubicles and in isolation from their coworkers.
To make their tables client-dependant, they only need mandt as the first field and the R/3 system will take care of the rest. When records are added to the table, the system automatically moves the current logon client into the mandt field when the record is send to the database. Their Open SQL select statements will only return rows where the client number in the table is equal to the their current logon client number. The Open SQL database statements insert, update, modify, and delete also provide automatic client handling.
If the tables involved are all client-dependent, there can be more than one group of testers working at a time in one test system. Two teams of testers can test divergent functionality in the same set of programs at the same time provided they log on to different logon clients. The updates done by one team will not change the data belonging to the other team.
A training client could also exist on the test system. The students could log on to one client and the testers could log on to another. Both would run the same set of programs, but the programs would access independent sets of data.
NOTE
一般來說R/3 會安裝三套系統: 開發系統,測試系統和生產系統. 默認情況,每個系統會安裝三個clients: 000, 001, and 066. 但是生產系統一般會添加一個Client,不會象開發系統和測試系統會從三個clients增加到6個clients


本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/CompassButton/archive/2006/10/28/1354161.aspx

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章