sap学习资料.docx
《sap学习资料.docx》由会员分享,可在线阅读,更多相关《sap学习资料.docx(27页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Day2Your First ABAP/4 Program Before Proceeding Exploring the Development Environment Discovering Program Types o Defining Reports o Defining Dialog Programs Discovering Report Components o Discovering the Program Runtime Object o Introducing Program Naming Conventions Creating Your First Program Ex
2、ploring the Source Code Editor o Using the Editor: Initial Screen o Exploring the Functionality of the Source Code Editor Getting Help o Obtaining F1 Help o Obtaining R3 Library Help Finding Your Development Objects Introducing the R/3 Data Dictionary o Exploring Tables and Structures o Displaying a
3、 Table or Structure Definition o Displaying Data in the Table o Determining Displayed Fields Understanding ABAP/4 Syntax o Introducing the select Statement o Understanding Table Work Areas o Introducing the where Clause o Working with System Variables o Using the Chain Operator o Using the select si
4、ngle Statement o Commenting Code and Formal Documentation Summary Q&A Workshop o Quiz o Editor Exercises o Programming Exercises After you complete this chapter, you should be able to: Create and modify simple ABAP/4 programs. Use standard functions in the ABAP/4 editor. Use F1 and R/3 Library help
5、functions. Find your programs using the Object Browser and the editor. Display a table and its contents using the Data Dictionary. Use the tables and select statements. Chain statements together using the chain operator. Add comments and documentation to your programs. Before ProceedingBefore procee
6、ding, you should: Be comfortable with a programming language such as C, COBOL, or Visual Basic. To obtain the full benefit from this and all following chapters, you should also have two or more years of previous development experience. Set up your interface as recommended in Day 1 in the section The
7、 Interface Menu, if you have not done so already. Perform the install procedure for the ScreenCams on the CD-ROM. The install procedure is described in the readme.txt file found in the root directory of the CD-ROM. Many of the procedures in this book are demonstrated using ScreenCams. ScreenCams are
8、 like movies; they show a series of screens, including keystrokes and mouse movements, with a descriptive voiceover. They can be found on the CD-ROM that comes with this book. See the readme.txt file found in the root directory of the CD-ROM for more information. Exploring the Development Environmen
9、tA development object is anything created by a developer. Examples of development objects are programs, screens, tables, views, structures, data models, messages, and includes. The R/3 system contains tools for creating and testing development objects. These tools are located in the R/3 Development
10、Workbench. To access any development tool, you go to the workbench. The workbench contains these tools to help you create development objects: The ABAP/4 program editor where you can create and modify ABAP/4 source code and other program components The Data Dictionary where you can create tables, st
11、ructures, and views The Data modeler where you can document the relationships between tables The Function library where you can create global ABAP/4 function modules The screen and menu painters where you can create a user interface for your programs The following testing and search tools are also a
12、vailable: the ABAP/4 Debugger the SQL trace tool used to tune SQL statements the runtime analyzer for optimizing your programs performance a where-used tool for impact analysis a computer-aided test tool for regression testing a repository search tool for finding development objects the Workbench Or
13、ganizer for recording changes to objects and promoting them into production All development objects are portable, meaning that you can copy them from one R/3 system to another. This is usually done to move your development objects from the development system to the production system. If the source a
14、nd target systems are on different operating systems or use different database systems, your development objects will run as-is and without any modification. This is true for all platforms supported by R/3. (For a list of supported hardware and operating systems, refer to Table 1.1.) Discovering Pro
15、gram TypesThere are two main types of ABAP/4 programs: reports dialog programs Defining ReportsThe purpose of a report is to read data from the database and write it out. It consists of only two screens (see Figure 2.1). Figure 2.1:The selection screen and the output screen. The first screen is call
16、ed the selection screen. It contains input fields allowing the user to enter criteria for the report. For example, the report may produce a list of sales for a given date range, so the date range input fields would appear on the reports selection screen. The second screen is the output screen. It co
17、ntains the list. The list is the output from the report, and usually does not have any input fields. In our example, it would contain a list of the sales that occurred within the specified date range. The selection screen is optional. Not all reports have one. However, all reports generate a list. I
18、n this book, you will learn how to create report programs. Defining Dialog ProgramsDialog programs are more flexible than reports, and so are more complex at the program level. They can contain any number of screens, and the screen sequence can be changed dynamically at run time. On each screen, you
19、 can have input fields, output fields, pushbuttons, and more than one scrollable area. Discovering Report ComponentsABAP/4 reports consist of five components (shown in Figure 2.2): Figure 2.2.The components of an ABAP/4 program. Source code Attributes Text elements Documentation Variants Only the so
20、urce code and program attribute components are required. The rest of the components are optional. All development objects and their components are stored in the R/3 database. For example, the source code for a report is stored in database table dd010s. Discovering the Program Runtime ObjectABAP/4 pr
21、ograms are interpreted; they are not compiled. The first time you execute a program, the system automatically generates a runtime object. The runtime object is a pre-processed form of the source code. However, it is not an executable that you can run at the operating system level. Instead, it requir
22、es the R/3 system to interpret it. The runtime object is also known as the generated form of the program. If you change the source code, the runtime object is automatically regenerated the next time you execute the program. Introducing Program Naming ConventionsThe company you work for is a customer
23、 of SAP. Therefore, programs that you create at your company are called customer programs. Customer development objects must follow naming conventions that are predefined by SAP. These conventions are called the customer name range. For programs, the customer name range is two to eight characters lo
24、ng and the program name must start with the letter y or z. SAP reserves the letters a through x for their own programs. Please take a moment now to choose a unique 3-character identifier for your programs. Within this book, Ill refer to this identifier as your handle. It must begin with a y or z. Fo
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- sap 学习 资料
限制150内