您的位置:首页 > 产品设计 > 产品经理

[ABAP Part One] Program Development Phase 1 ---- Basic Sturcture & Obj Overview

2007-07-05 23:00 555 查看
This section dicusses issues, concerns, and practices to be aware of during the program development cycle.

As programmers, it's our nature to learn by looking at testing programs and copy code as necessary.

This article is design for give you a freshlook about the ABAP programing architecture, and how does it works in R/3 enviornments.Also we will introduct the object naming rule for you. It's very strange, isn't that. Because in the VS.NET platform, you can name the object for any string, VS.NET provide namespace to separte them into different platform.

Customer Objects

SAP objects are kept separate from customer objects by using different letters for the first character of the object’s name. Customer objects begin with Y or Z. Oddly enough, SAP may use 'Z' in rare cases for their objects even though this is reserved for customers. The letter ‘Z’ is suggested throughout this document as a standard practice for customer objects but the letter 'Y' may also be used.

Third party vendors can apply for a reserved prefix to identify their development objects within a customer's SAP system. These conventions ensure that custom developed objects will not conflict with SAP objects in current or future releases.

Adhering to object naming conventions adds consistency to named objects while also helping to identify and categorize your development objects. The following table suggests naming conventions for ABAP Dictionary and WorkBench Objects.

Dictionary Objects

DDIC ObjectNaming StandardRepository EntryMeta Data Table
DomainZ*
Data ElementZ*
Lock ObjectEZ*
Search HelpZSH*
StructureZS*
TableZ* or ZT*
Table TypeZ* or ZTY*
Table IndecesZ## 3 character unique name
Type GroupZTG*
ViewZV*

Workbench Repository Objects

After the Z prefix, it is common practice to further identify the object by including the application ID as part of the prefix. This naming convention is entirely up to the corporate standards and is only presented here as an additional identifying technique.

Sample Application ID's

AM - Asset Management
BW - Business Warehouse
FI - Finance (GL, AR, PS)
MM - Material Management
PP - Production Planning
SD - Sales and Distribution

For Example: if the object belongs to the SD application, a program could be named ZSDLOADORDERS. In addition, some shops choose to use the process or GAP ID as part of the name so for example if the gap is GAP123 you could essentially see a program named something like ZSD123LOADORDERS or ZSDLOADORDERS123 or simply ZSD123.

Another common practice is to provide a qualifier as part of the name that identifies the program TYPE i.e. for the above Data Load program, the name could be ZSDDORDERS which would literally translate to a "Data Load program that loads Orders and belongs to the SD application area"

Sample Program Types

R - Report
D - Data Load
I - Include
X - Interface
etc.

SAP ObjectNaming StandardRepository EntryMeta Data Table
Application LogZ*
Area MenuZ*
Batch Input SessionZ*
Change DocumentZ*
PackageZ*
Dialog ModuleZ*
CMOD Enhancement ProjectZ*
Form PoolSAPFZ*

Generated Include modules should follow SAP suggested recommendations

For Example
FZ*TOP - Data declarations
FZ*F## - Subroutines

Function GroupsZ*
Function ModulesZ_*
Gui StatusZ*
IncludeZI*
Memory IDZM*
Message Class Z*
Messages Numbernumeric 3 digits 1-999
Module PoolSAPMZ*

Generated Include modules should follow SAP suggested recommendations

For Example
MZ*TOP - Data declarations
MZ*O## - PBO modules
MZ*I## - PAI modules
MZ*F## - Subroutines

Number RangeZNR*
ProgramZtype* where type identifies the program function
Screen4 characters
GUI TitleZ*
Transaction CodeZ*

Modifications

Whenever an SAP object is modified, a special kind of modification referred to as a ‘repair’ is performed. Repairs are a special type of Correction in SAP where the system recognizes that a change is being made to a ‘copy’ of the original source. The term 'repair' also applies when a customer object is modified in the non original source system that it was developed i.e. created in a development system and changed in a QA or production system.

Modifications to SAP programs should be done only when all other alternatives have been exhausted and management has given approval to proceed. There are circumstances such as when an advance correction is made available from SAP that are considered normal practice. These are usually made available in the form of an OSS note from SAP.

If a modification must be performed that is outside the scope of an OSS note, try to encapsulate the modification in a single programming unit such as a function, method, Form, or Include. When a new release is installed, and if the object has been upgraded to a new version as a reult of the new release, the customer must manually compare the modifications with the new standard and re-apply any modifications that may still be desired.

Obsolete ABAP

Avoid Obsolete Statements – Obsolete does not necessarily mean that it is physically dropped from the language or will not pass a program generation. If the statement is deemed obsolete by SAP, it can mean that it will not be compatible with ABAP OO syntax or could cause extended program check warnings. There are generally better/newer ways to use the command. The old conventions are usually preserved for backwards compatibility. For a complete and currect list of obsolete statements check the SAP help as well as the Release Notes found in the Object WorkBench.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: