Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding REad Table Statement.

Former Member
0 Kudos

Can i have a Syntax like

Read Table itab into wa_tab with Key lifnr ne wa_final-lifnr.

Is this possible.

Thanx in Advance,

Murthy

1 ACCEPTED SOLUTION

former_member404244
Active Contributor
0 Kudos

Hi ramana,

u can't do like this.it won't allow u to compare NE ...

regards,

Nagaraj

7 REPLIES 7

former_member404244
Active Contributor
0 Kudos

Hi ramana,

u can't do like this.it won't allow u to compare NE ...

regards,

Nagaraj

Former Member
0 Kudos

Hi Ramana,

Read Statement only allows '=' logical operation.

Hope this helps.

Manish

gopi_narendra
Active Contributor
0 Kudos

No u can not do that inequality check in READ statement.

Regards

- Gopi

Former Member
0 Kudos

hi,

you should use for the key key_param = value

grtz

Koen

anversha_s
Active Contributor
0 Kudos

Hi,

adding to above.

Read table doesn't allow ne operator.

It reads only one record...Either by index or key.

READ TABLE MY_TAB INDEX 1.
 
READ TABLE MY_TAB WITH KEY CODE = 'ATG'.

these are the results for SY-SUBRC checks after read table

SY-SUBRC = 0:

An entry was read.

SY-TABIX is set to the index of the entry.

SY-SUBRC = 2:

An entry was read.

SY-TABIX is set to the index of the entry. This return code can only occur when you use the COMPARING addition. For further detauls, refer to the COMPARING section of the additions

SY-SUBRC = 4:

No entry was read.

The value of SY-TABIX depends on the table type and whether the BINARY SEARCH addition was specified.

If the table is a SORTED TABLE or a table sorted in ascending order of the type STANDARD TABLE with the BINARY SEARCH addition, SY-TABIX refers to the next-highest index.

Otherwise, SY-TABIX is undefined.

SY-SUBRC = 8:

No entry was read.

This return code only occurs with a SORTED TABLE or a STANDARD TABLE with the BINARY SEARCH addition. SY-TABIX is set to the number of all entries plus 1.

Reading records with keys

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm

Reading lines with Index

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3730358411d1829f0000e829fbfe/content.htm

rgds

Anver

if hlped pls mark points

Former Member
0 Kudos

hi ramana

try like this

loop at itab into wa_itab where lifnr ne ...

iam not sure...but i hope it works

Former Member
0 Kudos

use looping insted of read .

loop at itab where lifnr ne '01' .

endloop .