What is the main purpose of READ key word.

Showing Answers 1 - 12 of 12 Answers

sowjanya

  • Nov 22nd, 2007
 

Read statement is used to retreive only one record from internal table.
Note: While using read one should have all primary keys..otherwise subrc will fail.

  Was this answer useful?  Yes

SAP ABAP

  • Apr 28th, 2008
 

Hi,  I have mentioned the syntax also here with.. and various purpose of READ statement
Read an internal table
Syntax - READ TABLE itab FROM wa [additions].
           - READ TABLE itab WITH TABLE KEY k1 = v1 ...kn = vn [additions]. 
           - READ TABLE itab WITH KEY k1 = v1 ...kn = vn [BINARY SEARCH] [additions].
           - READ TABLE itab INDEX i [additions]. -
Obsolete Variants Read a program             - READ REPORT prog INTO itab.
Read text elements            -   READ TEXTPOOL prog ...INTO itab ...LANGUAGE lg.
 Read from a file           - READ DATASET dsn INTO f.
Read a database table            - READ TABLE dbtab.
Determine calendar information - In R/2: READ CALENDAR.

Read statement is used to read a single record with the loop...endloop.
Its an effective statement which reduce the unnecessary nested loops and helps in improving the performance of the program.
For EX: if you read the invoice header with the the invoice item records then you are avoiding one more loop with the line items ....

READ: Using read statement we can read data from one internal table to another internal table.

exp : IN program having 3 internal table.

         one for Header data.
         one for item data,
         one for final internal table.

using READ statement we can move first and second internal table into final internal table based on the key fields.

Regards,
R.Sankaran

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions