欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    sap学习资料.docx

    • 资源ID:44328354       资源大小:269.75KB        全文页数:27页
    • 资源格式: DOCX        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    sap学习资料.docx

    Day 2Your 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 · Exploring 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 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 single 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 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 proceeding, 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 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 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 EnvironmentA 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 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, structures, 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 available: · the ABAP/4 Debugger · the SQL trace tool used to tune SQL statements · the runtime analyzer for optimizing your program's 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 Organizer 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 and 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 Program 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 called 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 report's selection screen. The second screen is the output screen. It contains 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. In 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 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 source 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 programs 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 requires 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 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 long 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, I'll refer to this identifier as your handle. It must begin with a y or z. For example, you might use the letter z followed by your two initials. The notation will indicate where you should use your handle. For example, if you chose zkg and you see the direction "Enter a program name of abc," you would enter zkgabc. I recommend that as you go through this book, you should use your handle as the first three characters of all development objects you create. If you do, they will be easy to recognize later, and easy to find. The program naming conventions adopted for this book are as follows: · Sample programs from the text of chapters follow the convention ztxccnn, where cc is the chapter number and nn is a sequential number from 01 to 99. · Program names used in exercises follow the convention ztyccnn, where cc is the chapter number and nn is a sequential number. The program name for the solution will be ztzccnn. · Utility programs provided on the CD-ROM follow the naming convention y-xxxxxx, where xxxxxx is the name of the utility. The setup program that creates development objects and loads them with data for the exercises is called y-setup. If necessary, it can be re-run at any time to restore the exercise data to its original condition. To remove all the development objects and data created by the setup program from the system, run y-uninst. See the readme.txt file on the CD-ROM for more information. Creating Your First ProgramWhat follows is a description of the process you will follow to create a program. When you sign on to R/3 to create your first ABAP/4 program, the first screen you see will be the SAP main menu. From there, you will go to the Development Workbench, and then to the editor. You will enter a program name, and create the program. The first screen you will see will be the Program Attributes screen. There, you must enter the program attributes and save them. You will then be allowed to proceed to the source code editor. In the source code editor, you'll enter source code, save it, and then execute the program. Start the ScreenCam "How to Create Your First Program" now. Follow this procedure to create your first program. Help with common problems is given in the Troubleshooter that follows it. If you have trouble with any one of the steps, don't forget to consult the Troubleshooter. 1. From the R/3 main menu, select the menu path Tools->ABAP/4 Workbench. A screen with the title ABAP/4 Development Workbench is displayed. 2. Press the ABAP/4 Editor button on the application toolbar. The ABAP/4 Editor: Initial Screen is displayed. 3. In the Program field, type the program name 0201. 4. Press the Create button. The ABAP/4: Program Attributes screen is displayed. The fields containing question marks are required. 5. Type My First ABAP/4 Program in the Title field. By default, the contents of this field will appear at the top of the list. 6. Type 1 in the Type field. A 1 indicates the program is a report. 7. Type an asterisk (*) in the Application field. The value in the Application field indicates to which application area this program belongs. The complete list of values can be obtained by positioning your cursor on this field and then clicking on the down-arrow to the right of it. For example, if this program belongs to Inventory management, you would put an L in the Application field. Since this is a simple test program, I have used an asterisk to indicate that this program does not belong to any particular application area. 8. Tickmark the Editor Lock check box. Enabling Editor lock will prevent changes to the program by anyone other than the creator. For your exercises, tickmark this box to safeguard your programs from accidental modification by others. However, you should not use this to lock actual development programs. It will prevent other programmers from maintaining them later. 9. To save the program attributes, press the Save button on the Standard toolbar. The Create Object Catalog Entry screen is displayed. 10. Press the Local Object button. The program attributes screen is redisplayed. In the status bar at the bottom of the screen, the message "Attributes for program saved" appears. (Note: the message you see will contain the program name too, but since this name will vary for each user, it is left out of the text in the book. This convention of leaving the development object name out of the message will be carried throughout the book.) 11. Press the Source Code button on the application toolbar. The ABAP/4 Editor: Edit Program screen is displayed. 12. Choose the menu path Settings->Editor Mode. The Editor: Settings screen is displayed. 13. Choose the radio button PC Mode With Line Numbering. 14. Choose the radio button Lower Case. 15. Press the Copy button (the green check mark). You have now saved your editor settings. (Editor settings only need to be set once.) 16. Look at line 1. If it does not contain the statement report 0201., type it now, as shown in Listing 2.1. 17. On line 2, type write 'Hello SAP world'. Use single quotes and put a period at the end of the line. 18. Press the Save button on the Standard toolbar. 19. To execute your program, choose the menu path Program->Execute. A screen with the title My First ABAP/4 Program is displayed, and the words Hello SAP world are written below it. This is the output of the report, also known as the list. Listing 2.1  Your First ABAP/4 Program 1 report ztx0201.2 write 'Hello SAP World'.The code in Listing 2.1 produces this output: Hello SAP WorldCongratulations, you have just written your first ABAP/4 program! To return to the editor, press the green arrow button on the standard toolbar (or the F3 key). These are the Common Problems Encountered While Creating a Program and Their SolutionsTroubleSolutionWhen you press the Create button, you get a dialog box saying Do Not Create Objects in the SAP Name Range. You have entered the wrong program name. Your program names must start with y or z. Press the Cancel button (the red X) to return and enter a new program name. When you press the Create button, you get a dialog box with an input field asking for a key. You have entered the wrong program name. Your program names must start with y or z. Press the Cancel button (the red X) to return and enter a new program name. You are getting a Change Request Query screen asking for a Request Number. On the Create Object Catalog Entry screen, do not enter a value in the Development class field.  Press the Local Object button instead. Exploring the Source Code EditorIn this section you will learn how to harness the power of the ABAP/4 editor. You will learn to use two screens in this section: · ABAP/4 Editor: Initial Screen · ABAP/4 Editor: Edit Program screen Using the Editor: Initial ScreenThe ABAP/4 Editor: Initial Screen is shown in Figure 2.3. From there, you can display or change all program components. For example, to change the source code component, choose the Source Code radio button and then press the Change button. Or, to display the attributes component, choose the Attributes radio button and then press the Display button. Figure 2.3.From the ABAP/4 Editor: Initial Screen you can display or change program com-ponents.TIPIn Figure 2.3, notice that the Object Components group box encloses radio buttons, the Display button, and the Change button. When you see a group box enclosing both radio buttons and pushbuttons, the ra

    注意事项

    本文(sap学习资料.docx)为本站会员(飞****)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开