Sunteți pe pagina 1din 52

ABAP MATERIAL

Vikas Kumar ZHA

Table of Contents
Definition of ERP ......................................................................................................................... 5
Evolution of ERP .......................................................................................................................... 5
Enabling Technologies for ERP ......................................................................................................... 6
ERP Characteristics ...................................................................................................................... 6
Features of ERP ........................................................................................................................... 6
Why ERP .................................................................................................................................... 7
Benefits of ERP............................................................................................................................ 7
Business Process Reengineering (BPR) ................................................................................................ 8
What is BPR ................................................................................................................................ 9
Business Engineering ..................................................................................................................... 9
ERP Implementation ..................................................................................................................... 9
Risk and Governance issue in ERP .................................................................................................... 10
ERP Architecture ........................................................................................................................ 11
R/1 Architecture ...................................................................................................................... 11
R/2 Architecture ...................................................................................................................... 11
R/3 Architecture ...................................................................................................................... 12
Different Layers of System............................................................................................................. 12
Presentation Server .................................................................................................................. 12
Application Server .................................................................................................................... 12
Database Server ....................................................................................................................... 12
Famous ERP Vendors .................................................................................................................... 12
What is SAP ............................................................................................................................... 14
History of SAP ............................................................................................................................ 14
SAP R/1 ................................................................................................................................. 14
SAP R/2 ................................................................................................................................. 14
SAP R/3 ................................................................................................................................. 14
Timeline ................................................................................................................................ 14
SAP Version Releases ................................................................................................................... 14
SAP Architecture......................................................................................................................... 15
SAP GUI .................................................................................................................................... 16
Logon Pad .............................................................................................................................. 16
SAP Window ............................................................................................................................ 17
ABAP Editor ............................................................................................................................... 17
What is Code Editor .................................................................................................................. 17
Why it is needed ...................................................................................................................... 18
Editor Features ........................................................................................................................ 18
ABAP Overview ........................................................................................................................... 21
ABAP Statements ........................................................................................................................ 21
ABAP Words ............................................................................................................................ 21
1|Page

Operands ............................................................................................................................... 22
Operators and Expression ........................................................................................................... 22
Naming Conventions .................................................................................................................... 22
Chained Statements ..................................................................................................................... 22
Comments ................................................................................................................................ 23
Comment Lines ........................................................................................................................ 23
Line end comment .................................................................................................................... 23
Executable Program (SE38). ........................................................................................................... 23
REPORT rep ........................................................................................................................... 23
NO STANDARD PAGE HEADING ................................................................................................ 23
LINE-SIZE width ................................................................................................................ 24
LINE-COUNT page-LINES [(footer_lines)] ................................................................................... 24
MESSAGE-ID mid ................................................................................................................. 24
DEFINING DATABASE ldb ...................................................................................................... 24
REDUCED FUNCTIONALITY ..................................................................................................... 24
Predefined Data Types ................................................................................................................. 24
Predefined Elementary ABAP Types ............................................................................................... 24
Numeric Types ...................................................................................................................... 25
Character types .................................................................................................................... 25
Hexadecimal Type ................................................................................................................. 26
Predefined ABAP Types with Variable Length ...................................................................................... 26
STRING for character strings........................................................................................................ 26
XSTRING for byte strings ............................................................................................................ 26
Internal Table ............................................................................................................................ 26
Standard Internal Table ............................................................................................................. 26
Sorted Internal Table ................................................................................................................ 27
Hashed Internal Table ............................................................................................................... 27
ABAP Data Dictionary ................................................................................................................... 28
Objects in Data Dictionary .......................................................................................................... 28
Data Types ................................................................................................................................ 30
Built-In Elementary Data Types .................................................................................................... 30
ACCP: Posting Period .............................................................................................................. 30
CHAR: Character String ........................................................................................................... 30
CLNT: Client ........................................................................................................................ 30
CUKY: Currency Key ............................................................................................................... 30
CURR: Currency Field ............................................................................................................. 31
DATA: Date Field ................................................................................................................... 31
DEC: Decimal Field ................................................................................................................ 31
FLTP: Floating Point Number .................................................................................................... 31
INT1: One-Byte Integer ........................................................................................................... 31
2|Page

INT2: Two-Byte Integer ........................................................................................................... 31


INT4: Four-Four-Byte Integer .................................................................................................... 31
LANG: Language Key .............................................................................................................. 31
LCHR: Long Character String ..................................................................................................... 31
LRAW: Long Uninterpreted Byte String ........................................................................................ 31
NUMC: Numeric Text .............................................................................................................. 32
PREC: Accuracy Field .............................................................................................................. 32
QUAN: Quantity Field ............................................................................................................. 32
RAW: Uninterpreted Byte String ................................................................................................ 32
RAWSTRING: Uninterpreted Byte string variable ............................................................................. 32
STRING: Character String with Variable Length .............................................................................. 32
TIMS: Time Field ................................................................................................................... 32
UNIT: Unit Field .................................................................................................................... 32
VARC: Character Field with Variable Length .................................................................................. 32
User-Defined Data Types ............................................................................................................ 32
Elementary Data Types ........................................................................................................... 33
Reference data types ............................................................................................................. 33
Complex Data Types ............................................................................................................... 33
Domain .................................................................................................................................... 34
Attributes of Domain ................................................................................................................. 34
Short Description................................................................................................................... 34
Properties Tab ...................................................................................................................... 35
Definition Tab ...................................................................................................................... 35
Value Range Tab ................................................................................................................... 36
Documentation ..................................................................................................................... 37
Creating Domain ...................................................................................................................... 37
Data Element ............................................................................................................................. 40
Attributes of Data Elements ........................................................................................................ 40
Short Description................................................................................................................... 40
Attributes Tab ...................................................................................................................... 40
Data Type Tab ...................................................................................................................... 41
Field Label Tab ..................................................................................................................... 42
Further Characteristics ........................................................................................................... 42
Documentation ..................................................................................................................... 43
Creating Data Element ............................................................................................................... 44
Important Transaction Codes .......................................................................................................... 47
Important Shortcut keys................................................................................................................ 50
System Shortcut ....................................................................................................................... 50
Interview Questions ..................................................................................................................... 51

3|Page

4|Page

ERP
Definition of ERP
An Enterprise resource planning system is a fully integrated business management system covering functional areas
of an enterprise like Logistics, Production, Finance, Accounting and Human Resources. It organizes and integrates
operation processes and information flows to make optimum use of resources such as men, material, money and
machine.
Enterprise resource planning promises

one database,

one application,

one user interface

for the entire enterprise, where once disparate systems ruled manufacturing, distribution, finance and sales.

Evolution of ERP
In the ever-growing business environment, the following demands are placed on the industry:

Aggressive cost control initiatives

Need to analyze costs/revenues on a product or customer basis

Flexibility to respond to changing business requirements

More informed management decision making

Changes in ways of doing business.

One or more applications and planning systems have been introduced into the business world for crossing some of
hurdles and achieving growth. They are:

Management Information Systems (MIS)

Integrated Information Systems (IIS)

Executive Information Systems (EIS)

Corporate Information Systems (CIS)

Enterprise Wide Systems (EWS)

Material Requirement Planning (MRP)

Manufacturing Requirement Planning (MRP II)

Money Resource Planning (MRP III)

ERP has evolved from the system known as MRPII (Manufacturing Requirement planning) system with the integration
of information between Vendor, Customer and Manufacturer using networks such as LAN, WAN and INTERNET etc.
MRPII system again evolved from MRP (Material Requirement Planning) system. MRP is a technique that explodes the
end product demands obtained from Master Production Schedule (MPS) for the given product structure which is taken
from Bill of Material (BOM) into a schedule of planned orders considering the inventory in hand.
5|Page

MRPII has a number of drawbacks.

The main problem is that it has not been able to effectively integrate the different functional areas to share
the resources effectively.

The traditional application systems, which the organizations generally employ, treat each transaction
separately

They are built around the strong boundaries of specific functions that a specific application is meant to cater.

For an ERP, it stops treating these transactions separately as stand-alone activities and considers them to be the part
of the inter-linked processes that make up the business.

Enabling Technologies for ERP

It is not possible to think of an ERP system without sophisticated information technology infrastructure.

It is said that, the earlier ERP systems were built only to work with huge mainframe computers.

The new era of PC, advent of client server technology and scalable Relational Database Management Systems
(RDBMS)

Most of the ERP systems exploit the power of Three Tier Client Server Architecture.

The other important enabling technologies for ERP systems are Workflow, Work group, Group Ware,
Electronic Data Interchange (EDI), Internet, Intranet, Data warehousing, etc.

ERP Characteristics
Any system has to possess few key characteristics to qualify for a true ERP solution. These features are:
1.

Flexibility: An ERP system should be flexible to respond to the changing needs of an enterprise. The client
server technology enables ERP to run across various database back ends through Open Database Connectivity
(ODBC).

2. Modular & Open: ERP system has to have open system architecture. This means that any module can be
interfaced or detached whenever required without affecting the other modules. It should support multiple
hardware platforms for the companies having heterogeneous collection of systems. It must support some
third party addons also.
3. Comprehensive: It should be able to support variety of organizational functions and must be suitable for a
wide range of business organizations.
4. Beyond The Company: It should not be confined to the organizational boundaries, rather support the on-line
connectivity to the other business entities of the organization.
5. Best Business Practices: It must have a collection of the best business processes applicable worldwide. An
ERP package imposes its own logic on a companys strategy, culture and organization.

Features of ERP
Some of the major features of ERP and what ERP can do for the business system are :

ERP provides multi-platform, multi-facility, multi-mode manufacturing, multi-currency, multi-lingual


facilities.

6|Page

It supports strategic and business planning activities, operational planning and execution activities, creation
of Materials and Resources.

ERP covering all functional areas like manufacturing, selling and distribution, payables, receivables, inventory,
accounts, human resources, purchases etc.

ERP performs core activities and increases customer service, thereby augmenting the corporate image.

ERP bridges the information gap across organisations.

ERP provides complete integration of systems not only across departments but also across companies under
the same management.

ERP is the solution for better project management.

ERP allows automatic introduction of the latest technologies like Electronic Fund Transfer (EFT), Electronic
Data Interchange (EDI), Internet, Intranet, Video conferencing, E-Commerce etc.

ERP eliminates most business problems like material shortages, productivity enhancements, customer service,
cash management, inventory problems, quality problems, prompt delivery etc.

ERP provides intelligent business tools like decision support system, Executive information system, Data
mining and easy working systems to enable better decisions.

Why ERP
1. Integrate financial information: As the CEO tries to understand the companys overall performance, he may
find many different versions of the truth. ERP creates a single version of the truth that cannot be questioned
because everyone is using the same system.
2. Integrate customer order information: ERP systems can become the place where the customer order lives
from the time a customer service representative receives it until the loading dock ships the merchandise and
finance sends an invoice. By having this information in one software system companies can keep track of
orders more easily, and coordinate manufacturing, inventory and shipping among many different locations
simultaneously.
3. Standardize and speed up manufacturing processes: Manufacturing companies -especially those with an
appetite for mergers and acquisitionsoften find that multiple business units across the company make the
same transaction / recording / report using different methods and computer systems. ERP systems come with
standard methods for automating some of the steps of a manufacturing process.
4. Reduce inventory: ERP helps the manufacturing process flow more smoothly, and it improves visibility of the
order fulfilment process inside the company. That can lead to reduced inventories of the materials used to
make products (work-in-progress inventory), and it can help users better plan deliveries to customers,
reducing the finished good inventory at the warehouses and shipping docks.
5. Standardize HR information: Especially in companies with multiple business units, HR may not have a unified,
simple method for tracking employees time and communicating with them about benefits and services. ERP
can fix that

Benefits of ERP
Following are some of the benefits they achieved by implementing the ERP packages:

7|Page

Gives Accounts Payable personnel increased control of invoicing and payment processing and thereby boosting
their productivity and eliminating their reliance on computer personnel for these operations.

Reduce paper documents by providing on-line formats for quickly entering and retrieving information.

Improves timeliness of information by permitting posting daily instead of monthly.

Greater accuracy of information with detailed content, better presentation,

Satisfactory for the auditors.

Improved cost control.

Faster response and follow-.up on customers.

More efficient cash collection, say, material reduction in delay in payments by customers.

Better monitoring and quicker resolution of queries.

Enables quick response to change in business operations and market conditions.

Helps to achieve competitive advantage by improving its business process.

Improves supply-demand linkage with remote locations and branches in different countries.

Provides a unified customer database usable by all applications.

Improves International operations by supporting a variety of tax structures, invoicing schemes, multiple
currencies, multiple period accounting and languages.

Improves information access and management throughout the enterprise.

Provides solution for problems like Y2K and Single Monetary Unit (SMU) or Euro Currency

Business Process Reengineering (BPR)


ERP is a result of a modern Enterprises concept of how the Information System is to be configured to the challenging
environments of new business opportunities. However merely putting in place an information system is not enough.
Every company that intends to implement ERP has to reengineer its processes in one form or the other. This process
is known as Business Process
Some Typical processes with descriptions
Process

Description

Forecasting

Shows sales, Fund Flows etc over a long period of time say next two years

Fund management

The necessity of funds and the way to raise these funds.

Price Planning

Uncertainty and Risk factors to be considered. Simulation with What if type


analysis determines the price at which products are offered. Involves application
of technology to pricing support such as commercial database services. Also
feedback and sensitivity analysis

Budget Allocation

Using computerized algorithms to estimate desirable mix of funds allocated to


various functions.

Material
Planning

Process of making new products from raw materials and include production
scheduling, requirement planning. Also activities for monitoring and planning of
actual production.

Quality control

requirement

Takes care of activities to ensure that the products are of desired quality.

8|Page

What is BPR
BPR is the fundamental rethinking and radical redesign of processes to achieve dramatic improvement, in critical,
contemporary measures of performance such as cost, quality, service and speed,

Dramatic achievement means to achieve 80% or 90% reduction (in say, delivery time, work in progress or
rejection rate) and not just 5%, 10% reduction.

Radical redesign means BPR is reinventing and not enhancing or improving. In a nutshell, a cleansiate
approach of BPR says that Whatever you were doing in the past is all wrong, do not get biased by it or
reassemble you new system to redesign it afresh.

Fundamental rethinking means asking the question why do you do what you do, thereby eliminating
business process altogether if it does not add any value to the customer.

Business Engineering
Business Engineering has come out of merging of two concepts
1. Information Technology
2. Business Process Reengineering.

Business Engineering is the rethinking of Business Processes to improve speed, quality and output of materials
or services.

The main point in business engineering is the efficient redesigning of companys value added chains.

Value added chains are a series of connected steps running through a business which when efficiently
completed add value to enterprise and customers.

Information technology helps to develop business models, which assist in redesigning of business processes.

Business Engineering is the method of development of business processes according to changing requirements.

ERP Implementation

The success of an implementation mainly depends on how closely the implementation consultants, users and
vendors work together to achieve the overall objectives of the organization.

The implementation consultants have to understand the needs of the users, understand the prevailing
business realties and design the business solutions keeping in mind It is the users who will be driving the
implementation and therefore their all these factors active involvement at all stages of implementation is
vital for the overall success of implementation.

It is worthwhile to remember that ERP is an enabling tool, which makes one do his work better, which
naturally need additional efforts.

During the course of implementation the standard package may undergo changes which may be a simple one
or a major functionality change. Implementing such changes is known as Customization.

The contents of the package are known as modules and the modules are further divided into Components.

The roles and responsibilities of the employees have to be clearly identified, understood and the employees
will have to accept new processes and procedures configured in the system laid down in the ERP system.

At the same time these processes and procedures have to be simple and user friendly.
9|Page

A well-managed and implemented ERP package can give a 200 percent return on investment where as a poorly
implemented one can yield a return on investment as low as 25 percent.

Risk and Governance issue in ERP


Organizations face several new business risks when they migrate to real-time, integrated ERP systems. Those risks
include:

Single point of failure: Since all the organization data and transaction processing is within one application
system and transaction processing is within one application system. Structural changes significant personnel
and organizational structures changes associates with reengineering or redesigning business processes.

Job role changes: transition of traditional users roles to empowered-based roles with much greater access
to enterprises information in real time.

Online, real-time: An online real-time system environments requires a continuous business environment
capable of utilizing the new capabilities of the ERP application and responding quickly to any problem
requiring of re-entry of information.

Change management: It is challenging to embrace a tightly integrated environment when different business
processes have existed among business units for so long. The level of user acceptance of the system has a
significant influence on its success. Users must understand that their actions or inaction have a direct impact
upon other users and, therefore, must learn to be more diligent and efficient in the performance of their
day-today duties. Considerable training is therefore required for what is typically a large number of users.

Distributed computing experience: Inexperience with implementing and managing distributed computing
technology may pose significant challenges.

Broad system access: Increased remote access by users and outsiders and high integration among application
functions allow increased access to application and data.

Dependency on external assistance: Organization accustomed to in-house legacy systems may find they
have to rely on external help. Unless such external assistance is properly managed, it could introduce an
element of security and resource management risk that may expose the organizations to greater risk.

Program interfaces and data conversions: Extensive interfaces and data conversions from legacy systems
and other commercial software are often necessary. The exposures of data integrity, security and capacity
requirements for ERP are therefore often much higher.

Audit expertise: Specialist expertise is required to effectively audit and control an ERP environment. The
relative complexity of ERP systems has created specialization such that each specialist may know only a
relatively small fraction of the entire ERPs functionality in a particular core module,

More recently, some of the additional risks and good governance issues introduced by the enabled ERP environments
concern:

Single sign on: It reduces the security administration effort associated with administrating web-based access
to multiple systems, but simultaneously introduces additional risk in that an incorrect assignment of access
may result in inappropriate access to multiple systems.

Data content quality: As enterprise applications are opened to external suppliers and customers, the need
for integrity in enterprise data becomes paramount.

Privacy and confidentiality: Regularity and governance issues surrounding the increased capture and
visibility of personal information, i.e. spending habits.

10 | P a g e

ERP Architecture
R/1 Architecture
In this all 3 layers [Presentation + Application +Database] are
(Server One Presentation + Application + Database)

installed

in

one

systems/server.

R/2 Architecture
In this all 3 layers [Presentation + Application + Database] are installed in two separate systems/server.
(Server One Presentation, Server Two Application +Database)

11 | P a g e

R/3 Architecture
In which all 3 layers [Presentation + Application + Database] are installed in three separate systems/server.
(Server One -Presentation, server Two Application, Server Three Database)

Different Layers of System


Presentation Server
This is a layer through which user interacts to the system. This is also known as front end system. The actual
system on which we work and forms and reports are executed.
Application Server
Under this layer, the actual business logic resides. All the inputs from user thorough presentation server,
reaches application server for processing. This acts as in interface between Presentation and Database server. Actual
code resides in this layer
Database Server
At this layer we store data for future use. Database layer actually has different database software installed
and business data. Application Layer when required connects to this layer and get data for use.

Famous ERP Vendors

SAP

PeopleSoft

Oracle

JD Edwards

Baan

12 | P a g e

MFG/PRO

Navision (Microsoft Dynamics NAV)

13 | P a g e

SAP
What is SAP
SAP (System Application product) is an ERP system by SAP AG, company based out of Walldorf in Germany.
AG is derived from the German word AKtiengesellschaft. According to German Language SAP Stands for
Systemanalyse und Programmentwicklung. Which was later changed to Systeme, Anwendungen und Produkte in
Der Datenverarbeitung. SAP software suite that is being implemented as part of re-engineering and provides end to
end solutions for financial, logistics, distribution, inventories.

History of SAP
SAP was found in and around 1972 by five IBM engineers Dietmar Hopp, Claus Wellenruther, Hans-Werner
Hector, Klaus Tschira and Hasso Plattner.
SAP R/1
The first version of SAP software was launched in and around 1972 known as the R/1 system. R stands for
rea-time data processing. It is one tier architecture in which three layers Presentation, Application and Database are
installed in one system/ server.
SAP R/2
This was the second version of SAP software released for mainframe computers in 1979. It is 2 tier architecture
in which Presentation layer was installed on one server and application layer along with database was installed on
another.
SAP R/3
This was the third version of release in 1992 by SAP. SAP introduced client server architecture for the first
time in real time environment through R/3 implementation. This has 3 tier and all the layers (Presentation,
Application and Database) where installed on separate severs.
Timeline

1972 : SAP AG Founded in Germany

1979 : SAP R/2 introduced for mainframe computers

1992 : SAP R/3 Released as client-server application

1996 : SAP R/3 became partially internet enabled

1997 : Developed and launched the new dimensional product line including, CRM, SCM and data warehousing.

1999 : SAP announced MySAP.com, next generation of its enterprise application system, based on internet
architecture.

2000-2005 : Introduced my SAP business suite, NetWeaver and XApplications.

2010 : Entered Mobile

2011 : Introduced HANA and cloud computings

SAP Version Releases

SAP R/1, System RF 1972


14 | P a g e

SAP R/2, ran on a Mainframe architecture 1979

SAP R/3 Enterprise Edition 1.0 A - July 1992

SAP R/3 Enterprise Edition 2.0 1993

SAP R/3 Enterprise Edition 3.0 1995

SAP R/3 Enterprise Edition 4.0 B - June 1998

SAP R/3 Enterprise Edition 4.3

SAP R/3 Enterprise Edition 4.5 B - March 1999

SAP R/3 Enterprise Edition 4.6 C - April 2001

SAP R/3 Enterprise Edition 4.6 F

SAP R/3 Enterprise Release 4.70 Release Date March- Dec 2003[2]

SAP R/3 Enterprise Edition 4.7

SAP R/3 Enterprise Central Component (ECC) 5.0 - 2004

SAP R/3 Enterprise Central Component (ECC) 6.0 - Oct 2005- Jun2006

SAP ERP 6.0 - Enhancement Packages (1,2,3,4,5,6,7)

SAP S/4 HANA

SAP Architecture

Internet communication Manager(ICM)-set up connection to internet. Supports protocol HTTP,SMTP.

15 | P a g e

Dispatcher distributes the requests to the work processes. If all the processes are occupied then the requests
are stored in dispatcher queue.

ABAP Work Process executes the ABAP code.

SAP gateway makes the RFC interface between SAP instances available.

Message server exchanges the messages and balances the load.

SAP GUI
Logon Pad
SAP Logon PAD is installed on presentation server and is also known as SAP GUI (Graphical User Interface).
We usually have all the application server path created on Logon Pad, so that we can enter the desired application
server. All the application systems are shown on Logon pad as Icons.
We have to select the system and create on Logon to enter the system

Select the system you have created and click on Log on Button to enter the application server.

16 | P a g e

Client: A commercially, organizationally and technically self-contained unit within an SAP system is called Client. It
has its own master records and set of tables. The definition of client organizational unit is obligatory, as it is the
highest level in the SAP system hierarchy. Specifications that entered at this level are valid for all company codes
and for all other organizational structure.
The user must enter a client key when they log on to the SAP System. This defines the client in which they wish to
work. All the entries the user enters, are saved per client. Data processing and analysis is also carried out per client.
Access authorization is assigned per client.
User: The user ID assigned or created to login into the client or application server of client
Password: Each user ID is assigned to a password and we should provide both to login.
Language: Language is entered so that application server can start in specific language, which we entered.

SAP Window
Shown below is SAP Easy access window. Let us see the screen in more detail.

Command field: This is the input field where we actually enter the Transaction code to the different component of
SAP

ABAP Editor
What is Code Editor
The Code Editor is a new ActiveX control written in C++ that integrates all modern code editing features in
one bundle. The Code Editor is universal. It can work with any programming language with a defined syntax schema,
such as ABAP, eCATT, BSP, GML, C++, etc. The Code Editor is fast, flexible, and easy to use.
17 | P a g e

The Code Editor comes with SAP GUI for Windows 7.0, and patched to SAP GUI for Windows 6.40 Patch 10.
The Code Editor is used instead of the current editor in all transactions (SE80, SE38, SE37, SE24, etc.) Old functionality
remains, but is enhanced by new features. The Code Editor is used for editing BSP, eCATT, and GML Scripts in Eclipse.
The Code Editor is integrated with New ABAP Debugger.
Why it is needed

To Program Faster

To Read the code more easily

To get the code of better quality

To have good navigation through our changes

To have completely flexible tool

To have a comfortable tool

Editor Features
Let us now examine some of the editor features

Define colors for text blocks

Define styles for text blocks

User-defined text blocks

Use of any font and size

Only mono-spaced option

18 | P a g e

See Start / End / Middle of language block

Collapse/Expand Block

Collapse same type blocks

Collapse Comments

User defined Outlining Regions

See current scope

See collapsed text

19 | P a g e

User and language dependent


Expandable by Ctrl + Enter
Built in runtime tags (Date Time, Clipboard Content, Document Name)
Interactive tags
Suggested by Code Hints
Extract template from selected text Surround by template

20 | P a g e

PROGRAMING IN SAP ABAP


ABAP Overview
ABAP is a programming language developed by SAP for programming commercial applications in the SAP
environment. This introductory section presents the most essential properties.
In SAP Net Weaver, ABAP presents the programming interface of application server ABAP (AS ABAP). The
installation of AS ABAP is the prerequisite for using the ABAP programming language. Based on their task, most
components of AS ABAP can be classified in layers of a three stage client server architecture, including a presentation
layer, application layer and database layer.
ABAP is a 4GL language that has been developed specifically for the mass data processing in commercial
applications. Among other things, it offers the following benefits compared to more elementary languages where
such functions are located in libraries.

Database access integrated in the language as open SQL

Performance optimization of database access that is integrated in the ABAP runtime environment via the SAP
buffering.

Internal tables for the dynamic storage and processing of tabular mass data in the working memory

Online transaction processing concept (OLTP) integrated in the ABAP runtime environment where many users
simultaneously access the central database implemented via the SAP-LUW

Interface to other programming environments that is integrated in the language via RFC

Interface to XML integrated in the language.

ABAP programs can be programmed completely independent of the natural language by swapping languagespecific program part from the source code and loading them during program execution depending on the environment.
A test environment determines the actual program behavior, for instance, the order for the test sorting at runtime.
As ABAP supports both Unicode and non-Unicode systems, Non-Unicode systems are ABAP systems in which
characters are normally represented by 1 byte each. Unicode systems are ABAP systems that are based on Unicode
character representation (UTF-16) and that build on an appropriate operating system and database. Today, it is
recommended to only use the Unicode character sets in Unicode system.
A Unicode system can only run Unicode programs in which the program property, UNICODE CHECKS ACTIVE, is
selected. New programs should only be created as Unicode programs Existing non Unicode programs can be converted
to Unicode program by activating this property appropriate adaptations must be made if required.

ABAP Statements
ABAP statements consist of the following tokens and always end with a period (.).

ABAP Words
ABAP Operands
ABAP Operators

The token of a statement must be separated by at least one blank character or a line break. Otherwise, blank
characters and line breaks between tokens are not significant. An ABAP statement is not limited to a line of a source
code. The ABAP notation is not case-sensitive.
ABAP Words

21 | P a g e

ABAP words are the vocabulary of the ABAP language. ABAP statements are composed of ABAP words,
operands, and operators according to defined syntax rules. ABAP words are taken from the English Language and are
grouped into ABAP language elements and into ABAP language element additions that express the semantics of a
statement. In addition to letters, ABAP words can also contain hyphens (-) and, in some cases, underscores (_) to
form multi-word expressions.
The first ABAP word of a statement is the ABAP Key word. A single ABAP word can be used both as a key word
and as a non-key word. Ex. DATA is used as a key word as well as an addition to other key words.
Operands
Typical operands are:

Data objects of the same ABAP Program:

Types from the same program or the Repository

Callable units of the same program or repository

Operators and Expression


An operator usually links two operands to an expression or is used with one operand to form an expression.
When a statement is executed that contains such expressions. The result of the expression is determined and is used
in the statement. Operators are coded either using special characters or reserved identifiers.

Naming Conventions
The following conventions apply for the names of all definable objects within ABAP Programs, such as data
types, data objects, classes, macros and procedures:

A name can be up to 30 characters long


Permitted are the letters A to Z, the digits from 0 to 9 and the underscore (_). Outside of ABAP
objects and in non-Unicode programs, you can also use other character.
The name must start with letter or an underscore. Only outside of ABAP objects can the name also start with
a different character.
The name can have a namespace prefix. A namespace prefix consists of at least there characters that are
enclosed by two backslashes (//). The entire length of prefix and name must not exceed 30 characters.
For data types and data objects, you must not use the names of predefined ABAP types or predefined data
objects.
Although the use of names, which are reserved for ABAP words, is not forbidden for your own definitions, we
strongly advise against it.
Field symbols are special in that their names have to be enclosed in angle brackets (<>).

Chained Statements
Consecutive statements that have the same initial part can be linked in one single chained statement. To do
this, the identical initial part is specified once and closed with a colon (:). The remaining parts behind are listed
separately, divided by commas (,), and closed with a full-stop. During syntax check and program execution, a chained
statement is treated as the respective sequence of individual ABAP statements. The initial parts are not restricted
to the key word.
DATA: col1 TYPE c LENGTH 4,
col2 TYPE c LENGTH 5,
col3 TYPE c LENGTH 7.
The complete syntax of three statement is
22 | P a g e

DATA col1 TYPE c LENGTH 4.


DATA col2 TYPE c LENGTH 5.
DATA col3 TYPE c LENGTH 7.

Comments
A comment is a description inserted in the source code of a program that helps the user better understand
the program and is ignored by the ABAP complier when generating the program. From the technical perspective, the
comment can have any content. Two language elements are available to create comments.

The * character in the first position of a line in a program defines the entire row as comment
The character at any position in a program line defines all the following content in that line until end of the
row as a comment. Exceptions form this rule are characters in character literals and pseudo comments

Comment Lines
A comment line contains nothing but comment. A comment line can be defined either by the * charter in the
first positon in the program line or by the character at any position in a program line that is empty otherwise.
*--------------------------------------------------------------------*
* Some comment
*--------------------------------------------------------------------*
" Some Comment
Line end comment
A line end coment is a comment starting with the Charter that stands behind an ABAP statement or parts
thereof.
DATA name TYPE c LENGTH 30. " Variable for User Name

Executable Program (SE38).


This program as created with the help of Transaction Code SE38 (ABAP Editor). The execution of a program
is either through SUBMIT statement or through call of Dynpro or selection screen via a transaction code.
Syntax
REPORT rep
NO STANDARD PAGE HEADING
LINE-SIZE width
LINE-COUNT page_lines[(footer_lines)]
MESSAGE-ID mid
DEFINING DATABASE ldb
REDUCED FUNCTIONALITY.
REPORT rep
The REPORT statement introduces an executable program. It must be the first statement of a standalone
program following the resolving of possible include program. You must specify the name rep directly. Other
statements are optional additions.
NO STANDARD PAGE HEADING
The addition suppresses the output of the standard page header (Standard header and column headers) on
the basic list of the program and sets the system field SY-WTITL to the value N. We can overwrite this setting
23 | P a g e

during list creation with the addition of NO-TITLE or WITH-TITLE and NO-HEADING OR WITH-HEADING to the NEW
PAGE statement.
LINE-SIZE width
The addition specifies the lie width of the basic list and details list of the program to width characters and
sets the system field SY-LINSZ to this value. The line width determines how many characters will be displayed per
line. The maximum line width is 1023.
When LINE-SIZE is not specified, the line width of the basic list is set to the standard width based on the
window width of the current Dynpro, but it is at least as wide as the standard size SAP Window. For standard width
the content of SY-LINSZ is 0.
The Current maximum line width is stored in the constant SLIST_MAX_LINESIZE of the type group SLIST. A
type SLIST_MAX_LISTLINE of type C and length SLIST_MAX_LINESIZE is defined there as well.
LINE-COUNT page-LINES [(footer_lines)]
This addition specifies the page length for the basic list of the program to PAGE_LINES lines and fills the
system field SY-LINCT with this value. If LINE-COUNT is not specified, and if PAGE_LINES are less than or equal to 0
or greater than 60,000, then the page length is internally set to 60,000.
If wee optionally specify a number for FOOTER_LINES, a corresponding number of lines is reserved for the
page footer, which can be filled in the event of END-OF-PAGE.
We must specify PAGE_LINES and FOOTER_LINES as numeric literals.
MESSAGE-ID mid
This addition specified a message class MID that allows the use of short forms of the statement MESSAGE in
which only message type and message number are specified, in the program. The database table for Message class is
T100 and field for message ID in table is ARBGB.
DEFINING DATABASE ldb
This is used to define logical database name to be used in program.
REDUCED FUNCTIONALITY
This addition is only intended for the statement program in subroutine pools.

Predefined Data Types


These data types are predefined in the SAP Web AS ABAP kernel, and are visible in all ABAP programs. You
can use predefined types to define local data types and objects in a program and to specify the type of interface
parameters and field symbols.
Predefined Elementary ABAP Types
These predefined elementary data types are used to specify the types of individual fields whose lengths are
always fixed at runtime. The following table shows the different fixed-length data types. All field lengths are
specified in bytes.
Data Type

Initial Field Length

Valid Field Length

Initial Value

Meaning

Numeric Types
24 | P a g e

Integer (whole number)

Floating point number

1 - 16

Packed number

1 - 65535

''

Text Field

Character types
C

(alphanumeric characters)
D

'00000000'

Date field
(Format: YYYYMMDD)

1 - 65535

'0 0'

Numeric text field


(numeric characters)

'000000'

Time field
(format: HHMMSS)

Hexadecimal type
X

1 - 65535

X'0 0'

Hexadecimal field

Data types D, F, I, and T describe the technical attributes of a data object fully. Data types C, N, P, and X
are generic. When you use a generic type to define a local data type in a program or a data object, you must specify
the field length and, in the case of type P, the number of decimal places. When you user generic types to specify the
types of interface parameters of field symbols, you do not have to specify the technical attributes.

The initial value (and initial field length in the case of the generic types), are values that are used implicitly
in short forms of the TYPES and DATA statements.

The fixed-length predefined types are divided into:


Numeric Types
You can use type I data for counters, numbers of items, indexes, time periods, and so on.
You can use type P data for such values as distances, weights, amounts of money, and so on.
You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.
Using I and F fields for calculations is quicker than using P fields. Arithmetic operations using I and F fields
are very similar to the actual machine code operations, while P fields require more support from the software.
Nevertheless, you have to use type P data to meet accuracy or value range requirements.
Character types
Of the five non-numeric types, the four types C, D, N, and T are character types. Fields with these types
are known as character fields. Each position in one of these fields takes up enough space for the code of one
character. Currently, ABAP only works with single-byte codes such as ASCII and EBCDI.
As of Release 6.10, Web Application Server supports both Unicode and non-Unicode systems. Non-Unicode
systems are conventional SAP systems in which a character is generally represented by a byte. Unicode systems are
SAP systems that are based on a Unicode character display and are supported by an appropriate operating system
and database.
25 | P a g e

Hexadecimal Type
The remaining non-numeric type - X - always interprets individual bytes in memory. One byte is represented
by atwo-digit hexadecimal display. The fields with this type are called hexadecimal fields. In hexadecimal fields,
you can process single bits.

Predefined ABAP Types with Variable Length


These predefined elementary data types are used to specify the types of individual fields whose lengths are
not fixed until runtime. There are two predefined ABAP data types with variable length that are generically known
as strings:
STRING for character strings
A string is a sequence of characters with variable length. A string can contain any number of alphanumeric
characters. The length of a string is the number of characters multiplied by the length required for the internal
representation of a single character.
XSTRING for byte strings
A byte string is a hexadecimal type with variable length. It can contain any number of bytes. The length of a
byte string is the same as the number of bytes.
When you create a string as a data object, only a string header is created statically. This contains
administrative information. The actual data objects are created and modified dynamically at runtime by operational
statements.
The initial value of a string is the empty string with length 0. A structure that contains a string is handled like
a deep structure. This means that there are no conversion rules for structures that contain strings.

Internal Table
Internal tables provide a means of taking data from a fixed structure and storing it in working memory in
ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill
the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory
management in his or her programs.
You should use internal tables whenever you want to process a dataset with a fixed structure within a program.
A particularly important use for internal tables is for storing and formatting data from a database table within a
program. They are also a good way of including very complicated data structures in an ABAP program. The key of an
internal table can be unique or Non-Unique based on type of internal table we use.
There are 3 types of internal table
Standard Internal Table
Standard tables have a linear index. You can access them using either the index or the key. If you use the
key, the response time is in linear relationship to the number of table entries. The key of a standard table is always
non-unique, and you may not include any specification for the uniqueness in the table definition.
This table type is particularly appropriate if you want to address individual table entries using the index. This
is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You
should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The
response time for accessing a standard table is in linear relation to the number of table entries. If you need to use
key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you
can fill a standard table by appending records and then sort it. If you then use key access with the binary search
option (BINARY), the response time is in logarithmic relation to the number of table entries.

26 | P a g e

Sorted Internal Table


Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables,
you can access them using either the table index or the key. When you use the key, the response time is in logarithmic
relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be
either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard
tables and sorted tables both belong to the generic group index tables.
This table type is particularly suitable if you want the table to be sorted while you are still adding entries to
it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table
entries that do not fit are recognized before they are inserted. The response time for access using the key is in
logarithmic relation to the number of table entries, since the system automatically uses a binary search. Sorted
tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the
beginning of the table key.
Hashed Internal Table
Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The
response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key
of a hashed table must be unique, and you must specify UNIQUE in the table definition.
This table type is particularly suitable if you want mainly to use key access for table entries. You cannot
access hashed tables using the index. When you use key access, the response time remains constant, regardless of
the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are
therefore a useful way of constructing and using internal tables that are similar to database tables.

27 | P a g e

ABAP Data Dictionary


ABAP Dictionary also known as metadata repository, is one of the best tool of ABAP workbench and it is a
central repository for data definitions in SAP system. It is used to store the data definitions, create and maintain user
defined types. The transaction code for the ABAP Dictionary is SE11
ABAP dictionary is a central storage area for the description where we can create the objects and changing,
deleting the objects related to data base. The ABAP Dictionary permits a central description of all the data used in
the system without redundancies. New or modified information is automatically provided for all the system
components. This ensures data integrity, data consistency and data security.
The ABAP Data Dictionary supports the definition of user-defined types (i.e., data elements, structures and
table types). These types are used in ABAP processors and ABAP programs. They also define the structure of database
objects (i.3., tables,, views, and indexes). These database objects are created automatically in the underlying
database with their Data Dictionary definitions when the objects are activated. The ABAP data Dictionary also
provides editing tools like search help and locking tool like lock objects. Thus objects present in the ABAP Data
Dictionary are tables, views, types (data elements, structures, and table types), domain, search helps and lock
objects.

Objects in Data Dictionary


Objects created in the ABAP Data Dictionary are created in the underlying relational database using the data
definitions. The ABAP Data Dictionary thus describes the logical structure of the objects used in the application
development and shows how they are mapped to the underlying relational database in tables and views. The most
important object type in ABAP Data Dictionary are tables, views types, domains, search helps and lock objects.

Tables
Tables are defined in the ABAP Dictionary independently of the database. From this table definition
follows the creation of a table with the same structure in the underlying database.

Views
Views are logical views of more than one table. The structure of the view is defined in the ABAP
Dictionary. A view of the database can then be created from this structure.

Types
The structure of a type can be defined globally in ABAP programs. Changes to a type automatically
take effect in all the programs using the type. Types are divided into built-in and user defined types

Lock objects

28 | P a g e

These objects are used to synchronize access to the same data by more than one user. Function
modules that can be used in application programs are generated from the definition of a lock object in the
ABAP Dictionary.

Domains
Different fields having the same technical type can be combined in domains. A domain defines the
value range of all table fields and structure components that refer to this domain.

Search Help
Search helps are objects that you can use to assign input help (F4 Help) to screen fields. You can do
this by creating a search help in the ABAP Dictionary and attaching it to the corresponding screen field.

Type Group
It allows us to define non-predefined types. Combination of all such non-predefined types is knows
as type-pool or type-group

29 | P a g e

Data Types
Data types are the most elementary object in the ABAP Data Dictionary. Whenever fields, variables, constants,
etc., are defined, they have some predefined characteristics like numbers, characters, strings, integers, dates and
times. These groups of characteristics are known as data types. The data types of the ABAP Data Dictionary are
different from data types in the ABAP language.
In memory, programs are represented as bytes of strings of data. These bytes of strings are known as fields
and consist of name and type. Types can be character based or numeric. Every field has its own name and data types.
These types can be defined globally in the ABAP Data Dictionary or locally in an ABAP program. The data types of
database tables are subset of all possible types, namely flat structures. ABAP data types can be further divided into
two categories

Built-in elementary data types


User-defined data types

Built-In Elementary Data Types


Some data types are already defined in the ABAP Data Dictionary. These data types are converted into their
corresponding ABAP data types during runtime. Let us see all the Built-In Elementary Data types in detail:
ACCP: Posting Period
This data type has the length set to six places, and the format is YYYYMM. Because a point (.) is inserted
between the year and month in input and output modes, the template of this data type has the form ____.__.
CHAR: Character String
This data type can have a maximum length of 255 characters in tables. If longer character fields need to be
used in tables, data type LCHR should be used
CLNT: Client
Client fields always have three number spaces. This convention is used to make objects client dependent. If
the field is not used in the object, then that object is considered client independent and can be used in all the clients
CUKY: Currency Key

30 | P a g e

The currency key data type is used to refer to the fields of type CURR. The lent of this data type is set to five
places.
CURR: Currency Field
This data type represents the amount field with decimal places, sign and commas separated into thousands.
A field of this type must refer to a field of type CUKY. The maximum length of this data type is 31 characters.
DATA: Date Field
The length of this data type is eight places, and the output length can be defined within the user profile. The
date is represented in YYYYMMDD format internally in the database.
DEC: Decimal Field
This data type represents the amount field with decimal places, sign and commas separating thousands. It
has a maximum length of 31 places.
FLTP: Floating Point Number
This data type is used to represent floating point numbers. It can have a maximum length of 16 characters,
including decimal places.
INT1: One-Byte Integer
This is a one-bye integer that can have values from 0 to 255. The length is set to three places for this data
type.
INT2: Two-Byte Integer
This is a two-byte integer that can have a value from -32767 to 32767. This data type should only be used for
length fields. This data type can have its length set to five places.
INT4: Four-Four-Byte Integer
This is a four-byte integer that can have a value from -2147483647 to 2147483647.This data type can have its
length set to 10 places
LANG: Language Key
This data type has its own field format for special functions. Its length is always set to one place. The field
of this data type when stored in the database has one place, but has two places when displayed in the user interface.
The conversion exit ISOLA converts the display at the user interface for the database and vice versa. This conversion
exit is automatically allocated to a domain with data type LANG at activation.
LCHR: Long Character String
This data type represents the character string but with a minimum of 256 characters. This field should be
preceded by a length field of type INT2. Field of this type must be located at the end of the table. The length field
must be filled with the actual required length while inserting or updating the record. You cannot use this field in the
where condition of a select statement.
LRAW: Long Uninterpreted Byte String
This data type represents the Uninterpreted byte string but with a minimum of 256 characters. The field
should be preceded by a length field of type INT2. Fields of this type must be located at the end of table. The length
field must be filled with the actual required length while inserting or updating the record. You cannot use this field
in the where condition of a select statement.
31 | P a g e

NUMC: Numeric Text


This data type represents the long character field in which only numbers can be entered. The length of this
field is set to a maximum of 255 places.
PREC: Accuracy Field
This field acts as an accuracy field of a QUAN field. The length is set to two places for this data type.
QUAN: Quantity Field
This data type represents the amount field with decimal places, sign and commas separating thousands. A
field of this type must refer to a unit field (UNIT). The maximum length for this data type is 31 places.
RAW: Uninterpreted Byte String
Fields of type RAW can have a maximum length of 255 in tables. If longer raw fields are required in tables,
data type LRAW must be selected.
RAWSTRING: Uninterpreted Byte string variable
This data type can be used only in types (data elements, structures, table types) and domains. You cannot
use it in database tables. In ABAP, this type is used as a reference to a storage area of variable size.
STRING: Character String with Variable Length
This data type has the same characteristics as RAWSTRING, discussed immediately before this.
TIMS: Time Field
This field is used to represent time. The length for this data type is set to six places, and the format is
HHMMSS. The template has the form __.__.__ for input and output.
UNIT: Unit Field
This data type refers to the fields of type QUAN. The length of this data type is set to two or three places.
This data type is needed to specify the units or measurement involved.
VARC: Character Field with Variable Length
From release 3.0 onwards, creation of new fields of this data type is not possible. However, existing fields
with this data type can still be used. A field of this type cannot be used in the where condition of a select statement.

Note:
We can assign a sign with the numeric data types CURR, DEC, FLTP, INT2, INT4 and QUAN. This sign is displayed on
screen when assigned. The system automatically sets the comma separating thousands, along with decimal points,
for data types CURR, DEC, QUAN. It also sets decimal points for data types DATA, ACCP and TIMS.
User-Defined Data Types
User-defined data types can be defined and stored for all the programs in the ABAP Data Dictionary. These
user-defined data types can be defined either globally in the ABAP Data Dictionary or locally in ABAP programs with
the TYPES command. The types defined globally in the Data Dictionary can be accessed by ABAP programs to define
data objects.
User-defined data types can be further classified into three categories:
32 | P a g e

Elementary data types


Reference data types
Complex data types

Elementary Data Types


Elementary types are part of the dual-level domain concept for fields in the ABAP Data Dictionary. The
elementary type has semantic attributes such as data type, length, texts, value tables or documentation. Elementary
types are described with the help of data elements. Data type in a data element can be specified in two ways.

Directly assigning to a built-in ABAP Data Dictionary type

You can directly assign a built-in or predefined ABAP Data Dictionary type and a number of characters to
an elementary type.

Assigning to a domain

The technical attributes are inherited from the domain. The domain specifies the technical specification of the
data element.
Reference data types
Reference types describe the data objects that contain references to other objects. However, if there are no
predefined references, references should be defined explicitly. The hierarchy of the reference types describes the
hierarchy of objects to which these references can point.
Complex Data Types
Complex types are made up of other types. We can access complex data types either as a whole or by the
individual component. Complex data types group semantically related data under a single name and manage and
process them. There are no predefined complex data types defined in ABAP. They can either be defined in an ABAP
program or in the ABAP Data Dictionary.
The following type categories can be defined in the ABAP Data Dictionary from Transaction SE11

Data Elements:
o Data elements describe either an elementary type or reference type Data elements are used to define
the type of the table field, structure component or the row type of a table type. All the semantic
information about the meaning of the table field or structure component and information about
edition the corresponding screen field can be assigned to a data element.
Structures
o Structures define the complex types, structure types describe the structure and functions of any
structured data objects; that is, data structures with components of any type. Thus, a component
can be a field of elementary type, reference type or structure type.
Table Types
o Table types define complex types. Table types describe the structure and functions of the internal
tables used in the ABAP program. When a table type is created, then line type, access type and key
need to be specified.

33 | P a g e

Domain
A domain is the central objects which defines the technical attributes of the field. The term technical
attribute refers, among other things, to data type, length, decimal places, conversion routine and value table. The
domain is assigned to the data element, which in turn is assigned to the table fields or structure fields. S all the fields
that use the data element have the technical settings defined by the domain. One particular domain can be assigned
to N number of data elements and one particular data element can be assigned to N number of fields or components.
The value range of the domain is defined by specifying the data type and length. The number of decimal
places can also be defined for numeric data types. Domains can also have fixed values or fixed intervals of values.
Output length and conversion routines can also be defined for the domain. A Conversion routine converts values from
display format to internal format for the fields or components that refer to the domain.
Fields are assigned to data element, which in turn is assigned to the domain. This method of field definition
is also known as the two-level domain concept.
Attributes of Domain
Before seeing how to create domain, let us see the different attributes of domain. From Transaction SE11,
we can create, change or display domain and from Transaction SE12 we can display existing domain.

In SE11 when you enter Domain name and click on create, change or display, the maintenance screen of domain
appears. Within the maintenance screen, you can find screen elements such as DOMAIN NAME, SHORT DESCRIPTION;
various tabs such as PROPERTIES, DEFINITION AND VALUE RANGE. Let us the attribute tables in detail
Short Description
The first step in creating the domain is to create the short text description. This short text acts as the
explanatory text when F1 help is generated.

34 | P a g e

Properties Tab
The PROPERTIES tab defines the general properties of the domain. Attributes present within this tab are LAST
CHANGES ON/BY, PACKAGE AND ORIGINAL LANGUAGE. These attributes get their values from the system and we
cannot change them. Let us see this attributes in more detail

Last Changed On/By

This attribute displays the SAP user IDs of those who have changes the domain and the date when the
domain was last changed

Package

This attribute displays the name of the package inside which the domain is saved. A package is essentially
the same as a folder.

Original Language

This value displays the language in which the domain is created. The language specific part, such as its
short description is maintained in its original language.
Definition Tab
The DEFINITION tab defines the technical format of domains such as data type, number of characters and
decimal places. It also defines output characteristics of the domain, such as output length, conversion routines, sign
and lower case. Let us discuss these in more detail

35 | P a g e

Data Type

Data type is the user view on the data. We can enter any of the existing data types for the data dictionary,
such as ACCP, CHAR, CLNT, NUMC, etc.,.

No. of Characters
The number of characters defines the length that a data type can be.

Decimal Places

We can specify the number of decimal places for data type currency (CURR), decimal point (DEC), floating
point (FLTP) and Quantity (QUAN)

Output Length

This specifies the maximum field length. It also includes editing characters such as commas and decimals
for inputting and outputting values. The value is generally computed automatically from the specification of the
data type, number of characters and decimal places. But the user can also adjust the output length.

Conversion routine

Depending on the data type of the field, conversion takes place internally where the contents of a screen
field are converted from display format to SAP internal format and vice versa. This conversion can be overwritten
in the underlying domain with the help of a conversion routine. Conversion routines are identified by five-place
names and are stored as a group of two function modules. These function modules have the following fixed
naming conventions.
o
o

CONVERSION_EXIT_XXXXX_INPUT
CONVERSION_EXIT_XXXXX_OUTPUT

The INPUT function module converts the value of the field from display format to SAP internal format
and the OUTPUT module converts the value of the field from SAP-internal format to display format.

Sign

This attribute is required if the data type contains a negative value. If this flag is set, the first position
of the output is reserved for sign. If the flag is not set but the domain contains negative values, then problems
might occur during screen output.

Lower Case

This indicator enables us to distinguish uppercase and lowercase characters when values are entered with screen
masks. Otherwise all the entries are converted to uppercase when you enter values with screen masks.
Value Range Tab
In this tab, we can define single fixed values or an interval of values for the domain. We can also define a value table
for the domain

Single Values and Intervals

We can define fixed values in this attribute. Values entered in the fixed values or intervals attributes are the only
possible values that table fields or components referring to this domain can have. Fixed values can be used during
the input check in screen templates. If no other means of help is defined for a field, the fixed values are offered in
the input (F4) help.

36 | P a g e

Value Table

If all the table fields referring to the domain are checked against the value of a certain table, that table
is known as the value table. The system proposes the value table as the check table when a foreign key for the
field is defined. Entering the value table does not implement the check.
Documentation
We can use documentation to define the use of the domain more precisely. Technical documentation about
the domain can be created with GOTO DOCUMENTATION
Creating Domain
Before creating a new domain, check whether any existing domain have the same technical specifications
required in your table field. If so use that existing domain. Let us see how to create a domain

37 | P a g e

1. Go to Transaction SE11. Select the radio button for DOMAIN in the initial screen of the ABAP Dictionary and
enter the name of the domain. Choose the create button. The name of a domain should not be more than 30
character long.
2. Enter the explanatory short text in the SHORT TEXT field of the maintenance screen of the domain. We
cannot enter any other attribute until we enter this attribute.
3.

Enter the data type, number of characters and decimal places in the FORMAT block of the DEFINITION TAB.
Press the ENTER key on OUTPUT LENGTH, and it proposes and displays output length. Fill in the
CONVERSION ROUTINE, SIGN and LOWER CASE fields, if required. Normally, these are optional attributes.

4. Go the VALUE RANGE tab. Enter the fixed values or intervals if the domain is restricted to having only fixed
values. Define the value table if you want the system to propose the table values during F4 Help. These are
optional attributes

38 | P a g e

5. Save your changes. The CREATE OBJECT DIRECTORY ENTRY popup appears asking for package. Enter the
package name in which you are working or you can save your domain, using the LOCAL OBJECT button, in
package $tmp.

6. Activate the domain. Click on Activate button


be created in system.

or press CTRL + F3. If there is no error then Domain will

39 | P a g e

Data Element
Data elements are very important in the ABAP Data Dictionary because they define the semantic attributes
of a table field such as domain name, documentation, field label, search help, parameter ID, etc. Data elements
describe the individual fields in the ABAP Data Dictionary. They are the smallest indivisible units of the complex
types. They are used to define the type of the table field, structure component, or the row type of a table type.
Information about the meaning of a table field or structure component and information about editing the
corresponding screen field can be assigned to a data element. Data elements describe either elementary types or
reference types.
Attributes of Data Elements
From transaction SE11, we can create, change or display the data element. From Transaction SE12, we can
display the existing data element. Once we click on any or the buttons (CREATE, CHANGE or DISPLAY) the maintenance
screen of the data element appears. Within the maintenance screen you find screen elements like DATA ELEMENT
NAM or SHORT DESCRIPTION and various tabs such as the ATTRIBUTES tab, DATA TYPE tab, FURTHER CHARACTERISTICS
tab and FIELD LABEL tab, along with attributes within these tabs.
Short Description
When we create data element, the first thing is to maintain the short text. This short text acts as the
explanatory text when F1 help is generated.

Attributes Tab
The ATTRIBUTES tab defines the general property of the data element. The attributes presented within this
tab are LAST CHANGED ON/BY, PACKAGE and ORIGINAL LANGUAGE. These values are automatically updated and we
cannot change these values. Let us see them in detail.

Last Changed On/By

This attribute displays the SAP user IDs of those who have changes the data element and the date when
the data element was last changed

Package

40 | P a g e

This attribute displays the name of the package inside which the data element is saved. A package is
essentially the same as a folder.

Original Language

This value displays the language in which the data element is created. The language specific part, such
as its short description is maintained in its original language.
Data Type Tab
In this tab, we define whether a data element is an elementary data type of a reference data type. We can
assign the data element either with the existing domain or with the predefined data types or by taking reference of
existing domain. Let us see these in detail

Elementary Type

The elementary type has semantic attributes, such as value table, texts and documentation, and has a
data type. This type is the part of the dual-level domain concept that applies to fields in the ABAP Data Dictionary.
There are two situations where you should specify a data type:
o

When assigned with domains

If we assign a data type with the domain, all the technical characteristics of the domain are
automatically copied to the data element.
o

When assigned to predefined type

If we assign the data element as predefined type, then we have to explicitly enter the values for
DATA, TYPE, LENGTH and DECIMAL PLACES attributes

Reference Type

References are used to refer to objects and are stored in reference variables. Reference variables are
treated like elementary data objects, and can occur as a component of a structure or internal table, or as an
independent field. Reference types can be of the following kinds
o
o
o
o

Reference to the class or an interface


Reference to a type defined in ABAP Dictionary
Generic reference to DATA, OBJECT and ANY
Reference to a built-in ABAP Data Dictionary type with length and decimal places specified
41 | P a g e

Field Label Tab


In the FIELD LABEL tab, we can describe the field label text. This text is displayed when this data element is
referred in the screen output.

SHORT
A maximum length of 10 characters can be assigned to a data element as a field name

MEDIUM
A maximum length of 20 characters can be assigned to a data element as a field name.

LONG
A maximum length of 40 characters can be assigned to a data element, but a maximum length of 20
characters is recommended

HEADING
A maximum length of 55 characters can be assigned for the heading. The title is only displayed for
editing list output for the corresponding column.

Further Characteristics
In this tab, we can define the search help, parameter ID, default component name, etc. Let us see all of them in
detail.

42 | P a g e

Search Help

Search help is assigned to data element. This search help is available to all the table fields that refer to
the data element. We must specify the name of the search help in the NAME field and an export parameter in
the PARAMETERS field. It is not possible to return several values when the search help is attached to a data
element.

Parameter ID

We can fill the field with the proposed values from SAP memory using PARAMETER ID. Parameter ID are
used only to memorize certain user-specific settings. They can be included in the user record transaction SU03
in the PARAMETER tab. We can get the list of all the parameters and their description in table TPARA. Fields on
screen are automatically filled with the parameter ID of the data element if the SET PARAMETER/GET PARAMETER
attributes for the corresponding fields have been explicitly set in the screen painter for that field.

Default component Name

In this attribute, a proposal for the name of the table field or structure components can be stored. Always
use this default name for components in BAPI structures. Because of this, field and component name assignments
are interconnected.

Change Document

This flag is used to create the change document for business object. This change document contains the table in
which the data of the business objects is stored. Changes are logged in the change document, when the fields refer
to a data element and the CHANGE DOCUMENT flag is set for that data element. We cannot set change management
checkbox for date or time fields. The transaction to view change document is SCDO

Basic Direction is set to LTR

If this checkbox is checked, the field contents are always displayed in the basic writing direction LTR (Left to Right),
even if the writing direct of the window or writing language is RTL (Right to left).

No BIDI Filtering

If this checkbox is checked, no filtering of bidirectional formatting characters takes place when values
are entered via screen templates. This parameter can be set using the report I18N_SET_DATAELEMENTS_FLAGS.
This characters can be entered when they are present in the system code page and the fronted code page.
Documentation
Documentation is displayed when F1 help is selected for the fields that refer to the data element. If there is
not documentation available, only the short text appears for the F1 help. DOCUMENTATION STATUS defines whether
documentation is required and SUPPLEMENTARY DOCUMENTATION can enhance the documentation.

Documentation Status

43 | P a g e

The document status specifies whether documentation is required for the data element and whether the
documentation has already been done. To display documentation status follow the path GOTO>DOCUMENTATION->STATUS.

Supplementary Documentation

Using supplementary documentation, we can enhance documentation with screen specific information.
These supplements must be assigned to the screen. The text of the data element supplement appears on the
screen in addition to the documentation of the data element. The link to the data element is maintained in table
THLPF.
Creating Data Element
Let us see the steps involved in creating data element. Before creating a new data element, check
whether any existing data elements have the same semantic specification required. Let us see the procedure for
creating data element.
1. Go to Transaction SE11. Select the radio button for DATA TYPE and enter the name of the data element.
Choose the button create. The name of Data Element should start with Y or Z

2. In Create TYPE pop-up, check the DATA ELEMENT radio button and click on green checkmark icon

3. Enter the short description in the SHORT TEXT field of the maintenance screen of the data element.

44 | P a g e

4. Assign the data element with the type. We can create an elementary data element by checking ELEMENTARY
TYPE or a reference data element by checking REFERENCE TYPE. We can assign Domain to Data Element
within ELEMENTARY TYPE.

5. Enter field label for data element in FILED LABLE type.

6. Go to the FURTHER CHARACTERISTICS tab and define SEARCH HELP, PARAMETER ID, DEFAULT COMPONENT
NAME, CHANGE DOCUMENT and BASIC DIRECTION IS TO LTR as required. These are optional parameters.

7. Save the changes. The CREAT OBJECT DIRECTORY ENTRY pop-up appears and asks for the package. Enter the
name of the package in which you are working or we can save data element in the Local object in the $tmp
package
45 | P a g e

8. Activate the data element. To do this, click on the ACTIVATE button or press CTRL+F3.

46 | P a g e

Tables

47 | P a g e

Important Transaction Codes

Transaction Code Description


ABAPDOCU

Example Library

ABAPHELP

Keyword Documentation

SE11

ABAP/4 Dictionary Maintenance

SE12

Dictionary: Initial Screen enter object name

SE13

ABAP/4 Dictionary - Technical Settings

SE14

ABAP/4 Dictionary: Database Utility.

SE15

Repository Info System

SE16

Display table content

SE16N

Data Browser new version

SE17

General table display

SE30

ABAP runtime analysis(Performance tuning)

SE32

ABAP/4 Text Element Maintenance

SE35

ABAP/4 Dialog Modules Maintenance

SE36

ABAP/4: Logical Databases

SE37

ABAP Function Modules

SE38

ABAP Editor

SE39

Program Comparison

SE41

Menu Painter

SE43

Area Menu editor

SE51

Screen Painter

SE71

Form Painter

SE72

SAPscript Styles

SE73

SAPscript Font Maintenance

SE74

SAPscript format conversion

SE75

SAPscript Settings

SE76

SAPscript: Form Translation

SE77

SAPscript Styles Translation

SE80

Object Navigator

SE91

Maintain Message Classes and Messages

SE93

Maintain Transaction Codes

SLIN

Extended Check

SM01

Lock Transactions

SM04

Overview of users

SM12

To unlock the locked entries

SM21

System Log

SM30

Maintain tables(not all tables can use SM30)

SM31

Maintain tables

SM32

Table maintenance

SM35

Batch Input Monitoring

SM36

Define background jobs


48 | P a g e

SM37

Overview of background jobs

SM39

Job analysis

SM50

Work process overview

Smartforms

Smartforms

SMOD

List SAP enhancements to use in CMOD

SNRO

Number range object maintenance.

SP00

Spool

SP01

Spool control

SP02

Display output requests

ST01

SAP system trace

ST05

SQL tracer (for performance tunning)

ST06

Operating system monitor

ST07

Application Monitor

ST09

Table call statistics

ST11

Display developer trace

ST12

Application monitor

ST22

Dump Analysis

STAT

Local Transaction statistics

STUN

Performance monitoring

we30

Idoc Type creation

we31

Segment creation

we81

Creation and assigning of Message type

WEDI

IDOC and EDI basis

49 | P a g e

Important Shortcut keys


System Shortcut
Short cut

Description

/nxxxx

Terminates current
transaction xxxx

/n

This terminates the transaction. This


corresponds to pressing F15 to go back.

/nend

This terminates all separate sessions and logs off


(corresponds to System Logoff

/nex

This terminates all separate sessions and logs off


immediately (without any warning!)

/ns000

This will end the current transaction and return to


starting menu

/oxxxx

This opens a new session and starts transaction xxxx in


This session.

/o

This lists existing sessions and allows deletion or opening


of a new session.

/i

This terminates the current session (corresponds to


System End

/i1, /i2,

This terminates the session with the number given.

.xyzw

xyzw refers to the underlined letters in the menus.


This type of navigation is uncommon and is provided
more for emergencies (such as a defective mouse)

transaction

and

starts

the

generally

50 | P a g e

Interview Questions

51 | P a g e

S-ar putea să vă placă și