‎2007 May 09 12:52 PM
‎2007 May 09 7:03 PM
An array fetch means reading all fields of a db table into an internal table at once.
e.g.
DATA: it_table type table of sflight.
SELECT * FROM sflight INTO TABLE it_table.
‎2007 May 09 12:56 PM
Hi!
In ABAP there is no such ARRAY, like in some other languages (Pascal, Delphi, etc)
An alternative array example:
DATA: p1(1000) TYPE c VALUE 'I PREFER PI'.
DATA: p2(1000) TYPE c.
DATA: s_len TYPE i.
CONDENSE p1 NO-GAPS.
s_len = NUMOFCHAR( p1 ).
DATA: position TYPE i VALUE '0'.
DATA: position2 TYPE i.
DATA: offset1 TYPE i.
DO s_len TIMES.
position2 = s_len - position - 1.
p2+position2(1) = p1+position(1).
position = position + 1.
ENDDO.
WRITE: / p1.
WRITE: / p2.
if p1 = p2.
write: / 'Palindrome!'.
endif.
Regards
Tamá
‎2007 May 09 5:17 PM
Hi Mukesh,
Array fetch is noting but extracting all the field of a database table using * in the select clause.
for example select * from vbap
the above statement is called as array fetch, generally it should be avoid to improve the performance by selecting only required fields from the table as below
select vbeln posnr netpr
from vbap.
‎2007 May 09 7:03 PM
An array fetch means reading all fields of a db table into an internal table at once.
e.g.
DATA: it_table type table of sflight.
SELECT * FROM sflight INTO TABLE it_table.
‎2007 May 10 5:05 AM
‎2007 May 10 7:54 AM
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 array.
*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.
*To avoid this problem sap system translates the open sql statements into an embeded sql...
*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 FETCH operation passes one or more records to the database interface..
This is called as array fetch..
Reward if it's useful..
Regards,
Manoj @ Eminent.