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: 

date range

Former Member
0 Kudos
146

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

Former Member
0 Kudos
71
from_date = w_date - 120.

Rob

8 REPLIES 8

Former Member
0 Kudos
71

i think that you can use a function SUBTRACT_TIME_FROM_DATE,

regards

Former Member
0 Kudos
72
from_date = w_date - 120.

Rob

0 Kudos
71
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

0 Kudos
71

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

santhosh

0 Kudos
71

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

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

  adifferentvariablealtogether  = wdate-high - 120.

Regards,

Rich Heilman

0 Kudos
71

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

Regards,

Rich Heilman

0 Kudos
71

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