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: 

Retrieving Data

Former Member
0 Kudos

Hi,

I have to read a table itab in which if i give some date say 10.08.2008 time 11:00 am i want a record which is just before that record ...say 10.08.2008 time 10.30am record ( ITAB has got 100 records till date ).

Waiting for ur reply. ....

Regards

Srinath

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try this.

READ TABLE itab <your condition>

index = sy-tabix - 1.

READ TABLE INDEX index.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Try this.

READ TABLE itab <your condition>

index = sy-tabix - 1.

READ TABLE INDEX index.

naveen_inuganti2
Active Contributor
0 Kudos

Hi...


  data: tabix like sy-tabix.
  loop at itab.
   if date = your date.
     tabix = sy-tabix.
     exit.
   endif.
 endloop.

tabix = tabix - 1.

read table itab index tabix.

It should work.

Thanks,

Naveen.I

Former Member
0 Kudos

Hi Srinath,

Get the record with specified DATE and TIME.

Get its index.

Reduce the index by one.

Get the record with this index.


  READ ITAB ... WITH KEY DATE = ' ' TIME = ''.
  IF SY-SUBRC = 0.
    V_INDEX = SY-TABIX - 1.
    READ ITAB ... INDEX V_INDEX.
  ENDIF.

Regards,

R.Nagarajan.

-


We can -


Former Member
0 Kudos

Thanx All....