‎2007 Jul 19 5:48 AM
‎2007 Jul 19 5:50 AM
ENDSELECT is used when the selection involves more than one row and the output is into a single structure
eg:
select * from mara into corresponding fields of mara_wa.
append mara_wa to it_mara.
endselect.
cases where endselect is not used would be where you enter data directly into the table such as
select * from mara into corresponding fields of <b>table</b> it_mara.
or selecting a single record
select <b>single </b>* from mara into corresponding fields of mara_wa.
or selecting a count
select count(*) from mara into i_number.
‎2007 Jul 19 5:50 AM
ENDSELECT is used when the selection involves more than one row and the output is into a single structure
eg:
select * from mara into corresponding fields of mara_wa.
append mara_wa to it_mara.
endselect.
cases where endselect is not used would be where you enter data directly into the table such as
select * from mara into corresponding fields of <b>table</b> it_mara.
or selecting a single record
select <b>single </b>* from mara into corresponding fields of mara_wa.
or selecting a count
select count(*) from mara into i_number.
‎2007 Jul 19 5:51 AM
HI,
in case of 1)select single ..... 2)select.......into [corresponding-fields of] table itab.
we should not use endselect.
in all other cases we have to use endselect.
rgds,
bharat.
‎2007 Jul 19 5:52 AM
Hi Debarshi..
If you are using select statement you need to use either one of the following statement..
1. select..... into tablename
0r
2. select.... endselect
Thanks
Gowrishankar
‎2007 Jul 19 5:52 AM
hi,
endselect statements has to be used when u write select statements for retieving data from database.but if u use a syntax like below
select lifnr land1 name1 ort01 sortl from lfa1
UP TO 50 ROWS into corresponding FIELDS OF TABLE itab.
there is no need of using endselect.
ie..if u use select single * or select * from <table> into table <itab>
there is no need of using endselect.otherwise u have to use it.
Prajith
‎2007 Jul 19 5:52 AM
Hi,
A SELECT command for which the INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE itab is inserted into an internal table, must be followed by ENDSELECT .
Or
For all other SELECT commands, ENDSELECT must be used unless a single line above the addition SINGLE is read after SELECT and unless the columns of the result set are statically specified and contain only aggregate functions without the specification of the addition GROUP BY.
Regards,
Himanshu
‎2007 Jul 19 5:53 AM
hi
ENDSELECT.
Effect
The ENDSELECT statement closes a loop started with SELECT.
A SELECT command for which the INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE itab is inserted into an internal table, must be followed by ENDSELECT if the addition PACKAGE SIZE is used.
For all other SELECT commands, ENDSELECT must be used unless a single line above the addition SINGLE is read after SELECT and unless the columns of the result set are statically specified and contain only aggregate functions without the specification of the addition GROUP BY.
regards
dinesh