Application Development and Automation 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: 
Read only

read table query

former_member530652
Participant
7,680

READ TABLE it_583 WITH KEY pernr = pernr-pernr

begda <= month_end

endda >= month_begin.

i am getting error "=.." expected after "BEGDA"

i have changed le instead of <= and also ge instead of >=

but it's not working....

any idea how to deal with it??

6 REPLIES 6
Read only

Former Member
2,332

You can not use relational operator like GE LE with read query.

instead read you need to put a loop.

Regards,

Azad.

Read only

JozsefSzikszai
Active Contributor
2,332

hi,

READ TABLE works only with =

as a workaround you can use LOOP AT ...

LOOP AT it_583 INTO ...

WHERE pernr = pernr-pernr

begda <= month_end

endda >= month_begin.

...

ENDLOOP.

you ahve to be prepared that you could have more than one result.

hope this helps

ec

Read only

Former Member
2,332

You cannot use greater than equal to option in read table with key.

Have a look at sap help for this.

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/frameset.htm

Thanks,

Vibha

Read only

Former Member
0 Likes
2,332

Use LT and GT

Thanks

Read only

Former Member
0 Likes
2,332

This message was moderated.

Read only

Former Member
0 Likes
2,332

Hi,

When you are reading records from internal table using READ

You can use KEY or INDEX value only.

1. READ TABLE itab INDEX 1.

2. READ TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn [additions].

Regards,

Rajitha.