Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

INTERNAL CONCEPT - READ TABLE - COMPARING AND TRANSPORTING ?

Former Member
0 Likes
2,316

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.

6 REPLIES 6
Read only

ThomasZloch
Active Contributor
0 Likes
1,286

DO YOU HAVE ACCESS TO ABAP ONLINE HELP? IT'S ALL THERE!!!

Read only

Former Member
0 Likes
1,286

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.

Read only

Former Member
0 Likes
1,286

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

Read only

0 Likes
1,286

Still not clear...

can u explain with an example

Read only

0 Likes
1,286

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.

Read only

Former Member
0 Likes
1,286

Hi,

Try using ABAPDOCU tcode.

Thanks,

Sriram Ponna.