0% found this document useful (0 votes)
172 views49 pages

ABAP Presentation

SAP stands for Systems Applications and Products in Data Processing and is also the name of the ERP software and company. SAP software was founded in 1972 and consists of fully integrated modules covering all aspects of business management. An ERP system like SAP is required for a centralized enterprise management system to eliminate data issues between departments and provide real-time information sharing. Key benefits include increased productivity, better inventory management, and improved customer service.

Uploaded by

Indu Apple
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views49 pages

ABAP Presentation

SAP stands for Systems Applications and Products in Data Processing and is also the name of the ERP software and company. SAP software was founded in 1972 and consists of fully integrated modules covering all aspects of business management. An ERP system like SAP is required for a centralized enterprise management system to eliminate data issues between departments and provide real-time information sharing. Key benefits include increased productivity, better inventory management, and improved customer service.

Uploaded by

Indu Apple
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 49

What is SAP?

SAP stands for Systems Applications and Products in Data Processing.


SAP by definition is also named of the ERP (Enterprise Resource Planning) software as well the name of the
company.

SAP Software was Founded in 1972 by Wellenreuther, Hopp, Hector, Plattner and Tschira.
SAP system consists of a number of fully integrated modules, which covers virtually every aspect of the business
management.

What is SAP ERP? Why it is Required?


Suppose a client approaches sales team asking for a particular product. The sales team contacts to inventory
department to
check the availability of the product. To their surprise, sales team found out that the product is out of stock. So next
time this
don’t happen, they have to introduce a SAP ERP tool.
Before we actually see in detail, what ERP is and how ERP can help in your business process, we will understand how
different departments are involved in the whole business process, right from the ordering of the raw material –
to manufacturing goods – to delivering final goods to the customer.
BUSINESS PROCESS.
1. Client contacts the sales team to check the availability of the product

2. Sales team approaches the Inventory department to check for the availability of the product

3. In case the product is out of stock, the sales team approaches the Production Planning Department to manufacture
the product

4. The production planning team checks with inventory department for availability of raw material

5. If raw material is not available with inventory, the Production Planning team buys the raw material from the Vendors

6. Then Production Planning forwards the raw materials to the Shop Floor Execution for actual production

7. Once ready, the Shop Floor Team forwards the goods to the Sales Team

8. Sales Team who in turn deliver it to the client

9. The sales team updates the finance with revenue generated by the sale of the product. Production planning team
update the finance with payments to be made to different vendors for raw materials.

10. All departments approach the HR for any Human Resource related issue.
Key benefits of the centralized system are:

•It Eliminates the duplication, discontinuity and redundancy in data

•Provides information across departments in real time.

•SAP System is Provides control over various business processes

•Increases productivity, better inventory management , promotes quality , reduced material cost,
effective human resources management, reduced overheads boosts profits

•Better customer interaction and increased throughput. It also improves customer service

•Hence, a centralized enterprise management system is required.

•SAP Software is a centralized enterprise management system also known as Enterprise Resource
Planning.
Sap R/3 Architecture Tutorial
• Presentation
• Application
• Database
Components of SAP R/3 Architecture

• Message Server: It handles communication between distributed Dispatchers in


ABAP system.

• Dispatcher Queue: Various work process types are stored in this queue.

• Dispatcher: It distributes requests to the work processes.

• Gateway: It enables communication between SAP system and between SAP system
and external systems.
• ABAP-Work processes: - It separately executes
dialog steps in R/3 applications.
Types of work processes are given as below:-
• Memory-pipes: It enables communication between ICM and ABAP work processes.

• Message Server: It handles java dispatchers and server processes.It enables communication within java
runtime environment.

• Enqueue Server:It handles logical locks that are set by the executed Java application program in a
server process.

• Central Services: Java cluster requires a special instance of the central services for managing locks and
transmitting messages and data. Java cluster is a set of processes that work together to build the reliable
system. Instance is group of resources such as memory, work processes and so on.

• Java Dispatcher: It receives the client requests and forwards to the server process.

• SDM: Software Deployment Manager is used to install J2EE components.

• Java Server Processes: It can processes a large number of requests simultaneously.

• Threading: Multiple Processes executes separately in the background, this concept is called threading.

• ICM: It enables communication between SAP system and HTTP, HTTPS, SMTP protocol. It means by
entering system URL in the browser you can access SAP from browser also.
How the SAP Logon Process works?
1) Once a user clicks on the SAP system from GUI, the user request is forwarded to Dispatcher.

2) Request is stored in Request queues first. Dispatcher follows First in First out rule. It will find free
work process and if available will be assigned.

3) As per user request, particular work process is assigned to user. For example, when user login to the
system then Dialog work process is assigned to the user. If user runs a report in background then
background work process is assigned to the user. When some modifications are done at database level
then update work process is assigned. So as per user's action work process is assigned.

4) Once user is assigned the dialog work process then user authorizations, user's current setting are
rolled in to work-process in shared memory to access user's data. Once dialog step is executed then
user's data is rolled out from work process. Thus shared memory will be cleaned and other user's data
can be saved in shared memory area. Dialog step means the screen movements. In a transaction,
when a users jumps from one screen to other the process is called a dialog step.
5) First work process will find the data in the buffer. If it finds data in buffer then there is no need
to retrieve data from database. Thus response time is improved and this process is called hit.If it
does not find the data in buffer then it will find the data in database and this process is called
miss. Hit ratio should be always higher than miss ratio. It improves the performance of system .

6) Other requested data is queried from the database and once the process is complete,the result
is sent back to GUI via dispatcher.

7) At the end user's data is removed from shared memory so the memory will be available to
other users.This process is called roll-out.
ABAP T CODES:

• SE11 – Data dictionary maintenance

• SE37 – ABAP Function Modules

• SE38 – ABAP Editor

• SE71 – Form Painter

• SE72 – Scripts Styles

• SE51 – Screen Painter

• SE80 – Object Navigator

• SE93 – Maintain Transaction

• SE01 – Transport Organizer(Extended View)

• Smartforms – Smartform

• WE30 – IDOC Type Creation

• WE31 – Segment Creation

• WE81 – Message Type Creation


ABAP DICTIONARY
Data Dictionary is a central source of information for the data
in a information management system. Its main function is to
support the creation and management of data definitions (or
"metadata").
Objects in the ABAP Dictionary resided on three levels that
support their re-usability. These levels are:
Tables and structures
Data elements
Domains
DOMAINS
• Describes the technical characteristics of a
table field
• Specifies a value range which describes
allowed data values for the fields
• Fields referring to the same domain (via the
data elements assigned to them) are changed
when a change is made to the domain
• Ensures consistency
DATA ELEMENTS

• Describes the role played by a


field in a technical context

• Fields of same semantic


meaning can refer to the same
data element

• Contains the field information


Tables

• Represent the Database


Tables where data actually
resides.

• Tables can be defined


independently of the
database in the ABAP
Dictionary.

• The fields of the table are


defined with their (database-
independent) SAP ABAP data
types and lengths.
STRUCTURES.

•Are record declarations that do


NOT correspond to a Database
Table.

•Just like user-defined data type.

•Defined like a table and can


then be addressed from ABAP
programs.

•Structures contain data only


during the runtime of a
program.
The most important object types in the ABAP Dictionary are
• Tables
• Views,
• Types (data elements, structures, and table types),
• Domains
• Search helps
• Lock objects.
Tables are defined ill the ABAP Dictionary independently of the database. A table having the same structure is then
created from this table definition in the underlying database.

A Table is Simply Group of fields and which can store multiple records.

A table definition in the ABAP Dictionary contains the following components:


• Table fields define the field names and data types of the fields contained in the table
• Foreign keys define the relationships between the tables.
• Technical settings control how the table should be created in the database.
TYPES OF DATABASE TABLES

• TRANSPARENT: It is used to store application data such as Master and Transactional Data.
• We always create Transparent tables only.
• There is a One to One relatioinship i.e. for the table in DDIC another table with the same structure and the same
name and the same fields will be created in the original Data base.

• POOLED: It should be used exclusively for storing internal control information (screen sequences, program parameters,
temporary data, continuous texts such as documentation).
• The data from several different pooled tables call be stored together in a table pool.
• This is Many to One relationship i.e. for many pooled tables in DDIC only one Data base table will be created in
the Database.

• CLUSTER: It should be used exclusively for storing internal control information (screen sequences, program parameters,
temporary data, continuous texts such as documentation).
• The data from several different cluster tables call be stored together in a table clusters.
• This is Many to One relationship i.e. for many cluster tables in
DDIC only one Data base table will be created in the Data Base.

All the Tables in the Cluster Tables should have a common Primary Key.
TABLE CREATION

We Call Provide the technical attributes such as Data type, Length and Description of the Fields in 2-ways (Refer
the below
diagram).

• One Way is providing the technical attributes Directly i.e Provide the Data type, Length and Description
Individually.
• 2nd Way is providing the technical attributes through Data Elements and Domains i.e Provide the Data type
length and Description by grouping into Data Elements and domains.

Table Table T
B
Fields O
Fields P
O
T
T
B
O
Data O
Data M
Description T
Element T
Length T
O
O
M
P
Domain
In Table creation we have the following

• Table type – Transparent, cluster, pooled


• Attributes – package user etc.
• Delivery and maintenance – Delivery class , Data Maintanc
• Fields – Field name, key, Initial values, data element , data type, length, decimal plac, description
• Entry help/check -
• Currency/Quantity Fields
• Data Class
• Size Category
• Buffering
• Buffering type

• Domain:- It is used to define the Technical Attributes (Data type and Length) and the Value ranges (Fixed
values and Intervals). A domain is assigned to a data element . All the table fields or structure components
that use this data element then have the value range defined by the domain.

• Data Element:-- A Data Element describes either an elementary type or a reference type . An elementary
type is defined by the built-in data type, length and possibly the number of decimal places. These type
attributes can either be defined directly in the Data Element or copied from a domain.
• Delivery Class:- It Defines the type of the data that is going to be stored and also it defines the owner of the Table
and also the delivery class controls the transport of tables data for installation, upgrade, client copy and when
transporting between customers systems.

• Data Class: - It is the physical area or table space that the table has to be stored in the Database.

• Size Category- The size category defines the expected space required for the table in the database. You call choose
a size category from 0 to 4 for your table. Each category is assigned a certain fixed memory size in the database,
which depends on the database system used.

• Table Maintenance Allowed: If you click on this click box, you call enter the entries into the table.
DATA TYPES
BOTTOM- UP Approach

Steps to Create Domain:


• Execute SE11 and select the 'Domain' option.
• Provide the name ‘ZXX' and click on 'Create'.
• Here enter the 'Short text’ and enter the 'Data type ,
Number of characters' and Press 'ENTER'.
• Save, Check and Active.
• Make Sure that the Domain is Activated

Steps to Creating Data Element.


• Execute 'SE11'. Select the radio Button 'Data Type' and
Enter the name of the Data Type(Data Element).
• Select the Radio button Data Element and press ENTER.
• Enter the 'Short Text and the Domain which is already created ZXXX.
• Press ENTER After Domain is entered . So that it Copies the technical attributes from Domain to Data element..
• Save, Check and Active the Data Element..

Maintain Field Label. This Label will be displayed when we refer the same While Designing the Screen
in Module Pool Programming.
CHAR : Character string. Fields of type CHAR may only have a maximum length of 255 in tables. If longer character
strings are used in tables, use data type LCHR. There are no restrictions for the length of such fields in structures.

STRING : Character sequence of variable length. In the Dictionary, you can specify a length (minimum 256 characters)
for this type. Usage in database tables is also possible. However, there are limitations and these are described in the
explanations given for the ABAP keyword STRING. String fields cannot be used in the key for tables, in indices, or in the
WHERE condition of a SELECT statement. In ABAP, the Dictionary type STRING is mapped onto the ABAP type STRING,
which is used as a reference to a memory area of variable size.

INT : 1-byte integer, value range from 0 to 255. The length is defined as 3 places for this data type.

NUM : Character string that may only contain digits. The length of a field of this type is limited to a maximum of 255
places.
Header

Global Declarations

Processing Logic

Subroutines
STEPS TO CREATE TABLE

• Execute Transaction SE11.

• Click on the radio-button ‘Database 'Table' , enter the database name as 'ZXXX' to be created and click on 'CREATE‘
button. Enter the mandatory fields like 'Short Description', Delivery class as 'A', and Check Table Maintenance Check
Box. Then click on the Fields tab.

• Provide the Field name and the Data Element for LIFNR i.e ZGLIFNR which is already created. Press Enter after
entering the Data Element so that we get all the information attached to it (Data Type, Length, Description).

• Now Click on the “Technical Settings' on title tool bar. Enter the Data Class and Size Category. Save It.

• Press F3 to come back to the main screen. Save, Check, Activate the table.

• Path to maintain the Data on the Table Utilities -> Table contents -> Create Entries

• Enter the Vendors details. After entering save (Ctrl + S) or Press Save Button to update the table contents.

• Path to view the contents of the table. Utilities -> Table Contents ->Display.

• Press F8 for all the records or provide the Required Vendor Account No's and then Execute(F8).
STEPS TO CREATE STRUCTURES.

• Execute SE11 . Click on the ‘Data Type’ option on the screen. Enter the Name and click on 'Create'.

• Select the option 'Structure' in the next screen. Press Enter.

• Enter the Short text, Component(Field Name) and Component Type(Data Element).

• Save, Check, Activate After Providing all the Components and Component types .

STEPS TO INCLUDE STRUCTURES

• Include Structure is used to include the structure to a custom Table.

• Open the Database Table in Change Mode, i.e. Execute SE11 and Provide the Name of the Table and Click on Change

• Select the Row i.e. where you want to JNCLUDE the Structure and then click on '+' or 'New Rows' button

• Provide .INCLUDE as Field name and Structure name as Field type. Save, Check and Activate.

• Click on the expand All Include Button to see the fields included in the Structure.
APPEND STRUCTURE :- Here as we use ‘INCLIDE' structure for custom table or user defined table, we use 'APPEND'
Structure for adding the required fields for the standard database tables.

Procedure lo APPEND STRUCTURE:-

• Open SE11 and 'Display' the table to which the structure is to be appended. Click on 'Display'.
• Click on the APPEND STRUCTURE button on the application toolbar.
• Then click on the ‘New Append Structure’ for appending the structure to the standard database table.
• Enter the structure name starting with ‘Z‘ or 'Y'. Then say 'ENTER' or click on tick button.
• Enter 'Short Text' and the required Components(Field Names),Component Type(Data Element).
• Save the Structure, 'Check it' and Active'. Then come back to the table screen by pressing F3 or the back button.

Working With FOREIGN KEY:-


Definition : It Is a Field in one Table that is connected to another table via Foreign key relationship and the purpose is to
validate the data being entered in one Table (Foreign Key Table) with a valid set of values from another table(Check
Table).
SCREEN PAINTER
Screens and Menus make up the graphical interface of an ABAP/4 application in SAP.

• Screen Painter: The ABAP/4 Development workbench provides special tool known as the Screen Painter to design and
maintain the screen and its elements.
• Screen Painter is a tool that allows the user to creates GUI screens for the transactions
• A Screen is also known as a DynPro (Dynamic Program).
• A Dynpro is a combination of a screen and the associated flow logic
• The Screen Painter is available in two modes. Graphical and Alphanumeric modes
• To use the screen painter enter SE51

A Screen is made up of different elements like the pushbuttons, radio buttons, checkboxes, labels etc.
Each of these elements are associated with:
• Attributes: Describe a screen. Screen attributes include things like a description, a type, and position.

• Layout: Refers to the arrangement of elements on a screen.

• Field attributes: Describe an element. For example, a particular field accepts only character input.

• Flow logic: Describes the relationship between a screen element and its underlying application. Flow logic is a series of
instructions.
Menu Painter:
Using the Menu Painter, you can design the interface components. The Menu Painter components are as follows:

• Status: Defines the combination of menu bars, menu lists, F-key settings, and functions available to an interface. For
example, an Editor application might have two statuses: edit and view. In edit status, the cut function is available and
with the view status the cut function is unavailable.

• Menu bars: Define functions available to the user. Where the functions appear depend on the dialog. If the dialog is
modal, the functions appear at the bottom of the interface as a row of buttons. In the primary window, the functions
can appear both as a row of menus and as buttons in a tool bar.

• Menu list: Lists the items in a specific menu. For example, an edit menu might contain items like copy, cut, and replace.

• F-key settings: Define keyboard keys associated with a particular interface function.

• Functions: Define individual functions such as cut, copy, and replace.

• Titles: Define window titles for an interface.


• https://www.stechies.com/screen-painter-menu-painter/
With SET SCREEN, the current screen simply specifies the next screen in the chain. control branches to this next screen
as soon as the current screen has been processed. Return from next screen to current screen is not automatic. It does
not interrupt processing of the current screen. If we want to branch to the next screen without finishing the current
one, use LEAVE SCREEN.

With CALL SCREEN, the current (calling) chain is suspended, and a next screen (or screen chain) is called in. The called
screen can then return to the suspended chain with the statement LEAVE SCREEN TO SCREEN 0. Sometimes we might
want to let an user call a popup screen from the main application screen to let them enter secondary information.
After they have completed their entries, the users should be able to close the popup and return directly to the place
where they left off in the main screen. Here comes CALL SCREEN into picture. This statement lets us insert such a
sequence into the current one.

Can we specify the next-screen number with a variable. ( Yes / No ).


Yes.

The field SY-DYNNR refers to ________________.

Number of the current screen.


Indexes of table .i.e.
Primary index
and secondary index

Creation of primary and secondary index


Lock Objects

Lock objects are use in SAP to avoid the inconsistency at the time of data is being insert/change into database.

SAP Provide three type of Lock objects.

• - Read Lock (Shared Locked) : protects read access to an object. The read lock allows other transactions read access
but not write access to the locked area of the table

• - Write Lock (exclusive lock) : protects write access to an object. The write lock allows other transactions neither
read nor write access to the locked area of the table.

• - Enhanced write lock (exclusive lock without cumulating) : works like a write lock except that the enhanced write
lock also protects from further accesses from the same transaction.

You can create a lock on a object of SAP through transaction SE11 and enter any meaningful name start with EZ Example
EZTEST_LOCK.
Lock Mechanism
Following are the two main functions
accomplished with the lock mechanism −

• A program can communicate with other


programs about data records that it is just
reading or changing.

• A program can prevent itself from reading


data that has just been changed by another
program.

A lock request is first generated by the


program. Then this request goes to the
Enqueue server and the lock is created in the
lock table. The Enqueue server sets the lock
and the program is finally ready to access data.
Use:

You can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user
to open the same object in change mode.

Example: in HR when we are enter a personal number in master data maintenance screen SAP can't allow to any other
user to use same personal number for changes.

When you create a lock object System automatically create two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

You have to use these function module in your program.

Structure of a Lock Object

The tables in which data records should be locked with a lock request are defined in a lock object together with their key
fields. When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also
be added using foreign key relationships.
Creating Lock Objects
Step 1 − Go to transaction SE11.
Step 2 − Click ‘Lock Object’ radio button. Enter the name of lock object starting with E and click the Create button. Here we use EZLOCK12.
Step 3 − Enter the short description field and click on Tables tab.
Step 4 − Enter the table name in Name field and select the lock mode as Write Lock.
Step 5 − Click on Lock parameter tab, the following screen will appear.

Step 6 − Save and activate. Automatically 2 function modules will generate. To check function modules, we can use Go to → Lock Modules.
Step 7 − Click Lock Modules and the following screen will open.
INTERNAL TABLES

Internal Tables and Work Areas are temporary memory locations which are used to store the data of database tables at
run time and in other way we can call them as instances of database tables.
Internal tables and Work areas .
Internal Tables Work Areas
•Temporary memory locations which •Temporary memory locations which
are used to store the data of database are used to store the data of database
table. table.
•Work area is an instance of database
•Internal table is an instance of table.
database table.
•By default 8kb memory will be
allocated and it increases dynamically(
+8kb +8kb).

Internal tables can store multiple Work areas can store only one record.
records.

General Syntax : DATA : <ITAB> TYPE General Syntax: DATA : <WA> TYPE
TABLE OF <DBTABLE> . <DBTABLE> .
Internal Table declaration
DATA : <ITAB> TYPE TABLE OF <DBTABLE> .
Example :
DATA : IT_ITAB TYPE TABLE OF MARA .
Example Explanation : Here IT_ITAB is the name of Internal table and MARA is the Database table name, after
declaring, IT_ITAB will be the instance of table MARA.

An internal Table declaration with user defined types


DATA : <ITAB> TYPE TABLE OF <userdefinedtype>.
Example is : TYPES : BEGIN OF TY_TABLE,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MEINS TYPE MARA-MEINS,
END OF TY_TABLE.<br>
DATA : IT_ITAB TYPE TABLE OF TY_TABLE .
Here TY_TABLE is a user defined type with 3 fields
Internal Table Deceleration Old Syntax (Obsolete Method)
Obsolete Syntax: DATA : IT_ITAB TYPE TABLE OF MARA occurs 0 with header line .
In this example Internal Table itself acts as work area, technically a work area will be created at the first row of the
internal table.
Internal table operations are most important for an ABAP developer, below are some of the most important
internal table operations:

• APPEND
• INSERT
• SORT
• DESCRIBE TABLE
• READ TABLE WITH KEY
• READ TABLE WITH INDEX
• LOOP....ENDLOOP.
• MODIFY
• DELETE
• DELETE ADJACENT DUPLICATES
• CLEAR, REFRESH, FREE
• APPEND LINES OF
• INSERT LINES OF
• MOVE
• COLLECT
• APPEND statement is used to append or add a record from work area to internal table, the new record will be added at
the end of the internal table.
Syntax: APPEND <WA> TO <ITAB>

• INSERT statement is used to insert or add a record from work area into internal table at the specified location
Syntax: INSERT <WA> INTO <ITAB> INDEX <index>(record position)

• SORT is used to sort a Internal table data in ascending order or descending order, by default it will sort the data in
ascending order. In addition to this we can able to sort data based on specified fields.
Syntax1: SORT <ITAB . "Default sorts data in ascending order
Syntax2 : SORT <ITAB> DESCENDING . " Sort in descending order
Syntax3 : SORT <ITAB> BY <FIELD1> <FIELD2...ASCENDING/DESCENDING ."It sorts data by specified fields
<FIELD1>, <FIELD2>..

• DESCRIBE TABLE is used to count the no of records in a internal table.


Syntax: DESCRIBE TABLE <ITAB> LINES <v_lines> ." Count the no. Of record of an internal table, v_lines store count

• READ TABLE WITH INDEX is used to read a single record from an internal table into work area specified by index.
Syntax: READ TABLE <ITAB> INTO <WA> INDEX <index_no " Read a record into work area using index ( position )
• READ TABLE WITH KEY .. BINARY SEARCH is used to read a single record from an internal table into work area specified by
field name and field value .
Syntax: READ TABLE <ITAB> INTO <WA> WITH KEY <FIELD1> = <FIELD1 VALUE> <FIELD1> = <FIELD1 VALUE>BINARY
SEARCH." Read a record into work area where some field = some value

BINARY SEARCH is a search mechanism which is used to read a record from internal table into work area very fast, the
functionality of binary search it divides the into parts and searches. The internal table must be sorted in ascending
order before using binary search.

• Loop...Endloop. is also used to read data from a internal table into work area, this is used to read multiple records serially
one after one .
Syntax1: LOOP AT <ITAB> INTO <WA> .
ENDLOOP.

Syntax2: LOOP AT <ITAB> INTO <WA> WHERE <FIELDS1> = <VALUE> .


ENDLOOP.

Syntax3: LOOP AT <ITAB> INTO <WA> FROM <INDEX1> TO <INDEX2>.


ENDLOOP.
• MODIFY is used to modify a single or multiple internal table records based on condition
Syntax1: MODIFY <ITAB> FROM <WA> TRANSPORTING <FIELD1><FIELD2> WHERE <CONDITION>

TRANSPORTING is a keyword which is used to specify a list of fields to be modified instead of all fields.
Syntax1: MODIFY <ITAB> FROM <WA> INDEX <INDEX NO> TRANSPORTING <FIELD1> <FIELD2>

SY-TABIX is a key word which stores the index no of currently processed record.

• DELETE is used to delete single or multiple records from an internal table from work area based on some
condition.
Syntax1: DELETE <ITAB> INDEX <INDEX NO>.
Syntax2: DELETE <ITAB> WHERE <FIELD1> = <FIELD1 VALUE> <FIELD2> = <FIELD2 VALUE>.

• DELETE ADJACENT DUPLICATES is used to delete delete duplicate records which are adjacent to each-other.Pre-
requisite for this is the internal table must be sorted in ascending order

Syntax1: DELETE ADJACENT DUPLICATED FROM <ITAB> ."adjacent duplicated will be deleted in internal
table comparing all fields
Syntax2: DELETE ADJACENT DUPLICATES FROM <ITAB> COMPARING <FIELD1> <FIELD2> . "adjacent
duplicates will be deleted comparing specified fields
• CLEAR is used to clear a value in a work area or in a variable.
Syntax clear : CLEAR <WA> "CLEAR WORK AREA OR VARIABLE

• REFRESH is used to clear all values in an internal table.


Syntax REFRESH: REFRESH <ITAB> "CLEAR ALL RECORDS OF INTERNAL TABLE BUT

• FREE is used to clear (free) memory of an internal table or work area. We all know whenever we declare an internal table
or work area, 8kb memory will be allocated. Memory will be there.
Syntax FREE : FREE <WA> "FREE INTERNAL TABLE MEMORY

• APPEND LINES OF is used to append multiple records to an internal table from another internal table.
Syntax : APPEND LINES OF <ITAB1> FROM <index no> TO <index no2> TO <ITAB2>.

• INSERT LINES OF is used to INSERT multiple records to an internal table from another internal table at the specified
location.
Syntax : INSERT LINES OF <ITAB1> FROM <index no> TO <index no2> INTO <ITAB2> INDEX <index no>.

• MOVE keyword is used to move one internal table data to another.


Syntax: <ITAB2[]> = []> . "Move ITAB1 to ITAB2

• COLLECT is slimier to APPEND, the difference is it (COLLECT) will check whether the work area record already exists with
the same key (only C, D, N, T), if exists it will add numerical fields (sum) to the existing record, if the work area record does
not exist it will append a new record.
Syntax: COLLECT <WA> INTO <ITAB>.
Internal tables are used for many purposes −

• They can be used to hold results of calculations that could be used later in the program.
• An internal table can also hold records and data so that this can be accessed quickly rather than having to access this data
from database tables.
• They are hugely versatile. They can be defined using any number of other defined structures.

You might also like