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

array fetch

Former Member
0 Likes
959

what is mean by array fetch and what is the use of it

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
742

Hi,

Array fetch is noting but extracting all the field of a database table using * in the select clause.

for example select * from vbap

generally it should be avoid to improve the performance by selecting only required fields from the table as below

It is mostly used to fetch multiple records in a single command.

e.g.

select * from mara into table z_mara.

FYI:

Other type is sequential type, in which select...endselect is used and each recordis processed after fecthcing...

e.g.

select single * from mara

" process ur data

append mara into z_mara.

endselect.

Both of above statement performs same function but first one is using array fetch and second one is using sequential fetch.

Jogdand M B

3 REPLIES 3
Read only

Former Member
0 Likes
742

The main difficulties is connecting the programming language with the sql interface is the transfer of retrieved data fecords..

  • when the system process an sql statement it does not know how long the result would be.

  • The system has to transfer these records to the calling of a program in the form of a structure that is an <b>array</b>.

*The disadvantage of the array is that it is a static definition..u have to specify the size before runtime..As u do noy know the size it will overflow.

<b>*<i>To avoid this problem sap system translates the open sql statements into an embeded sql...</i></b>

*To do this the system defines a cursor and the cursor is the logical connection to the selected datasets in the database and transfer between abap programs.

*This<u> <b>FETCH</b></u> operation passes one or more records to the database interface..

This is called as array fetch..

Reward if it's useful..

Regards,

Manoj @ Eminent.

Read only

Former Member
0 Likes
743

Hi,

Array fetch is noting but extracting all the field of a database table using * in the select clause.

for example select * from vbap

generally it should be avoid to improve the performance by selecting only required fields from the table as below

It is mostly used to fetch multiple records in a single command.

e.g.

select * from mara into table z_mara.

FYI:

Other type is sequential type, in which select...endselect is used and each recordis processed after fecthcing...

e.g.

select single * from mara

" process ur data

append mara into z_mara.

endselect.

Both of above statement performs same function but first one is using array fetch and second one is using sequential fetch.

Jogdand M B

Read only

Former Member
0 Likes
742

thanks guys