Tuesday, February 24, 2009

Database Tables

Database Tables

A table is two dimensional data matrix i.e. it’s the combination of rows and columns. The rows contain the data record and columns contain the field.Tables can be containing zero or multiple records or rows.

Ex: Employee Table.





Types of Tables
1. Client Dependent
2. Client Independent

Client Dependent:- If the first field of a table is MANDT and data type is CLNT then it is called client dependent table. The length will be always 3.

Client Independent: - If the first field contains other than the MANDT then it is called client independent table .
The client dependent tables are again of three types.
1. Transparent tables.
2. Pooled Tables.
3. Clustered Table.

1.Transparent Tables
A transparent table in the dictionary has one to one relationship with a table in the database. Its structure in R/3 Data dictionary corresponding to a single database table. The database table has the same name, the same number of fields and the fields have the same names as the R/3 table definition. It contains application data. In below fig first part will shows tranasparent table.




Table Pools and Pooled Tables
A pooled table in R/3 has a many-to-one relationship with a table in the database. For one table in the database, there are many tables in the R/3 Data Dictionary. The table in the database has a different name than the tables in the DDIC, it has a different number of fields, and the fields have different names as well. Pooled tables are an SAP proprietary construct.

In the database pooled tables are stored in a single table called a table pool table.R/3 uses table pools to hold a large number (tens to thousands) of very small tables (about 10 to 100 rows each). Table pools reduce the amount of database resources needed when many small tables have to be open at the same time. Pooled tables are primarily used by SAP to hold customizing data. In the above fig second part is an example for pooled tables

Table Clusters and Cluster Tables
A cluster table is similar to a pooled table. It has a many to one relationship with a table in the database. Many cluster tables are stored in a single table in the database called a table cluster.

Table clusters are used to hold data from a few (approximately 2 to 10) very large tables. They would be used when these tables have a part of their primary keys in common, and if the data in these tables are all accessed simultaneously. Table clusters contain fewer tables than table pools and, unlike table pools, the primary key of each table within the table cluster begins with the same field or fields. In the above fig third part is an example for cluster tables.

Restrictions on Pooled and Cluster Tables

Pooled and cluster tables are usually used only by SAP and not used by customers, probably because of the proprietary format of these tables within the database and because of technical restrictions placed upon their use within ABAP/4 programs. On a pooled or cluster table:
Secondary indexes cannot be created.

1. You cannot use the ABAP/4 constructs select distinct or group by.
2. You cannot use native SQL.
3. You cannot specify field names after the order by clause. order by primary key is the only permitted variation.
Because of these restrictions on pooled and cluster tables and because of their limited usefulness. Normally in real time system we will not create much pooled and cluster tables. Only transparent tables are used or created maximum. So we will discuss only about transparent tables

Other Components of the Table

Fields: - Fields are nothing but columns.
Domain: - Domain consists of the technical characteristics of a field such as field length and data type.
Data Element: - A table is composed of fields to create a field you need a data element. The data element contains the field labels and documentation (F1 help) for the field. It contains the semantic characteristics for the field and it works like a interface between Field and Domain.

Domain and data elements are reusable. A domain can be used in more than one data element and data elements can be used in more than one field and in more than one table.

Delivery Class:- Delivery class comes under attributes. The value in the delivery class field identifies the “OWNER” of the data in this table. The owner is responsible for maintaining the table contents. In customer tables we always enter ‘A’ Here which indicates that the table contains application data owned by the customer only.
Ex: A – Application table (Master and transaction data).

Data Class: It comes under technical settings. It defines the physical address of the database in which the table uses creates and logically stored or it’s a physical place where the actual data is to be stored
Categories of Data Class: APPLO- Master Data, transparent tables.

Size Category: It also comes under technical settings. It defines the probable space requirement for a table in the database.
Categories:
0:- 0 to 30,000.
1:- 30,000 to 1, 20,000.
2:- 1, 20,000 to 4, 90,000.
3:- 4, 90,000 to 1,9,00,000

Table Maintenance allowed: Its also comes under attributes. By enabling table maintenance allowed user can be able to enter the data, change and display manually.

Approaches for creating tables.
There are two approaches you can use when creating tables.
Top-down-approach: In top down approach first we create the field then data element then domain.
Bottom-up-approach: In the bottom-up-approach first we create the domain, then data element and then field.
Direct Method: Do not have data element or domain.

Primary key: Primary key is a field or combination of fields that uniquely identify a row in the database table.
Foreign Key: Foreign Key is a key which is a primary key of another table.

Naming convention for database tables:

1. The tables we are creating are generally called as Z-tables or customizing tables.
2. The name of a table should be started with Y or Z that a user creates.
3. SAP has used A to X for its own use, Z or Y in the beginning means that the program or table is user defined.
So it avoids the redundancy between predefined and customizing tables.

Monday, February 23, 2009

Data Dictionary Objects

Data Dictionary

Data dictionary is the centralized and structured source of information about a database table. It’s a logical layer situated over the database.

Data Dictionary does not contains the data like Emp name, Addresses etc but rather a type of data whose function is to define the properties of data such as type, length and relationship.

Advantages of data dictionary.
1. It helps in maintaining consistency of data when used in different applications.
2. A data type assigned to data dictionary can be available to any program in that application.
3. Data dictionary is a fast and efficient way to answer questions such as which entries exists in
a table of the database, what is the structure of table.

Objects of Data Dictionary
1.Data Base Tables
2.Views
3. Structures
4. Data Elements
5. Domains
6. Search helps
7. Lock objects
8. Primary Key and Foreign Key
9.Table Maintenance Generator

Friday, February 20, 2009

What is ABAP/4

What is ABAP/4 ?


ABAP (Advanced Business Application Programming) is a programming language for developing applications for the SAP R/3 system. ABAP is one of many application-specific fourth-generation languages (4GLs) first developed in the 1980s. The most basic functions were written in ABAP. ABAP/4 is the language created by SAP AG for implementation and customization of their R/3 system.

The ABAP programming language was originally used by developers to develop the SAP R/3 platform. ABAP was one of the first languages to include the concept of Logical Databases (LDBs), which provides a high level of abstraction from the basic database level.

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 language is fairly easy to learn for programmers but it is not a tool for direct use by non-programmers. Good programming skills, including knowledge of relational database design and preferably also of object-oriented concepts are required to create ABAP programs.
From this blog onwards we are looking only for technical part i.e ABAP/4 in detail.

ABAP language Contains below mentioned topics
1.Data Dictionary Objects

Data Base Tables
Views
Structures
Data Elements
Domains
Search helps
Lock objects

Primary Key and Foreign Key
Table Maintenance Generator

2.Internal Tables
Internal Tables Introduction
Declaring Internal Table
Populating Internal Table
Processing Internal Table
Initializing Internal Tables
3.Moduralization Techniques
Sub-routines
Function Module

4. REPORTS
Classical
Interactive
Abap list viewer (ALV)

5. BDC - Batch Data Communication
Session method
Call Taransaction Method

LSMW
6. Module pool Programming
Screen painter
Menu painter

7. Forms
Scripts
Smartforms

8.Cross-Aplications
ALE & IDOCS
BAPI's
BADI’s

9.Miscellaneous Topics
Correction & Transport request (CTS)
Transport Organizer
Work Bench Request
Task Creation
Release Objects
SAP Memory & ABAP Memory
SD Flow
MM Flow

Tuesday, February 17, 2009

R/3 System Architecture

R/3 System Architecture


R/3 is an integrated group of applications designed to handle the data processing for large corporations. The purpose of an R/3 system is to provide tightly integrated large scale business applications.
The below figure shows the structure of R/3 Architecture. The architecture contains four layers as Presentation Servers, Application Servers, Database Servers and Database.

PS: - Presentation Servers
AS: - Application Servers

DBS: - Database Server
DB: - Database


Presentation Servers - The Presentation server is actually a SAPGUI or the user interface. The interface accepts input from the user in the form of keystrokes, mouse clicks and function keys, 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 display to the user.


Application ServerThe 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. Each application server has a profile that specifies its characteristics when it starts up and while it is running. For example, an application severs profile specifies:


1. Number of processes and their types

2. Amount of memory each process may use
3. Length of time a user is inactive before being automatically logged off

The application server exists to interpret ABAP/4 programs, and they only run there-the programs do not run on the presentation server. If your ABAP/4 program requests information from the database, the application server will format the request and send it to the database server.
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 your ABAP/4 program and then you will get the required output on your presentation server.
DatabaseDatabase is nothing but a collection of data arranged for ease and speed of search and retrieval OR A database is a structured collection of records or data that is stored in a computer system.





All requests that come in from presentation servers are directed first to the dispatcher. The dispatcher writes them first to the dispatcher queue. The dispatcher pulls the requests from the queue on a first-in, first-out basis. Each request is then allocated to the first available work process. A work process handles one request at a time.

To perform any processing for a user's request, a work process needs to address two special memory areas: the user context and the program roll area. The user context is a memory area that contains information about the user, and the roll area is a memory area that contains information about the programs execution.


USER Context
A user context is contains information about the user like user name, login id and which program is running currently.

Programma Roll Area.
It’s a memory allocated by the work process for an instance of a program It contains information about the recent program which is executing currently
1. Value of variables
2. Dynamic Memory Allocation
3. Pointers to work Process.


Instance:- The term instance means application server
The term central instance means database server
In general the term instance means server.


Roll In: - When a job is assigned to a work process it creates pointers to the user context and roll area this process is called Roll In.


Roll Out: - After the execution of the job the pointers assigned to both user context and roll area are deleted this process is called Roll Out.
Dialog Steps: - This is the time taken by the systems to show the next screen from existing screen is called as dialog step.

Work process
This is the area in which actual work is done. There are seven types of work process each handles a specific type request.
1. Dialog or Online Process- for Dialog request.
2. Update Process- Request to update data in database.
3. Background Process- Background jobs.
4. Spool Process- print spool request.
5. Enque Process – Logical lock requests
6. Message Process- Routes messages between application server with in an R/3 system
7. Gateway Process- Funnels Messages into and out of the R/3 system.

Components of Work Process
Each Work Process is composed of the following
1. A task handler
2. An ABAP/4 Interpreter
3. A screen Interpreter.
4. A Database Interface
All requests pass through the task handler, which then funnels the request to the appropriate part of the work process and the Interpreters Interpret the ABAP/4 code.


Messages (6 types)
1. S (Success): Green color status bar.
2. E (Error): Red color status bar.
3. W (Warning): Yellow color status bar.
4. I (Information): In a pop-up box.
5. A (Abort): In a pop-up box.
6. X (Exit): Comes out of the program


Using SAP’s Open SQL

ABAP/4 code is portable between databases. To access the database in an ABAP/4 program you will code SAP’s open SQL. Open SQL is a subset and variation of ANSI SQL. The ABAP/4 Interpreter passes all open SQL statements to the database interface part of the work process. There they are converted to SQL i.e. native to the installed RDBMS. For example if you were running an Oracle database your ABAP/4 Open SQL would be converted by the database interface to Oracle SQL statements.


If you use Open SQL, your SQL statements will be passed to the database interface. Using Open SQL has three advantages. All of these advantages are implemented via database interface.

Advantages using Open SQL


1.Buffering Data on the Application Server.
The database interface buffers information from the database on the application server, when data is read from the database, it can be stored in buffers on the application server. If a request is then made to access the same records, they would already be on the application server and the request is satisfied from the buffer without having to go the database. This buffering technique reduces the load on the database server and on the network link between the database and application servers and can speed up database access time by a factor of 10 to 100 times.

2.Portability: - The SQL statements will be portable between databases. For example, if for some reason your company wanted to switch from an Oracle to an Informix database, it could change the database and your ABAP/4 code would continue to run without modification.

3.Automatic client handling:- With Open SQL the client field is automatically populated by the database interface. This gives your development and testing teams may advantages. Such as the ability to perform multiple simultaneous testing and training on a single database without interface from each other

Monday, February 9, 2009

What is SAP and why SAP

What is SAP?


SAP was founded in 1972 by five former IBM engineers in Mannheim, Germany (Dietmar Hopp, Hasso Plattner, Klaus Tschira, Claus Wellenreuther and Hans-Werner Hector) and its headquarters in Walldorf German and since the 2005 annual general meeting the company's official name is just SAP AG.

The acronym of SAP is “Systems, Applications and Products in Data Processing" SAP is the largest software company in Europe and the third largest in the world. It ranks after Microsoft and IBM in terms of market capitalization. SAP is also the largest business application and Enterprise Resource Planning (ERP) solution and software provider in terms of revenue.

Products


SAP's products focus on Enterprise resource planning (ERP), which it helped to pioneer. The company's main product is mySAP ERP. The name of its predecessor, SAP R/3 gives a clue to its functionality: the "R" stands for realtime data processing and the number 3 relates to a 3-tier architecture: database, application server and client (SAPgui). R/2, which ran on Mainframe architecture, was the first SAP version.

Other major product offerings include Advanced Planner and Optimizer (APO), Business Information Warehouse (BW), Customer Relationship Management (CRM), Supply Chain Management (SCM), Supplier Relationship Management (SRM), Human Resource Management Systems (HRMS), Product Lifecycle Management (PLM), Exchange Infrastructure (XI), Enterprise Portal (EP) and SAP Knowledge Warehouse (KW).The APO name has been retired and rolled into SCM. The BW name (Business Warehouse) has now been rolled into the SAP NetWeaver BI (Business Intelligence) suite and functions as the reporting module.

The company also offers a new technology platform, named SAP NetWeaver. While its original products are typically used by Fortune 500 companies, SAP is now also actively targeting small and medium sized enterprises (SME) with its SAP Business One and SAP All-in-One.According to SAP AG there are over 100,800 SAP installations serving more than 38,000 companies. SAP products are used by over 12 million people in more than 120 countries.

1. The name SAP is acronym for Systems, Applications and Products in Data Processing. SAP is an extremely complicated system where no one individual can understand all of it.


2. SAP runs on a fourth generation programming language language called Advance Business Application Programming (ABAP). It have many of the features of other modern programming languages such as the familiar C, Visual Basic, and Power Builder. Your programs name conventions begins with a letter yxxx or zxxx.


3. SAP graphical user interfaces (SAPGUI) runs on Windows / NT / Unix / AS400.


4. SAP is an enterprise resource planning (ERP) software product capable of integrating multiple business applications, with each application representing a specific business area. These applications update and process transactions in real time mode. It has the ability to be configured to meets the needs of the business.


SAP R/3 is a client/server based application, utilizing a 3-tiered model. A presentation layer, or client, interfaces with the user. The application layer houses all the business-specific logic, and the database layer records and stores all the information about the system, including transactional and configuration data.


SAP R/3 functionality is structured using its own proprietary language called ABAP (Advanced Business Application Programming). ABAP, or ABAP/4 is a fourth generation language (4GL), geared towards the creation of simple, yet powerful programs. R/3 also offers a complete development environment where developers can either modify existing SAP code to modify existing functionality or develop their own functions, whether reports or complete transactional systems within the SAP framework.


ABAP's main interaction with the database system is via Open SQL statements. These statements allow a developer to query, update, or delete information from the database. Advanced topics include GUI development and advanced integration with other systems. With the introduction of ABAP Objects, ABAP provides the opportunity to develop applications with object-oriented programming.


The most difficult part of SAP R/3 is its implementation, since SAP R/3 is never used the same way in any two places. For instance, Atlas Copco can have a different implementation of SAP R/3 from Procter & Gamble. Some companies may run multiple productive clients/systems or even multiple instances of SAP R/3. This is seen, for example, when a company running R/3 acquires a new business already running R/3. They may elect to keep both systems separate, migrate one into the other, or migrate both onto a completely new instance.


The system landscape is ultimately the customer's decision. There are definite pros and cons on the continuum from single global instance / productive client (master data, impact of configuration changes on multiple business units) to separate instances per business unit (hardware costs and communication between instances/clients).


Two primary issues are the root of the complexity and of the differences:


Customization configuration - Within R/3, there are tens of thousands of database tables that may be used to control how the application behaves. For instance, each company will have its own accounting "Chart of Accounts" which reflects how its transactions flow together to represent its activity. That will be specific to a given company. In general, the behavior (and appearance) of virtually every screen and transaction is controlled by configuration tables. This gives the implementer great power to make the application behave differently for different environments. With that power comes considerable complexity.


Extensions, Bolt-Ons - In any company, there will be a need to develop interface programs to communicate with other corporate information systems. This generally involves developing ABAP/4 code, and considerable "systems integration" effort to either determine what data is to be drawn out of R/3 or to interface into R/3 to load data into the system.


Due to the complexity of implementation, these companies recruit highly skilled SAP consultants to do the job. The implementation must consider the company's needs and resources. Some companies implement only a few modules of SAP while others may want numerous modules.


SAP has several layers. The Basis System (BC) includes the ABAP programming language, and is the heart (i.e. the base) of operations and should not be visible to higher level or managerial users. Other customizing and implementation tools exist also.


Implementation Tools

There are multiple tools available to assist in the management of ERP implementation projects. SAP R/3, for example, provides an Implementation Roadmap that is broken up into five phases. Each phase includes documentation and planning tools to help the phase move towards completion. The five phases and their respective tasks include:


Project Preparation

1. Building of the project team.

2. Designing the system (This includes network, hardware, and software requirements).

3. Selecting ERP vendors.

4. Defining the project’s scope.


Business Blueprint

1. In this phase project team members decide and document how the business and business processes will function with the implementation of the ERP system. These decisions will guide the configuration of the ERP.

2. Determination of methods to transfer or integrate legacy system information into the ERP system will also occur in this phase.


Realization

1. Configuration of the ERP system occurs in this phase. Configuration guidelines are based on documentation from the Business Blueprint phase.

2. Legacy system connections are developed in this phase.


Final Preparation

1. Testing of the new ERP system.

2. Development of the Help Desk and Help Desk Procedures.

3. Migration of existing data.

4. User training.

5. Schedule a Roll-Out date.


Roll-Out

1. ERP system becomes part of everyday activities.

2. Help Desk fields questions about ERP system.

3. Monitoring of the ERP system starts in this phase.

4.Monitoring of the ERP system starts in this phase.


The time required for each one of these phases differs from project to project based on the size of the implementation, dedication to the project…etc. Oftentimes the finished project’s scope differs from the original scope’s documentation causing projects to go overtime and over budget. When this happens, it is usually testing and training that get cut short which jeopardize the overall success of the project.

Why SAP?
1. SAP is a platform independent; it can support various databases like Oracle, SQL Server.
2. SAP also supports various operating systems.
3. The integrity between its various modules makes SAP more user friendly.

Areas of SAP
There are three areas in SAP.
1.Functional Area
There are more than 25 functional modules in SAP.
Those who work on functional areas are called Functional Consultants.
Ex: - PP – Production planning
MM- material management
SD- Sales and Distribution
FI- Financial Accounting
CO- Controlling
HR- human Resources
PM- Plant Maintenance. Etc
2. Technical Area
Here the technical consultants i.e. ABAPers are working.
Technical Consultants will implant the ideas of functional Consultants.
3. Basis Area
Here the basis people will work.
The following works are generally done here
Creation users
Authorization
Dispatcher
Role Allocation

Introduction to ERP

Introduction to ERP (Enterprise resource planning)

There are many different systems in a large company's including planning, manufacturing, distribution, shipping, and accounting.

Enterprise resource planning (ERP) is a system that integrates all of these functions into a single system, designed to serve the needs of each different department within the enterprise. ERP is more of a methodology than a piece of software, although it does incorporate several software applications, brought together under a single, integrated interface.

Enterprise resource planning (ERP) systems integrate primary business applications; all the applications in an ERP suite share a common set of data that is stored in a central database. A typical ERP system provides applications for accounting and controlling, production and materials management, quality management, plant maintenance, sales and distribution, human resources, and project management.

Why should you be interested? Because, basically, a well-implemented and appropriate ERP system can create significant efficiencies across your business, resulting in timely business information, better customer relationships, a more cost-effective supply chain, improved internal process and, ultimately, increased profitability.

The ERP system goes far beyond being just a simple piece of software. Each implementation is unique and is designed to correspond to the implementer's various business processes. Regardless of how a company approaches it, ERP is sure to bring significant changes to how a company does business. An ERP implementation can cost millions of dollars to create, and may take several years to complete.

Once implemented however, the ERP system brings tremendous advantages. Because all systems are joined together, all departments can more easily share information. The workflow that takes place between departments can become much more automated, and ultimately, customers are better served because the individual using the customer-facing applications will have access to every bit of information regarding each relevant process. For example, someone in sales would easily be able to log into a single system to determine the status of a customer order that is still in manufacturing. All this comes at a cost though; training costs are high because employees must not only learn how to use new software, they must also learn new processes.

ERP Improves Productivity
Before ERP systems, each department in an organization would most likely have their own computer system, data and database. Unfortunately, many of these systems would not be able to communicate with one another or need to store or rewrite data to make it possible for cross computer system communication. For instance, the financials of a company were on a separate computer system than the HR system, making it more intensive and complicated to process certain functions.
Once an ERP system is in place, usually all aspects of an organization can work in harmony instead of every single system needing to be compatible with each other. For large organizations, increased productivity and less types of software are a result.


Implementing Enterprise Resource Planning
ERP software is complex and expensive. Companies must devote significant human resources to ERP projects and often hire consultants or systems integrators to help implement the systems. As a result, the company can spend millions of dollars and several years on ERP projects. This report outlines the challenges companies should expect for ERP implementation and outlines the six main steps of an ERP project:
Vendor Selection
Business Strategy Formation
Application Configuration
Testing and End-user Acceptance
Training
Rollout


Benefits of implementing ERP systems:
Inventory Reduction
Improved Cash Management
Increased Revenue and Profits
Reduced Transportation and Logistics Costs
Reduced Information Technology (IT) Costs
Intangible benefits include unanticipated cost reductions, improved responsiveness to customers, more flexibility, and more effective management of the supply chain.


Advantages of ERP Systems
There are many advantages of implementing an EPR system; here are a few of them:
A totally integrated system
The ability to streamline different processes and workflows
The ability to easily share data across various departments in an organization
Improved efficiency and productivity levels
Better tracking and forecasting
Lower costs
Improved customer service


Disadvantages of ERP Systems
While advantages usually outweigh disadvantages for most organizations implementing an ERP system, here are some of the most common obstacles experienced:
Usually many obstacles can be prevented if adequate investment is made and adequate training is involved, however, success does depend on skills and the experience of the workforce to quickly adapt to the new system. Customization in many situations is limited
The need to reengineer business processes
ERP systems can be cost prohibitive to install and run
Technical support can be shoddy
ERP's may be too rigid for specific organizations that are either new or want to move in a new direction in the near future.


ERP software packages Available in the Market
Baan from Infor Global Solutions: The Baan Corporation provides the financial and administrative consulting services.
JD Edwards Enterprise One & JD Edwards World from Oracle: JD Edward is into accounting business software development and an ERP system JDE comprises 3 basic areas of expertise, functional-business, and programmer-developer and technical-CNC-system administration.
Oracle e-Business Suite from Oracle : Oracle is into finance applications and Oracle relational database management system technology
PeopleSoft from Oracle: PeopleSoft is into Human resource management systems (HRMS) applications.
SAP R/3 from SAP: The most widely used modules in this ERP are Financials and Controlling (FICO), Human Resources (HR), Materials Management (MM), Sales & Distribution (SD), and Production Planning (PP) and it’s an integration around 25 modules. It’s the biggest ERP package in the Market.

Many more ERP packages are available in the market.

Enterprise:- Organization or Business oriented company.
Resource:- Man, Money, Machines and materials etc.
Planning:-Plans to maximum utilization of resources with cost minimization.


The ultimate aim of using ERP is planning with the available resources of an enterprise to get the maximum output with cost minimization.