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

Reading a record by key access.

Former Member
0 Likes
666

Hi Gurus,

In 'read table' for reading a record by key access they have used 'comparing' , 'transporting' , 'assigning'.

Can you please explain me what exactly the above will happen with an clear example.

Thanks,

Prabu S.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
637

these things are explained in the documentation

for the read you need none of them, use the INTO wa for 95% of all cases.

Hi Gurus,

In 'read table' for reading a record by key access they have used 'comparing' , 'transporting' , 'assigning'.

Can you please explain me what exactly the above will happen with an clear example.

Thanks,

Prabu S.

4 REPLIES 4
Read only

Former Member
0 Likes
637

Hi Prabu,

Welcome to SDN.

Read the Sap Help or serch the SCN before posting the any question.

Read only

Former Member
0 Likes
638

these things are explained in the documentation

for the read you need none of them, use the INTO wa for 95% of all cases.

Read only

0 Likes
637

mostly you wont need these

but still: from documentation:

READ TABLE - transport_options 


Syntax 
... [COMPARING { {comp1 comp2 ...}|{ALL FIELDS}|{NO FIELDS} }] 
    [TRANSPORTING { {comp1 comp2 ...}|{ALL FIELDS} }] ... . 



Effect: 
The addition COMPARING compares the specified components comp1 comp2 ... (or the subareas or attributes thereof) in a found 
line before they are transported with the corresponding components of the work area. If ALL FIELDS is specified, all components 
are compared. If no NO FIELDS is specified, no components are compared. If the content of the compared components is 
identical, sy-subrc is set to 0. Otherwise it is set to 2. The found line is assigned to the work area independently of the result of 
the comparison. 

If the addition TRANSPORTING is specified, only the specified components comp1 comp2 ... (and their subareas) in the found line 
are assigned to the corresponding components of the work area (or their subareas). If ALL FIELDS is specified, all the 
components are assigned. 

COMPARING must be specified before TRANSPORTING. The components comp1 comp2 ... are specified according to the rules in 
the section Specifying Components. This is subject to the restriction that after TRANSPORTING, attributes of classes cannot be 
addressed using the object component selector, and after COMPARING, this is only possible as of release 6.10.

Read only

0 Likes
637

thankyou