Skip to Content
Author's profile photo TANKA RAVICHANDRA

Use of Into corresponding fields.

Hi…

Usage of Into corresponding fields :

Internal table:

Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure.

/wp-content/uploads/2013/07/1_251998.jpg

         

 

Select statement will fetch the data from the column erdat, kunnr, name1 and land1 from table KNA1 and places the data in the internal table , here the data will be inserted based on the fields created in the structure. 

/wp-content/uploads/2013/07/2_252008.jpg

The above pic shows the internal table is filled with the data with select statement,  but here the data of erdat is stored in the kunnr field of the internal table and the kunnr data is filled in erdat field of the internal table. Please refer the above pic clearly.

Whenever we execute the above statement, we get the below dump.

/wp-content/uploads/2013/07/3_252083.jpg

The above dump is displayed because we are placing the data of one field in another field as a result we are getting the dump. The dump message clearly explains the message.

So to avoid this situation we use the keyword “INTO CORRESPONDING FIELDS “ to place the data in the required fields.  The  program demonstrates the into corresponding fields keyword, whenever we use that keyword the data will be placed in the corresponding fields irrespective of the order present in the select statement.

/wp-content/uploads/2013/07/4_252085.jpg

Please observe closely the data movement of the data when we write the select statement, as i have drawn the curve showing the direction of the records to be stored.

Hope u got it,

Assigned tags

      27 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Good Blog Ravi..

      Author's profile photo Suman Chakravarthy K
      Suman Chakravarthy K

      Hi Ravi Chandra,

      I really appreciate your expertise in ABAP. I really like the way you explain concepts clearly like in any training program.

      Regards,

      Suman

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thnx alot suman.

      Author's profile photo jagadeeshwar dasari
      jagadeeshwar dasari

      Hi ravi,

        Your explanation is superb and easy to get the concept....

      Thanq,

      Jagadeesh

      Author's profile photo Former Member
      Former Member

      nice blog ravi...

      Author's profile photo Former Member
      Former Member

      Hi Ravi,

          Way of explanation is  really awesome.This blog's  very useful for the beginners.

      I like the BLOG with clear concept.

      Regards,

      Birajini

      Author's profile photo Former Member
      Former Member

      Hi Ravi,

      Thanks to you by way to easily understanding......

      Thanks,

      Purushotham.

      Author's profile photo Ranganath Korata
      Ranganath Korata

      Hi Ravi,

      It is a well explained blog with diagrams and screenshot. I have a doubt which I'd like to discuss. I remember being told during my training to avoid using "INTO CORRESPONDING FIELDS OF", and I think the reason was that the system checks for matching column names, which is an additional step and a unnecessary burden on the system. To avoid this, I used to SELECT fields in the order the Internal table structure was defined.

      I later came across some senior developers who told me that Selecting fields from a base table in the sequence in which fields are listed is the efficient way of writing a SELECT statement. This made me switch back to using "INTO CORRESPONDING FIELDS OF".

      Basically I received conflicting answers from different developers. So, now that there is a blog on it, I'd like to discuss/know which one has precedence. Please let me know your thoughts on it.

      Thanks,

      Ranga.

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Hi ranga,

      If you write into corresponding fields, then it will degrade the performance, because it has to search for the corresponding fields in the internal table and then it has to load the data into that fields.

      You have to use this keyword, if you don't remember the sequence of the fields in the table.

      Hope u got it,

      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      Very well explained...

      Regards,

      AL

      Author's profile photo CH Raman
      CH Raman

      Good explanation and easily understandable. Thanks for your efforts.

      Thanks

      Author's profile photo Kamal Mehta
      Kamal Mehta

      Again informative , short , Concept is clear.

      We shall be waiting for your blogs in various other scenarios in BW Modeling , Extraction , Reporting as well.

      Thanks

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Hi Kamal,

      Thanx for the nobel words, i  will update the new blogs ASAP.

      Regards,

      RaviChandra.

      Author's profile photo Martin Grob
      Martin Grob

      nicely explained I agree with the others

      thanks

      Martin

      Author's profile photo Former Member
      Former Member

      Thanks for sharing this useful knowledge....

      Author's profile photo Former Member
      Former Member

      Thanks for sharing this useful knowledge....

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thanx Sarangi,

      Author's profile photo Former Member
      Former Member

      Wow great explanation...

      Author's profile photo Former Member
      Former Member

      Thanks

      For Giving Clear Concept Idea..

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Thanx ALL....

      Author's profile photo Former Member
      Former Member

      Very Blog.

      Regards,

      Sushant

      Author's profile photo Ravi Chandra
      Ravi Chandra
      Blog Post Author

      Hi susanth,

      Very .... Blog.

      Pls fill up the blank.whether it is good or bad...

      🙂

      Author's profile photo Former Member
      Former Member

      I believe the technical names of the fields should be same , otherwise it will not work.

      🙂

      Author's profile photo Jalina Vincent
      Jalina Vincent

      Very good doc.

      Author's profile photo Former Member
      Former Member

      Hi Ravi,

      Nice doc thanks for sharing it to enhance our knowledge. 🙂

      Regards,

      Lalit

      Author's profile photo Akanksha Verma
      Akanksha Verma

      nicely explained, thanks

      Author's profile photo Anil K
      Anil K

      very nice explanation to understand clearly..looking forward for these kind of docs on ABAP.

      thanks