Environment Sap Abap Programming For Beginners Pdf


Thursday, June 20, 2019

This tutorial explains the key concepts of SAP ABAP. Audience You need to have a basic understanding of Java programming and Database. SAP ABAP Tutorial in PDF - Learn SAP ABAP in simple and easy steps starting Dialog Programming, Smart Forms, SAPscripts, Customer Exits, User Exits. This tutorial will teach you basic Android programming and will also take you through some advance Advanced Andr Download Android Tutorial (PDF.

Sap Abap Programming For Beginners Pdf

Language:English, Spanish, Hindi
Published (Last):30.07.2016
ePub File Size:23.34 MB
PDF File Size:11.63 MB
Distribution:Free* [*Regsitration Required]
Uploaded by: JENNELL

ABAP stands for Advanced Business Application Programming. In this section you can find ABAP tutorial and PDF study materials for your reference. You can write ABAP programs if you log in to the system with a special SAP user learn ABAP programming on a central SAP server, you should ask your. Free download SAP ABAP PDF Books and training material, online training materials, This document is a compilation of possible ABAP programming and The SAP R/3 Guide to EDI, IDocs and Interfaces Where Has the Money Gone?.

Objects that programs can share are development objects as well. These shareable objects include database fields, field definitions, and program messages.

A package is a container for objects that logically belong together; for example, all of the objects in an application.

A package is also a type of development object. An example of a package might be General Ledger Accounting. When you create a new object or change an existing object, the system asks you to assign the object to a package. When you complete work on a development object like a program, screen, or menu, you generate a runtime version of the object.

This runtime version is stored, along with the object, in the Repository. An application consists of several runtime objects that are processed by the work processes in the SAP System.

Classes are useful for grouping objects with the same structure attributes, methods, events. Generally, objects are defined using classes. The term instance is used for a specific object belonging to a class.

The object's attributes provide the object with its characteristics, describing the current object state. Methods are the actions that can be performed with the object, indicating the behavior of the object.

Events are used so that the object can inform or be informed of any event or state change on the system to enable the system to react to those events. Interfaces are another very important feature of objects. They define the method in which objects can be used independently of their internal implementation. Basics of the Syntax of the ABAP Programming Language In the next few sections we will introduce the basic elements of the ABAP programming language, with the objective of providing an overall description of the most important features of the ABAP syntax, such as data types, comments, naming conventions, operators, program flow control, and so on.

This type of definition is static. At runtime, we cannot modify the type of the data object.

SAP ABAP Tutorial in PDF

There are other possible syntax options, but they are not supported with ABAP objects. With the LIKE keyword, what we are indicating is that the type of the data object being defined is the same that the data object referenced in the clause. There are manyother features involved in the Data Dictionary, but the focus here will be on the basic onesso as to build on this later on when creating ABAP programs.

First, a database table will be created, involving the creation of fields, data elements anddomains. An explanation of what each of these is, and why they are necessary to thetables built will be given.

What is SAP ABAP

During the building of the tables, the tools used to check forerrors will be shown. Once these errors are eradicated, the tables can be activated so thatthey can be used within the system. After this, a look will be taken at maintaining the technical settings of the table created,which will allow the entry of data, before finally looking at the data which has beenentered using standard SAP transactions available in the SAP system.

This is done via the Tools menu. Alternatively, use thetransaction code SE In this exercise a transparent tablewill be created.

Other types of table do exist such a cluster tables and pool tables , but atthis early stage the transparent table variety is the important one to focus upon. The table name must adhere to the customer-defined name space, meaning that thename must begin with the letter Z or Y, most commonly this will be Z. Once this is done, a new screen will appear: In the Delivery and Maintenance tab which opens by default , look at the Delivery classsection, select the field and then click the drop-down button, where a list of Deliveryclasses will be shown and selected: It should look like this: Before going any further, click the Save button: A window appears titled Create Object Directory Entry.

Nearly all development work done with SAP is usually done within a developmentenvironment, before being moved on to, for example, a quality assurance environmentand on further to production. This window allows you to choose the appropriateDevelopment class which is supported by other systems where the work may be movedon to. Once this is done, the status bar at the bottom will show that theobject has been saved: Creating FieldsThe next step is to begin creating Field names for the table, in the Fields tab: Fields, unlike the name of the table, can begin with any letter of the alphabet, not just Zand Y and can contain up to 16 characters.

An Initial value can be assigned to each field, for example, in the case of a field calledEmployee Class you could say the majority of employees are Regular Staff S , but someare Directors, with a code of D. The standard initial value would be S, but the user couldchange some of these to a D later on. Data ElementsEvery Field in the table is made up of what is called a Data Element, which defines specificattributes of each field.

The first Field to be created here is an important one within an SAP system, and identifiesthe client which the records are associated with. This Data Element already exists in the system, and afterentering it, the system automatically fills in the Data Type, the Length, Number ofDecimals and Short text for the Data Element itself. Ensure that the Client field is made aKey field in the table by checking the Key box.

The next field will be called Employee. Once this is done, click the save button. If you tryto activate or even check the table via the Check button , an error message isdisplayed: To dothis, forward navigation is used. Double-click the new Data Element, and a windowlabelled Create Data element appears. Answer Yes to this, and the Maintain DataElement window comes up. Next, the Elementary data type,called the Domain, must be defined for the new Data element.

Domains must adhere tothe customer name space, so in this instance the same name as the Data element will begiven: Again, forwardnavigation will be used to create the Domain.

Choose Yes to create the Domain, and in the window which appears, type into theShort text box a description of the Domain. In this example, Employee Domain: The first available fieldhere is Data type, click inside the box and select the drop-down menu, and a number ofgeneric data types already existing within the ABAP dictionary will appear.

Once this selection is double-clicked, it will appear in the Data type areain the Definition tab.

Next, in the No. An Output length of8 should be selected, and then press Enter. The NUMC fields description should re-appear, confirming that this is a valid entry. Next, select the Value range tab, which is visible next to the Definition tab just used: This is where you set valid value ranges for the Domain created. Once this is set, anysubsequent user entering values outside the valid value range will be shown an error 37 Here, there are three options.

First, where you can see Single values, it is possible to enter a list of individual valid values which can be entered by the user. Second, Intervals, where you can enter a lower and upper limit for valid values, for example 1 and 9, which saves the effort of entering 9 individual single values in the Single values section.

Last, the Value table box visible at the bottom. When there are a large number of possible entries, this is a common method to do this you must specify a complete valid value table entry list, in which case it is also necessary to introduce foreign keys to the table, to ensure the users entries are tested against the value stored in the value table created.

This example Domain, however, does not require any Value range entry, so just click thesave button and, again, assign it as a Local object. The next step is to Activate the object, allowing other Data elements to use this domaingoing forward. A pop-up window appears, listing the 3 currently inactive objects: It may be possible to activate all of the objects together, but this is not advised. In a typicaldevelopment environment, a number of people will be creating developmentssimultaneously, and quite often, others objects will appear in this list.

When this is highlighted, click the green tick continue button. The window should disappear, and the status bar will display the message Object s 38 Forward navigation was usedfor generating the Domain, so click the Back button, or press F3 to return to theMaintain Data Element screen.

As the domain is active, the description enteredpreviously should appear by the area where ZEENUM was typed, along with otherDomain properties which have been created: Next, the Field labels must be created, so click that tab. The Field labels entered here willappear as field labels in the final table. In this example they should read Employee, orbetter, Employee Number. If this does not fit within the area given, just tailor it so that itstill makes sense, for example typing Employee N into the Short Field label box.

Oncethe text has been put into the Field label spaces, press enter, and the Length section willautomatically be filled in: Theinactive objects window will reappear, where two inactive objects will remain.

Again, the status bar should display Object s activated.

Press the back button to return to the Table maintenance screen. Next, the same practices will be used to create four additional fields. This time it should not be selected asa Key field, so do not check the box. Now, forward navigation will again be used. The Maintain DataElement window will appear which will be familiar from the previous steps. In the Short text box this time type Surname Data Element and title the new domain 40 Double-click the new domain and save the Data element, assigning it a Local object andthen choose Yes to create the new Domain.

The Domain maintenance screen will reappear. The number of characters and output length should both be set to 40, then press enter tobe sure everything has worked, and click the Activate button.

The status barshould read Object saved and activated. Following this, click Back or F3 to return to the Maintain Data element screen. Ensure thedomain attributes have appeared Short text, Data type, Length and so on.

Again, press Back to return to the Maintain Table screen, where the new Data element willbe visible: Click to create the Data element and follow the steps above again.

Save this and choose Yes to create the domain.

The domains short text should read Forename. Next, Activate the Domain as before. Return to the Maintain Data Element screen. Type Forename into the four Field labelboxes. Go back again to see the table: This time theLength and Output length will be The Field labels should all read Title. Activate all of these and go back to view the new, fifth field in the Table. The final field which will be created for this table is for Date of Birth. Click the green tick to continue: Activate the Domain and Data element, and return to thetable.

Technical SettingsOnce this has been saved, the next step is to move on to maintaining the technical settingsof the Table. Before creating the final Database table, SAP will need some moreinformation about the table being created.

Select Technical settings via the toolbar above the table, through the Go to menu, or 45 Here, it is important to tell the system what Data class is to be used, so select the dropdown button. There are five different options, with accompanying descriptions. For thistable, select the first, labelled APPL0, and double-click it: For the Size category field, again click the drop-down button. Here, you have to make anestimate as to the amount of data records which will be held within the table so that thesystem has some idea of how to create the tables in the underlying database.

In thisinstance, it will be a relatively small amount of information, so select the first sizecategory, labelled 0: Here, Buffering not allowed should be selected: This prevents the table contents from being loaded into memory for reading, stopping thetable from being read in advance of the selection of the records in the program.

You may,correctly, point out that it may be advantageous to hold the table in the memory forspeed efficiency, but in this example, this is not necessary.

Training Syllabus

If speed was an issue in adevelopment, buffering would then be switched on, ensuring the data is read intomemory. In the case of large tables which are accessed regularly but updatedinfrequently, this is the option to choose.

Nothing else on the Maintain Technical Settings screen needs to be filled at this point, soclick Save and then go back to the table itself. If all of this is successful, then the tableshould now be in a position to be activated and the entry of records can begin. Click theActivate icon to activate the table and check the status bar, which should again readObject Activated. To do this, enter the Utilitiesmenu, scroll to Table contents, and then Create Entries: A Data-entry screen will appear which has automatically been generated from the tablecreated.

The field names correspond here to the technical names given when we createdthem. To change these to the Field labels which we set up, enter the Settings menu andselect User Parameters. This facility allows you to tailor how tables look for your ownspecific user ID.

Select the Field label radio button and click Continue: The Employee Number field is limited to 8 characters, and the data type was set to NUMC,so only numerical characters can be entered. Create a record with the following data: Employee Number: Brown Forename: Stephen Title: Mr Date of Birth: Press Enter and the system will automatically put the names in upper case, and validateeach field to ensure the correct values were entered: Next,click the Reset button above the data entry fields to clear the fields for the next entry.

SAP ABAP Programming Tutorials - Free Training Course

Create another record with the following data: Note that this time the Date of Birth has been filled in without the appropriate dividers. When Enter is pressed, the system automatically validates all fields, correcting the Date ofBirth field to the correct formatting itself: Note that if dates are entered in the wrong format, an error message will appear in thestatus bar: Viewing the Data in a TableNow that data has been entered into the table, the final few steps will allow this data tobe viewed.

Having entered several data records in the manner discussed previously, click the Back keyto return to the Dictionary: Display Table screen. To view the table created with the dataentered, from the Utilities menu, select Table contents and then Display: The selection screen is very useful when you have lots of data in yourtable. In this case, though, only five records have been entered, so this is unnecessary. However, for example if you were to only want to focus on a single employee number, ora small range, these figures can be selected from this screen: To view all of the records, do not enter any data here.

Just click the Execute button,which is displayed in the top left corner of the image above, or use the shortcut F8. Youwill now see a screen showing the data records you entered in the previous section: If you want to see all of the data for one record, double-click on the record and this will beshown.

Alternatively, several records can be scrolled through by selecting the desiredrecords via the check-boxes to the left of the Client column and then clicking the Chooseicon on the toolbar: These can then be individually viewed and scrolled through with the Next entry button: To return to the full table then, simply click the Back button, or press F3.

Experiment with the table created, using the toolbars range of options to filter and sortthe information in a number of ways: There are a number of things which can be achieved in this table view, and it can be auseful tool for checking the data within an SAP system without going through thetransaction screens themselves.

Double-click to execute. A note to begin: Do notmake them any more complicated than is necessary. This way, when a program is passedon to another developer to work with, fix bugs and so on, it will be far easier for them tounderstand.

Add as many comments as possible to the code, to make it simpler foranyone who comes to it later to understand what a program is doing, and the flow of thelogic as it is executed. The program name must adhere to the customer naming conventions, meaning that hereit must begin with the letter Z. The Originallanguage should be set to EN, English by default, just check this, as it can have an effect onthe text entries displayed within certain programs.

Any text entries created within theprogram are language-specific, and can be maintained for each country using a translationtool. This will not be examined at length here, but is something to bear in mind.It is important to become familiar withthe inbuilt conversion rules and know when to manipulate the data prior to using them incalculations.

It can check authorisations, andread and write to the Database, over the Database Interface. Reading Sample. For thistable, select the first, labelled APPL0, and double-click it: Since none of the objects herehave been created in the first program, leave these blank, and click Copy.

ABAP programs are created and maintained using the workbench tools discussed in previous sections. Thenext screen will ask if any other objects are to be copied.