‎2006 Nov 16 12:02 PM
‎2006 Nov 16 12:10 PM
Effect
Works like ... INTO wa, except that the selected data is not placed in the internal table itab line by line, but in one single operation. In this case, SELECT does not introduce a processing loop, so there can be no ENDSELECT statement. The old contents of itab are overwritten. Fields of the internal table itab which are not filled are initialized based on their ABAP data type (see DATA).
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs.See Open SQL and Unicode.
Example
Output a list of all airlines (with short description and name):
DATA: ITAB TYPE STANDARD TABLE OF scarr WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 100,
wa_itab TYPE scarr.
WA_ITAB TYPE SCARR.
SELECT * INTO TABLE itab FROM scarr.
LOOP AT itab INTO wa_itab.
WRITE: / wa_itab-carrid, wa_itab-carrname.
ENDLOOP.
Addition
... PACKAGE SIZE n
Effect
Works like ... INTO wa, except that the selected data is not placed in the internal table itab line by line, but in packets of n lines. The old contents of itab are overwritten.
n <= 0 causes a runtime error.
Internally, n is placed in a type I field. Here, the usual conversion rules apply (see MOVE).
After leaving the processing loop, the contents of the internal table itab are undefined.
If the result of the selection is a table, the data is retrieved in a processing loop introduced by SELECT and concluded by ENDSELECT. The processing passes through the loop once for each line read.
‎2006 Nov 16 12:10 PM
Effect
Works like ... INTO wa, except that the selected data is not placed in the internal table itab line by line, but in one single operation. In this case, SELECT does not introduce a processing loop, so there can be no ENDSELECT statement. The old contents of itab are overwritten. Fields of the internal table itab which are not filled are initialized based on their ABAP data type (see DATA).
In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs.See Open SQL and Unicode.
Example
Output a list of all airlines (with short description and name):
DATA: ITAB TYPE STANDARD TABLE OF scarr WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 100,
wa_itab TYPE scarr.
WA_ITAB TYPE SCARR.
SELECT * INTO TABLE itab FROM scarr.
LOOP AT itab INTO wa_itab.
WRITE: / wa_itab-carrid, wa_itab-carrname.
ENDLOOP.
Addition
... PACKAGE SIZE n
Effect
Works like ... INTO wa, except that the selected data is not placed in the internal table itab line by line, but in packets of n lines. The old contents of itab are overwritten.
n <= 0 causes a runtime error.
Internally, n is placed in a type I field. Here, the usual conversion rules apply (see MOVE).
After leaving the processing loop, the contents of the internal table itab are undefined.
If the result of the selection is a table, the data is retrieved in a processing loop introduced by SELECT and concluded by ENDSELECT. The processing passes through the loop once for each line read.
‎2006 Nov 16 12:17 PM
It select only a "pack" of n records instead of select all records at the same time.
In this way u can split the selection, for example it can select 50 hit for each selection.
So
- SELECT * INTO TABLE ITAB FROM <table> WHERE ....
select all records;
- SELECT * INTO TABLE ITAB PACKAGE SIZE 50 FROM <table>
WHERE.....
ENDSELECT.
select 50 records for each time
Max
‎2006 Nov 16 12:23 PM
HI,
This is a statement used between SELECT ENDSELECT when you are reading data from a table. The packetsize gives you the size od the data packet that you want to read from the database server to the application server. This is useful if you want to restrict the data you are reading can exceed your internal table line.
The addition PACKAGE SIZE can be used to limit the amount of data read in one go. Otherwise a runtime error can occur when reading a data set that is too large into an internal table so that its maximum size is exceeded
Regards,
Sesh