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 Statement

Former Member
0 Likes
1,089

Hi,

How to use READ statement to read the records lying in between two years..Can I use BETWEEN..?

Help needed.

Reg,

Prabakaran.S

11 REPLIES 11
Read only

Former Member
0 Likes
1,068

hi,

no you cant use like that ...you can use loop and endloop

with loop at table where condition....

Read only

Former Member
0 Likes
1,068

Hi,

I think you can not use READ statement with between or any other clause except WITH KEY.

May be you can use Loop Where.....or some other.

Hope this helps!!!

Regards,

Lalit

Read only

Former Member
0 Likes
1,068

Hi,

you better work with key value in the READ statement and put the value of the year in it.

For detail.

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

Regards,

Anirban

Read only

bpawanchand
Active Contributor
0 Likes
1,068

Hi

READ statement always reads only one single record from the internal table

Instead of that what you can do if write the READ statement in side a LOOP ...ENDLOOP.

Regards

Pavan

Read only

Former Member
0 Likes
1,068

hiiii

you can only use EQ with READ statement..for your requirement you can only use LOOP statement with condtition..not READ.

regards

twinkal

Read only

Former Member
0 Likes
1,068

hi,

With read table you can use either equal to value or index of the table. In your case you should make a loop and there use "in" with range type.

loop at i_table where field in r_values.

....

endloop.

/wg

Read only

Former Member
0 Likes
1,068

Hi,

loop the internal table which has the year records and in the where condition give the condition.

Read only

Former Member
0 Likes
1,068

Hi,

No...Use Loop and Endloop.

check the read statement..

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

Regards,

Omkaram.

Read only

Former Member
0 Likes
1,068

Hi Prabhakaran,

You cannot use BETWEEN with READ Statement.

You can try the following:

Loop at itab where <conditon>

endloop.

In the WHERE condition you can specify you date range.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,068

Hi,

There is no option in READ statement to use BETWEEN and WHERE conditions.

You can use LOOP AT .... WHERE .

Regards,

Rajitha.

Read only

Former Member
0 Likes
1,068

HI,

Try with this,

if Datefield GE ('DD/MM/YYYY')

and Datefield LE ('DD/MM/YYYY').

Read table

If sy-subrc <> 0.

error message

Endif.

endif.

Mohinder