3.internal Tables
3.internal Tables
SANJAY
WHAT IS AN ITAB
▪ Intermediate tables
▪ Temporary tables
▪ Created on RAM
▪ INSERT
▪ UPDATE
▪ MODIFY
▪ DELETE
WORK AREA
ITAB
ITAB TYPES
Fully-specified TYPES: determine how the system will access the entries in the table
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
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
…………….
…………….
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