Monday, 8 July 2013

JULY 8

I learned to know the Program Types, Report Components and created the first program.


Exploring the Development Environment

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, we go to the workbench.
The workbench contains these tools to help us create development objects:


  • The ABAP/4 program editor where we can create and modify ABAP/4 source code and other program components
  • The Data Dictionary where we can create tables, structures, and views
  • The Data modeler where we can document the relationships between tables
  • The Function library where we can create global ABAP/4 function modules
  • The screen and menu painters where we can create a user interface for our 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 our 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 we can copy them from one R/3 system to another. This is usually done to move our 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, our development objects will run as-is and without any modification. This is true for all platforms supported by R/3.


Discovering Program Types

There are two main types of ABAP/4 programs:
  • reports
  • dialog programs

Defining Reports

The purpose of a report is to read data from the database and write it out. It consists of only two screens.



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.


Defining Dialog Programs

Dialog programs  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, we can have input fields, output fields, pushbuttons, and more than one scrollable area.


Discovering Report Components

ABAP/4 reports consist of five components
  • 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.


Discovering the Program Run-time Object

ABAP/4 programs are interpreted; they are not compiled. The first time we execute a program, the system automatically generates a run-time object. The run-time object is a pre-processed form of the source code. However, it is not an executable that we can run at the operating system level. Instead, it requires the R/3 system to interpret it. The run-time object is also known as the generated form of the program.
If we change the source code, the run-time object is automatically regenerated the next time we execute the program.



Introduction to Program Naming Conventions

The company we work for is a customer of SAP. Therefore, programs that we create at our 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 
  • the program name must start with the letter y or z. SAP reserves the letters a through x for their own programs.

Creating My First Program

What follows is a description of the process that we will follow to create a program.
When we sign on to R/3 to create our first ABAP/4 program, the first screen we see will be the SAP main menu. From there, we will go to the Development Workbench, and then to the editor. We will enter a program name, and create the program. The first screen we will see will be the Program Attributes screen. There, we must enter the program attributes and save them. We will then be allowed to proceed to the source code editor. In the source code editor, we will enter source code, save it, and then execute the program.

We can follow this procedure to create our first program. 
  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 Zdemo_program.
  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 "executable program" in the Type field. It indicates the program is a report.
  7. Type "test program" in the status field.
  8. Type "Basis"  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..
  9. To save the program attributes, press the Save button on the Standard toolbar. The Create Object Catalog Entry screen is displayed.
  10. Type "$TMP" in the package field and press the Local Object button. The program attributes screen is re-displayed. In the status bar at the bottom of the screen, the message "Attributes for program saved" appears. 
  11.  The ABAP/4 Editor: Edit Program screen is displayed.
  12. At line 1 it contains the statement Report zdemo_program.If it does not contain this statement , type it then.
  13. On line 2, type write 'Hello SAP world'. Use single quotes and put a period at the end of the line.
  14. Press the Save button on the Standard toolbar.
  15. 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.
These are the Common Problems Encountered While Creating a Program and Their Solutions

Trouble
Solution
When we press the Create button, we get a dialog box saying Do Not Create Objects in the SAP Name Range.We have entered the wrong program name. Our program names must start with y or z. Press the Cancel button (the red X) to return and enter a new program name.
When we press the Create button, we get a dialog box with an input field asking for a key.We have entered the wrong program name. Our program names must start with y or z. Press the Cancel button (the red X) to return and enter a new program name.
We 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.
Various transaction codes (T-codes) are used in ABAP/4. Most frequently used one are:
  • se38 - ABAP editor 
  • se11 - ABAP dictionary
  • se51 - screen painter
  • se80 - object navigator

In the above given steps for creating program, we can replace step 1 and step 2 by using T-code se38. It will directly take us to program field.

Friday, 5 July 2013

JULY 5


On the fourth day of my training I  learned about various elementary , reference and complex data types and their length in ABAP/4.

Data Types in ABAP/4


Programs work with local data. Data consists of strings of bytes in the memory area of the
program. A string of related bytes is called a field. Each field has an identity (a name) and a
data type. All programming languages have a concept that describes how the contents of a field
are interpreted according to the data type.
In the ABAP type concept, fields are called data objects. Each data object is an instance of an
abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their
own right. There are separate name spaces for data objects and data types. This means that a
name can at the same time be the name of a data object as well as the name of a data type.
The data type determines how the contents of a data object are interpreted by ABAP statements.
As well as occurring as attributes of a data object, data types can also be defined independently.
We can then use them later on in conjunction with a data object. We can define data types
independently either in the declaration part of an ABAP program (using the TYPES statement), or
in the ABAP Dictionary.

ABAP contains the following data types:

  • elementary
  •  reference
  •  complex types.

Elementary Types

Elementary types are the smallest indivisible unit of types. They can be grouped as those withfixed length and those with variable length.

  • Fixed-Length Elementary Types:   

There are eight predefined types in ABAP with fixed length:
Four character types: Character (C), Numeric character (N), Date (D), and Time (T).
 One hexadecimal type: Byte field (X).

List of Pre-defined Data Types


Data
Type
Internal
Description
Default
Internal
Length
Max
Internal
Length

Valid
Values
Default
Initial
Value
c
character
1
65535
Any char
Blank
n
numeric text
1
65535
0-9
0
d
date
8 (fixed)
-
0-9
00000000
t
time
6 (fixed)
-
0-9
000000
x
hexadecimal
1
65535
Any
 


Three numeric types: Integer (I), Floating-point number (F) and Packed number (P).

List Of Numeric Data Types

Data
Type


Description
Default
Internal
Length

Max
Length

Max
Decimals

Valid
Values
Default
Initial
Value
i
integer
4(fixed)
-
0
-231 to +231
0
p
packed decimal
8
16
14
0-9 .
0
f
floating-point
8
8
15*
-1E-307 to 1E308
0.0

  • Variable-Length Elementary Types:

There are two predefined types in ABAP with variable length:
STRING for character strings
XSTRING for byte strings

Reference Types :

Reference types describe data objects that contain references (pointers) to other objects (data
objects and objects in ABAP Objects). There is a hierarchy of reference types that describes the
hierarchy of objects to which the references can point. There are no predefined references - we
must define them ourself in a program.

Complex Types:

Complex types are made up of other types. They allow us to manage and process
semantically-related data under a single name. We can access a complex data object either as
a whole or by individual component. There are no predefined complex data types in ABAP. We
must define them either in our ABAP programs or in the ABAP Dictionary.

Complex types are divided further into structures and internal tables.

  • Structures

A structure is a sequence of any elementary types, reference types, or complex data types.
We use structures in ABAP programs to group work areas that logically belong together. Since
the elements of a structure can have any data type, structures can have a large range of uses.
For example, we can use a structure with elementary data types to display lines from a database
table within a program.
The following terms are important when we talk about structures:

  • Nested and non-nested structures
  • Flat and deep structures

A nested structure is a structure that contains one or more other structures as components. Flat
structures contain only elementary data types with a fixed length (no internal tables, reference

types, or strings). The term deep structure can apply regardless of whether the structure is nested or not. Nested structures are flat so long as none of the above types is contained in any
nesting level.
  • Internal Tables

Internal tables consists of a series of lines that all have the same data type. Internal tables are
characterized by:

  1. The line type, which can be any elementary type, reference type, or complex data type.
  2. The key identifies table rows. It is made up of the elementary fields in the line. The key can be unique or non-unique.
  3. The access method determines how ABAP will access individual table entries. There are three access types, namely unsorted tables, sorted index tables and hash tables. For index tables, the system maintains a linear index, so we can access the table either by specifying the index or the key.Hashed tables have no linear index. We can only access hashed tables by specifying  the key. The system has its own hash algorithm for managing the table.

Examples for Complex Data Types

The following list contains examples of complex data types in ascending order of complexity:
1. Structures consisting of a series of elementary data types of fixed length (non-nested, flat
structures)

2. An internal table whose line type is an elementary type (vector).
 
3. Internal tables whose line type is a non-nested structure ('real' table)

4. Structures with structures as components (nested structures, flat or deep)

5. structures containing internal tables as components (deep structures)

6. Internal tables whose line type contains further internal tables.

Wednesday, 3 July 2013

JULY 3

On third day of my training I learned about the client-server architecture and the details of  R/3 system architecture. A brief of all is given as under.

Understanding Client/Server
Client/server is two programs talking to each other.




Here we see Program 1 asking Program 2 for some information. Program 1 is the client and Program 2 is the server. Program 2 serves Program 1 with the information it requested. This is different than a main program calling a subroutine and returning. A program that calls a subroutine transfers control to the subroutine and cannot perform any processing until the subroutine returns control.
With client/server, the client and server programs are independent processes. If the client sends a request to the server, it is free to perform other work while waiting for the response.

When the client and server programs both run on the same computer, the configuration is referred to as single-tier client/server. (A tier is the boundary between two computers.) When they run on different computers, the configuration is referred to as two-tier client/server.
A program can function as both a client and a server if it both requests information and replies to requests. The client/server configuration enables the R/3 system to spread its load across multiple computers. This provides the customer with the ability to scale the processing power of the system up or down by simply adding another computer to an existing configuration, instead of replacing a single computer that performs all of the processing.

R/3 System Architecture
SAP based the architecture of R/3 on a three-tier client/server model. 







                                               The R/3 system architecture.

Presentation Server


The presentation server is actually a program named sapgui.exe. It is usually installed on a user's workstation. To start it, the user double-clicks on an icon on the desktop or chooses a menu path. When started, the presentation server displays the R/3 menus within a window. This window is commonly known as the SAPGUI, or the user interface (or simply, the interface). The interface accepts input from the user in the form of keystrokes, mouse-clicks, and function keys, and sends these requests to the application server to be processed. The application server sends the results back to the SAPGUI which then formats the output for display to the user.


Application Server

An application server is a set of executables that collectively interpret the ABAP/4 programs and manage the input and output for them. When an application server is started, these executables all start at the same time. When an application server is stopped, they all shut down together. The number of processes that start up when we bring up the application server is defined in a single configuration file called the application server profile.

Each application server has a profile that specifies its characteristics when it starts up and while it is running and they only run there-the programs do not run on the presentation server. An ABAP/4 program can start an executable on the presentation server, but an ABAP/4 program cannot execute there.


Discovering the Database Server


The database server is a set of executables that accept database requests from the application server. These requests are passed on to the RDBMS (Relation Database Management System). The RDBMS sends the data back to the database server, which then passes the information back to the application server. The application server in turn passes that information to our ABAP/4 program.

There is usually a separate computer dedicated to house the database server, and the RDBMS may run on that computer also, or may be installed on its own computer.

Program Buffer and the Roll Area

Programs are buffered on the application server in a program buffer. When a user makes a request to run a program, a search is done in the program buffer for it. If it is found, and if it has not been modified in the database, the buffered copy is used. If not, or if the copy in the database is newer, the program is reloaded.
A separate copy of the program is not made in memory for each user who executes it. Instead, all users execute the same copy of the program. The differentiating factor is a separate memory allocation called a roll area.One roll area is allocated per execution per user per program. The system uses the roll area to hold all information about the current execution of the program and all memory allocations. Information such as the variables and their values, the current program pointer, and the list output are all kept in the roll area. For example, suppose a user executes a program and a roll area is allocated. If, without waiting for it to finish, the user switches to another session and starts up the same program again, another roll area is allocated for the second execution of that program. The user has two roll areas, one for each execution of the program. If the user had instead run a different program, he would still have two roll areas, one for each program.

Tuesday, 2 July 2013

JULY 2

Today was my second day of training, which started with introduction to SAP/ABAP. I got to learn about the basics of SAP/ABAP  and the basics of R/3 system on which SAP's applicaions are built.  The brief of the study is given as follows.

SAP (System Application & Products for Data Processing).

 SAP is the leader in the market of enterprise applications in terms of software and software-related service.Today major companies including Microsoft and IBM are using SAP's Products to run their own businesses.
SAP ERP  is an Enterprise Resource Planning , an integrated software solution that incorporates the key business functions of the organization.
SAP ERP consists of several modules, including utilities for marketing and sales, field service, product design and development, production and inventory control, human resources, finance and accounting. SAP ERP collects and combines data from the separate modules to provide the company or organization with enterprise resource planning.


ABAP (Advanced Business Application Programming)

ABAP is one of the many application-specific fourth-generation languages (4GLs)  first developed in the 1980s. It was originally the report language for SAP R/2, a platform that enabled large corporations to build mainframe business applications for materials management and financial and management accounting.The ABAP language was originally used by developers to develop the SAP R/3 platform. It was also intended to be used by SAP customers to enhance SAP applications – customers can develop custom reports and interfaces with ABAP programming. 

The Development Environment


R/3 is an integrated suite of applications designed to handle the data processing for large corporations. It was developed in Germany by the company named SAP.

Within R/3 is a runtime environment and an integrated suite of application programs written in SAP's 4GL-ABAP/4. These application programs are designed to meet the data processing needs of very large businesses. R/3 and its predecessor R/2 are particularly popular with the manufacturing sector.
R/3 is the system in which our ABAP/4 programs will run. 

Purpose of R/3 System

The sole purpose of an R/3 system is to provide a suite of tightly integrated, large-scale business applications. The standard set of applications delivered with each R/3 system are the following:
  • PP (Production Planning)
  • MM (Materials Management)
  • SD (Sales and Distribution)
  • FI (Financial Accounting)
  • CO (Controlling)
  • AM (Fixed Assets Management)
  • PS (Project System)
  • WF (Workflow)
  • IS (Industry Solutions)
  • HR (Human Resources)
  • PM (Plant Maintenance)
  • QM (Quality Management)


These applications are called the functional areas, or application areas, or at times the functional modules of R/3.
Traditionally, businesses assemble a suite of data processing applications by evaluating individual products and buying these separate products from multiple software vendors. Interfaces are then needed between them. A significant amount of IS time and money is spent in the implementation and maintenance of these interfaces.
R/3 comes prepackaged with the core business applications needed by most large corporations. These applications coexist in one homogenous environment. They are designed from the ground up to run using a single database and one (very large) set of tables. Current production database sizes range from 12 gigabytes to near 3 terabytes. Around 8,000 database tables are shipped with the standard delivery R/3 product.
This is important for us, as an ABAP/4 programmer, to know because these applications are all written entirely in ABAP/4
In a Windows environment, we will sign on to R/3 either by choosing a menu path from the Start menu, or by double-clicking on an R/3 icon. The R/3 system will prompt us for a user ID and password.  We will fill in these two fields and then press Enter.
The logon screen appears as follows:

LOG ON Screen

The R/3 system will then display a copyright screen, and when we press Enter, the system will display the R/3 main menu as shown below -

R/3 Main Menu Screen


From the main menu, we can go to three conceptual areas in the R/3 system:


  • the Applications area
  • the Basis area
  • the Development Workbench


In the Applications area, we initiate transactions for the functional areas within R/3. To access these, from the R/3 main menu we can choose one of the following: Logistics, Accounting, Human Resources, or Information Systems.

In the Basis area, we can run transactions that monitor the R/3 system itself. To access the Basis area, from the main menu we can choose the menu path Tools->Administration. Here we will find many performance, tuning, and database administration tools.

The Development Workbench is used to create and test ABAP/4 programs. As an ABAP/4 programmer, we will spend most of our time within the Workbench. To access the Development Workbench, we will choose the menu path Tools->Development Workbench. However, our code will most probably read or update application data, and so it will be destined to become part of the application area. 

Discovering the R/3 User Interface

Every R/3 main menu screen contains these elements:

  • Title bar: Contains the title of the current screen.
  • Menu bar: The contents of the menu bar change with each screen. By browsing the menus within it, we can discover all functions that are possible on the current screen. The System and Help menus are present on every screen and the menu items they contain never change.
  • Command field: Here we enter commands to be executed. 
  • Standard toolbar: Contains the Command field and a series of buttons. They will never change in appearance, position, or function, and they will be present on every screen. Some might be grayed out if their functionality is currently unavailable.
  • Application toolbar: Changes with each screen. Displays buttons that give us quick access to menu items for that screen.
  • Interface Menu: Enables us to customize the characteristics of the user interface, access the Windows clipboard, and generate graphics.
  • Screen area: This is the big area in the middle of the screen that displays the report data or a screen from a dialog program.
  • Status bar: Displays messages, the system ID, session number, client number, insert/overtype mode indicator, and the current time.

We can turn most screen elements on and off.



Monday, 1 July 2013

JULY 1

Practically this was my first of training. But on this day there was no lecture or any introductive class. Today I could only get SAP installed on my system after facing a long series of problems, and there after I submitted a form for issuing me the entry pass for next 6 months.Then I left the office premises, ensuring that from second day I will be starting to work.