Skip to Content
author's profile photo Former Member
Former Member

Question reg. select statement

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

12 Answers

  • Best Answer
    Posted on Sep 29, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 29, 2006 at 02:21 PM

    If the field list in the internal table is exactly the same as the fields in your internal table(data type and length), then there is no need to use "INTO CORRESPONDING", but you still need to say INTO TABLE OF.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2006 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.