字幕列表 影片播放 列印英文字幕 It is now time to take our first look at an SAP ABAP program. We are going to fire up the SAP system and open up the ABAP Workbench. Now, just before we do this, let’s quickly discuss the structure of an ABAP program. As with many other programming languages, ABAP programs are normally structured into two parts. The first part of the program is what we consider to be the declaration section. This is where we define the data types, structures, tables, work area variables, and the individual fields that we want to use inside our programs. This is also where we would declare global variables that will be available throughout the individual subsections of our program. When we create an ABAP program, we not only declare global variables but we have the option to declare variables that are only valid inside specific sections within our programs. These sections are commonly referred to as Internal Processing Blocks. The declaration part of our program is where we will define the parameters used for our selection screens for our reports. Once we have declared tables, global variables, and data types in the declaration section of our program, we then come on to the second part of an ABAP program itself, and this is where we will write all the logic for our program. This part of an ABAP program is often split up into what we call the Processing Blocks. The processing blocks that we define within our programs can be called from the Dynpro Processor that we discussed in previous videos depending on the specific rules we create within our programs. These processing blocks are nearly always just small sections of programming logic that allow us to encapsulate our code. Let’s look on to our SAP system and take a look at the ABAP workbench. We are finally having a look at the SAP system itself. When you open the SAP GUI, you may have a different menu on the left-hand side but I’ve have set it just so that I’ve got the minimal menu option that we want to have a look at during this ABAP training course. So the first thing we’re going to do is have a look at the ABAP workbench. Now to get to the workbench we can just use the menu system on the left-hand side here. If we open up the SAP menu and choose tools; then you’ll see the ABAP workbench. Open that up and then you’ll see four different options within. Now, the first that we want to look at is just a very quick overview of how we run a transaction in SAP. Now, hopefully you are all familiar with this but I’ll just show you the two ways. First of all, you can open up the menu and when you have an item that does not look like a folder, that’s a actual transaction you can run. So in this case, let’s run the Object Navigator. I’ll just double click then we’ll see down here at the bottom of the screen it said “Starting the transaction” and then it opens it up. To come out of the transaction, just press the Back button. And the other way of running the transaction is coming up here to the Transaction Input area and you can key in the technical name of the transaction itself if you know what it is. Now a little trick so that you become familiar with all the different SAP transactions and to make it so that you don’t have to go through the menus all the time is to have a look or navigate to the Extras menu. Go to Settings and the dialogue box that comes up has four options. Choose the bottom one that says “Display Technical Names”. Click the little “continue” icon with the green tick. And now, it’s refreshed the menu and when you navigate inside, we’ll go back to the Overview menu again, you can now see the actual transaction codes that I as you start working with the SAP system, you will become familiar with them and you will be able to enter them directly into the input box. So, let’s close this Overview menu and then we will step by step go through the different options and I will highlight the 4 or 5 major pieces of the ABAP Workbench that you will become familiar with and you will use as an ABAP developer. One thing that most of our programs will have in common is that they will read or write data to and from database tables within our SAP system. The ABAP workbench has a transaction to allow us to create database tables and also view the fields that make up the table themselves and browse the data inside. This is called the ABAP Dictionary. You can find the ABAP dictionary by going through the ABAP Workbench menu and go down to the Development and there you’ll see ABAP Dictionary and its transaction code SE11. The next and probably the most used part of the ABAP Workbench is the ABAP Editor and this is where we will spend a lot of our time in this course. The ABAP Editor is where we create all the code, it’s where we build all the logic, and by using forward navigation, which is a function within an SAP system that we will touch on later, you can actually define function modules, jump forward to ABAP dictionary, and also create screens. The ABAP Editor can be found under the Development menu again and its transaction code SE38. The next most important part of the workbench is the Function Builder. The Function Builder is very similar to the ABAP Editor but its main function is to actually define specific tasks that can be called from any other program. You create interfaces in the Function Builder where you define the different data elements and the different types of tables that can be passed to and from the actual function that you build. We will touch on the Function Builder a little later on when we encapsulate our programs into function modules. Function Builder can be called from transaction code SE37 and it can normally be found just under the ABAP Editor option on the SAP menu tree. Now the next item we want to look at is called the Menu Painter and if you have a look at the User Interface folder, open that up and you’ll see transaction code SE41. The Menu Painter is a tool that can be used to generate, uhm, if we look up here, we can see menu options and we can see buttons, some menu bars, we can create buttons, icons, menu bars, transaction input fields, and all these can trigger events within our program. You can define whether the event is triggered by a mouse click, or by simply pressing a short-cut key on your keyboard. Example, will be here on this menu bar, we can see the log off button and we can see this can be triggered by using the Shift + F3 together. So the Menu Painter is for building menu items, menu bars and the next item in our list is the Screen Painter and that’s transaction code SE51. Now the Screen Painter as you might guess, allows you to define the user input screen so you can define textboxes, dropdown menus, list boxes and input fields, tab areas of the screen, and so on. It lets you define the whole interface that the user will use and behind all the different fields, buttons, dropdowns that you put on your screen, you then define the individual functions that get called when the user interacts with it. Now we save the best for last, the last item that we are going to look at is called the Object Navigator. The Object Navigator is a fantastic tool. It brings all the other tools together into one roof and gives you a very efficient environment for you to develop different programs. When you’re building large programs that have many function modules, many screens, the Object Navigator is the ideal tool to use so that you can navigate all around your development. You can find the Object Navigator under the Overview menu under the ABAP workbench and its transaction code SE80. So that more or less covers the main features of the ABAP workbench that we will interact with in this ABAP course. You will see in the SAP menu tree there are many, many other transactions that can be used to help develop your programs. But the ones we have just covered I would say covered about 90% to 95% of the development tools that you will use. That brings us to the end of Module 1. I hope you have found this introduction to the SAP Development Environment useful and in the next module, Module 2, we are going to start off by looking at the ABAP Dictionary.
B1 中級 學習SAP ABAP - ABAP工作臺初探 (Learn SAP ABAP - First Look At The ABAP Workbench) 118 9 magicchiureg 發佈於 2021 年 01 月 14 日 更多分享 分享 收藏 回報 影片單字