09-29-2006 3:15 PM
If I mention the fields to be selected in the select statement, do I still need to mention 'Into corresponding fields of'?
select fieldA fieldB fieldC
from dbtable
into table itab
---
---
OR
select fieldA fieldB fieldC
from dbtable
into corresponding fields of table itab
---
---
Thanks,
Krishen
09-29-2006 3:19 PM
hi krishen,
one abap tip.
try to avoid into corressponding.it will reduce performance.
declare ur internal table in correct format.
select fields in the same order of the internal table fields.
use INTO TABLE.
RGDS
anver
pls mark hlpful anwsers
09-29-2006 3:16 PM
yes - when order of your fiels in your select statment is different from order of the field in you it_tablee.
BR, JAcek
Message was edited by: Jacek Slowikowski
09-29-2006 3:18 PM
Hi,
it depends on the declaration of internal table. If the field sequence in internal table is in sequence with select then no need of into corresponding fields addition else it is required.
Hope this helps.
09-29-2006 3:21 PM
Thank you friends.
does 'into corresponding fields of' decrease performance in any way?
Thanks,
Krishen
09-29-2006 3:21 PM
yes . performance of into corresonding field is worse then into table statment.
09-29-2006 3:23 PM
09-29-2006 3:19 PM
hi,
Yes, you have to mention it.
though you mention fields in select statement, you have to specify <b>into corresponding fields of table it_table</b>.
If the fields are specified in the same sequence as in internal table, we can just say <b> into table it_table</b>.
REgards,
Sailaja.
09-29-2006 3:19 PM
hi krishen,
one abap tip.
try to avoid into corressponding.it will reduce performance.
declare ur internal table in correct format.
select fields in the same order of the internal table fields.
use INTO TABLE.
RGDS
anver
pls mark hlpful anwsers
09-29-2006 3:20 PM
For example if u have a internal tabel like this:
data: begin of i_data occurs 0,
data1 type char10,
data2 type char10,
data3 type char10,
end of i_data.
Select data1 data2 into table i_data from <table>.
Here into corresponding fields is not necessary.
But,
Select data2 data3 into corresponding fields of table i_data from <table>.
Here it is neccessary.
It all depends on ur internal table declaration.
Prakash.
09-29-2006 3:20 PM
Hi
It depends on the declaration of your internal table. If you have declared the data in the internal table in the same order of the select statement that is like this
data: begin of itab occurs 0,
a type i,
b type i,
c type i,
d type i,
end of itab.
then no need of into corresponding fields of.
If the data is not in the order which you mentioned in the internal table then you have to use into corresponding fields of.
Hope this will help you.
Regards
Haritha
09-29-2006 3:21 PM
hI,
Declare like this.
types: begin of ty_strt,
fielda like db-fieldname,
fieldb like db-fieldname,
fieldc like db-fieldname,
end of ty_strt.
data : ta_strt type table of ty_strt.
now write select query
select
field1
fieldb
fieldc
from db
into table ta_strt.
regards,
nagaraj
09-29-2006 3:21 PM
09-29-2006 3:23 PM
Hi krishen,
1. Both will work.
2. to get a taste of it, just copy paste
3.
report abc.
*----
DATA : BEGIN OF ITAB OCCURS 0,
BUKRS LIKE T001-BUKRS,
BUTXT LIKE T001-BUTXT,
END OF ITAB.
*----
SELECT BUKRS BUTXT
INTO TABLE ITAB
FROM T001.
SELECT BUKRS BUTXT
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM T001.
BREAK-POINT.
regards,
amit m.
09-29-2006 3:23 PM
Hi,
If the order of the fields selected in the select statement and the order of fields in the table are same then it is not necessary to use into corresponding fields. And it is not recommended to use INTO CORRESPONDING addition in veiw of performance.
Thanks and Regards,
Bharat Kumar Reddy.V
09-29-2006 3:23 PM
hi,
Yes, it does.
It has to first find the corresponding field and then send data to it. In case of into table, it just sends data.
So, into corresponding fields take make time.
Regards,
Sailaja.
09-29-2006 3:27 PM
hi krishen
if ur issue solved, kindly close the thread after giving suitable points.
rgds
anver