Professional Documents
Culture Documents
ABAP TUTORIAL
ASK A QUESTION
SUBMIT A TIP
SAPHub
SAP for Beginners
AdChoices
ABAP Sap
Statement
Index Table
Reading
Search
NEWSLETTER
Enter your email address:
Subscribe
Delivered by FeedBurner
Data can be read from an internal table using the following 2 statements.
pdfcrowd.com
In READ TABLE statement we need to specify either INDEX or KEY but not both at the same time. If we want to read
the third row from the internal table, then specify the index as 3 in the INDEX clause of the READ statement. Index is a
relative row number of the internal table.
SAPHub
2,319 likes
If the record is found then the found record is copied to work area and SY-SUBRC is set to 0. Otherwise SY-SUBRC is
set to 4 and work area remains unchanged.
Like Page
*--------------------------------------------------------------*
Share
*Data Types
*--------------------------------------------------------------*
TYPE n,
name(10) TYPE c,
END OF ty_student.
*--------------------------------------------------------------*
*Data Declaration
*--------------------------------------------------------------*
DATA: gwa_student TYPE ty_student.
CATEGORIES
= 1.
gwa_student-name
= 'JOHN'.
ABAP General
ABAP Tutorial
gwa_student-id
= 2.
ABAP Workbench
gwa_student-name
= 'JIM'.
ALE IDoc
ALV
gwa_student-id
= 3.
gwa_student-name
= 'JACK'.
Debugging
Enhancements
FI
pdfcrowd.com
IF sy-subrc = 0.
WRITE: gwa_student-id, gwa_student-name.
Files
LSMW
ELSE.
WRITE 'No Record Found'.
ENDIF.
MM
Modularization
Output
Performance
Reports
We can also read a row from the internal table based on the value in a particular field using KEY clause of the READ
statement. If more than one row found in the internal table with the same value specified in the KEY clause then only
Selection Screen
Smartforms
RECENT POSTS
Track Changes Made in ABAP Debugger
Find Saplogon.ini File Location
ENDIF.
Output
TAGS
abap ABAP Dictionary
ALV
processed the control goes to the next line after the ENDLOOP statement.
selection
screen smartforms table tcodes
reports sap-note scripting SD
text
pdfcrowd.com
SKIP.
WRITE:/ 'Display records based on condition' COLOR 5.
WRITE:/ 'Display records where place is LONDON' COLOR 5.
LOOP AT gt_employee INTO gwa_employee WHERE place = 'LONDON'.
WRITE:/ gwa_employee-id, gwa_employee-name, gwa_employee-place.
ENDLOOP.
Output
Tweet
Like
Share
Related posts:
1. What is an ABAP Internal Table and How to Create it?
2. Deleting Lines from an ABAP Internal Table
3. Inserting Lines into ABAP Internal Tables
4. Changing Lines in ABAP Internal Tables
5. More on ABAP Internal Tables
8 Comments
hesin.nas says:
Dec ember 8, 2011 at 1:37 pm
Kannan says:
Oc tober 25, 2012 at 9:58 am
pdfcrowd.com
Reply
Bas He says:
Marc h 4, 2014 at 9:27 am
Really simple, thanks. Also, of course, theres the SAP documentation on it:
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
Reply
hey i have question..what can be changed while lopping at internal tablelike which value can be
changed? (e.g. , sum, lead to) pls need this. Thank you.
Reply
pdfcrowd.com
Reply
0 Trackbacks
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Post Comment
pdfcrowd.com
pdfcrowd.com