0% found this document useful (0 votes)
9 views35 pages

3.internal Tables

The document provides an overview of internal tables (ITAB) in programming, explaining their purpose, classification, and types. It details operations such as SELECT, INSERT, and DELETE that can be performed on ITAB, as well as the syntax used in ABAP for defining and manipulating these tables. Additionally, it highlights the differences between standard, sorted, and hashed tables, and includes examples of user-defined types and control break statements.

Uploaded by

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

3.internal Tables

The document provides an overview of internal tables (ITAB) in programming, explaining their purpose, classification, and types. It details operations such as SELECT, INSERT, and DELETE that can be performed on ITAB, as well as the syntax used in ABAP for defining and manipulating these tables. Additionally, it highlights the differences between standard, sorted, and hashed tables, and includes examples of user-defined types and control break statements.

Uploaded by

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

INTERNAL TABLES

SANJAY
WHAT IS AN ITAB

▪ Intermediate tables

▪ Temporary tables

▪ Created on RAM

Internal tables DATA base


tables
WHY WE NEED ITAB
ITAB
▪ SELECT

▪ INSERT

▪ UPDATE

▪ MODIFY

▪ DELETE

DATA BASE TABLE


HOW TO WORK WITH ITAB

1. Declare internal table

2. Populate internal table

3. Display internal table


ITAB CLASSIFICATION

▪ Based on syntaxes ITAB are classified as

1. ITAB with header line

2. ITAB without header line

ITAB With Header ITAB Without Header

800 5000 24.01.1997 800 5000 24.01.1997

800 5000 24.01.1997


800 5000 24.01.1997

WORK AREA

ITAB
ITAB TYPES

➢ This section describes how to define internal tables locally in a


program.
1. Table TYPE
2. Key TYPE
3. Line TYPE
4. Row TYPE

Fully-specified TYPES: determine how the system will access the entries in the table

➢ STANDARD TABLE System uses a linear search for standard tables,


➢ SORTED TABLE
a binary search for sorted tables,
➢ HASHED TABLE
and a search using a hash algorithm for hashed tables.
DIFFERENCES

STANDARD TABLE SORTED TABLE HASHED TABLE

Open SQL operations allowed Allowed Not allowed

System uses Linear search Binary search Hash Algorithm

Uses Non Key field of DBTABLE Either Key / Non Key All ways Key

Default & Mostly used tables Used if the ITAB to be created in sorted Used to store Large amount of data
order

Response time depends on no of entries No of entries Constant

No restrictions Sort operation not possible Index based operation not possible
SYNTAXES IN ABAP

❖ ITAB & WA
➢ DATA <ITAB > TYPE TABLE OF <DATABASE TABLE / USER DEFINED TYPE >. Itab With out Header
➢ DATA <WA > TYPE <DATABASE TABLE / USER DEFINED TYPE >.

➢ DATA <ITAB > TYPE <DATABASE TABLE> OCCURS 0. Itab With Header
➢ DATA <WA > TYPE < DATABASE TABLE > OCCURS 0 WITH HEADER LINE .

❖ SELECT STATEMENT
➢ SELECT * (OR) F1 F2 F3 FROM <DATABASE TABLE>
INTO <ITAB/WA>
WHERE <F1> = <V1>
AND <F2> = <V2> …

❖ LOOP…. ENDLOOP
➢ LOOP AT <ITAB> INTO <WA>.
……………..
……………..
……………..
ENDLOOP.
DEVELOP A REPORT --- TO DISPLAY CUSTOMER DETAILS

SE38
USER DEFINED TYPES

➢ TYPES: is the keyword to define a user defined type.


➢ SYNTAX:

TYPES: BEGIN OF < TYPE NAME >,

F1 TYPE < TABLE-FNAME >,

F2 TYPE < TABLE-FNAME >,

…………….

…………….

END OF < TYPE NAME >.


DEVELOP A REPORT --- TO DISPLAY CUSTOMER NUMBER, COUNTRY, NAME ,CITY

SE38
SELECT …….. INTO CORRESPONDING FIELDS
OPERATIONS ON ITAB

1. SELECT
2. APPEND To fill ITAB
3. INSERT
1. READ
2. LOOP….ENDLOOP To Read records from ITAB

1. MODIFY
2. COLLECT
3. SORT Special operations

4. DELETE
1. CLEAR
2. CLEAR[]
3.REFRESH To Delete ITAB
4.FREE
SELECT, APPEND, INSERT, LOOP….ENDLOOP
READ OPERATION
MODIFY
SORT
Collect statement compares current record with existing record, if system finds any duplicate record then it removes all
COLLECT duplicate records and also it sums up non key field concerned (I,F,P,CURR) values
DELETE
CLEAR, REFRESH, FREE
DESCRIBE TABLE: LINES
DESCRIBE TABLE: KIND
ADDITIONAL OPERATIONS ON ITAB: APPEND MULTIPLE RECORDS
INSERT MULTIPLE RECORDS
SORT
READ
MOVING EXISTING ITAB CONTENT TO NEW ITAB
MODIFY
INSERT, APPEND ON SORTED ITAB
TYPE GROUP

SE11 SE38
TYPE GROUP

SE11
SE38
CONTROL BREAK STATEMENTS
CBREAK STATEMENTS
DIFFERENCE BETWEEN AT NEW & ON CHANGE OF
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy