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

date range

Former Member
0 Likes
1,041

Hi folks,

here is the scenario..

SELECT-OPTIONS wdate FOR SY-DATUM.

suppose I enter the date range as 7/11/05 (wdate-low) and 7/17/05 (end date - wdate-high)

w_date = wdate-high.

  • write: 'the current date', w_date.

write: w_date to to_date ddmmyy.

I need to determine the from_date which is 120 days subtracted from the to_date in this case it should be

4/17/2005

How should I be doing that?

thanks

Santhosh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
966
from_date = w_date - 120.

Rob

8 REPLIES 8
Read only

Former Member
0 Likes
966

i think that you can use a function SUBTRACT_TIME_FROM_DATE,

regards

Read only

Former Member
0 Likes
967
from_date = w_date - 120.

Rob

Read only

0 Likes
966
select-options wdate for sy-datum.

at selection-screen output.

  read table wdate index 1.
  wdate-low = wdate-high - 120.
  modify wdate index 1.

Regards,

Rich Heilman

Read only

0 Likes
966

This is giving a very different value. it is not working.

santhosh

Read only

0 Likes
966

Rich,

I do not want the from_date value i.e 120 days subtracted from high value within the select options but I need to store that value in a different variable altogether.

Santhosh

Read only

0 Likes
966
data: adifferentvariablealtogether type sy-datum.
select-options wdate for sy-datum.
 
at selection-screen .

  adifferentvariablealtogether  = wdate-high - 120.

Regards,

Rich Heilman

Read only

0 Likes
966

By the way, 120 days from 07/17/2005 is 03/19/2005 not in April.

Regards,

Rich Heilman

Read only

0 Likes
966

Hi ,

Try using the Function <b>DATE_IN_FUTURE</b>

set the parameter ANZAHL_TAGE to -120 (for number of days ) and IMPORT_DATUM as the to date.

in this case you will have to pass the date in external format .

another Function is <b>CALCULATE_DATE</b>in which you can pass the date in the internal format.

Regards

Arun

Message was edited by: Arun Ramachandran