2008 Apr 10 2:48 PM
HI,
I AM SHABEER AHMED MYSELF ABAP FRESHER,
IN INTERNAL TABLE CONCEPT WHILE READING INTERNAL TABLE WE USE "COMPARING" KEYWORD AND "TRANSPORTING" KEYWORD. WHATS THE MEANING AND USE OF IT.
HI,
I AM SHABEER AHMED MYSELF ABAP FRESHER,
IN INTERNAL TABLE CONCEPT WHILE READING INTERNAL TABLE WE USE "COMPARING" KEYWORD AND "TRANSPORTING" KEYWORD. WHATS THE MEANING AND USE OF IT.
2008 Apr 10 2:51 PM
2008 Apr 10 2:54 PM
Hi,
comparing with read statement is used specific fields of internal table are compared.
if u Transporting with read statment only those fields specified with transporting are copied into the work area.
example is:
DATA: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2.
INSERT LINE INTO TABLE ITAB.
ENDDO.
CLEAR LINE.
READ TABLE ITAB WITH TABLE KEY COL1 = 3
INTO LINE TRANSPORTING COL2.
WRITE: 'SY-SUBRC =', SY-SUBRC,
/ 'SY-TABIX =', SY-TABIX.
SKIP.
WRITE: / LINE-COL1, LINE-COL2.
The output is:
SY-SUBRC = 0
SY-TABIX = 3
0 9
The program fills a sorted table with a list of square numbers. The READ statement reads the line of the table in which the key field COL1 has the same value as in the work area and copies it into the work area. Only the contents of COL2 are copied into the work area LINE. SY-SUBRC is zero, and SY-TABIX is 3, because ITAB is an index table.
2008 Apr 10 2:57 PM
Hi,
When u are searching for a particular line item in an internal table, you use 'comparing', and when you wanna modify an internal tables for a particular field or fields, you use transporting.
ex : MODIFY itab FROM wa indeEX sy-tabix TRANSPORTING a b c.
Thanks & Regards
Nayan
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 10, 2008 1:42 PM
2013 Sep 26 6:21 PM
2013 Sep 26 6:27 PM
You can search on Google for the same with example..
Just try once, if you have any query after that . Please ask to us. We all are happy to help.
BR
ChanS.
2008 Apr 10 3:25 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |