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

HELP REQ IN SIMPLE CODE TO RETRIEVE DATA

Former Member
0 Likes
418

Hi all,

i need to retrieve data from an internal TABLE whose date field is multiple of 2 days behind from current date.

like todays date is 14/08/06

i need records of date 12/08/06,10/08/06,8/8/06,6/8/06,4/8/06 .....

any help would be appreciated

THANKS

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
393

Didn't sy-datum - 2 help?

~Suresh

2 REPLIES 2
Read only

suresh_datti
Active Contributor
0 Likes
394

Didn't sy-datum - 2 help?

~Suresh

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
393

You can use a range for this and build it on the fly. The only question is how far back do you want to go. I mean, how many dates to add to the range. Here I'm only adding 10.



report zrich_0001.

<b>ranges: r_datum for sy-datum.

r_datum-sign = 'I'.
r_datum-option = 'EQ'.
r_datum-low  = sy-datum.  append r_datum.
do 10 times.
  r_datum-low  = r_datum-low - 2.  append r_datum.
enddo.</b>


select .....
          <b>where datum in r_datum</b>.

Regards,

Rich Heilman