‎2008 Jun 27 1:41 AM
Hi,
Could anybody explain me why we cant use logical expression like OR while reading the data from an Internal table using the following command?
READ TABLE itab INTO wa_itab WITH KEY f1 = 'AB' f2 = 'CD'.
Cheers
Mohan
‎2008 Jun 27 5:01 AM
Hi,
For Reading Internal We Can use Key Field Or Index Method.
So If You Read Internal Table By Keys Then,
Statement is
READ TABLE ITAB WITH KEY f1,
When We Read table by table index then,
READ TABLE ITAB INTO WA INDEX n.
This The Syntax.
Thanks.
Edited by: Sujit Pal on Jun 27, 2008 6:02 AM
Edited by: Sujit Pal on Jun 27, 2008 6:11 AM
‎2008 Jun 27 2:27 AM
Hi,
How have you defined your Internal table.
try like this
data: itab like STANDARD TABLE OF z_table_name WITH HEADER LINE.
Regards,
Nikhil
‎2008 Jun 27 3:57 AM
Hi Mohan,
I think it's the syntax of the Read table statement. But you can make a work around depending on your requirement. Hope this will help you.
Rewards if useful.
Regards,
Mark
‎2008 Jun 27 5:01 AM
Hi,
For Reading Internal We Can use Key Field Or Index Method.
So If You Read Internal Table By Keys Then,
Statement is
READ TABLE ITAB WITH KEY f1,
When We Read table by table index then,
READ TABLE ITAB INTO WA INDEX n.
This The Syntax.
Thanks.
Edited by: Sujit Pal on Jun 27, 2008 6:02 AM
Edited by: Sujit Pal on Jun 27, 2008 6:11 AM
‎2008 Jun 27 5:12 AM
Hi Mohan,
The concept of key in Internal table is not exactly as it in database table. They just refer a specific column is the form of a set of values representing the very row of internal table by which you may compare the values only.
We use logical operator for single value variables or field value of Database table only as they are unique. That's why the syntax of READ is framed in such a way that you won't get any scope to give Logical operator to them.
Reward if found helpful.
Anirban Bhattacharjee