03-23-2007 10:04 AM
Hi,
I need all the dates between two given dates in select-options .
For example the range in select-options is 01/01/2007 - 31/03/2007 .
I need all the dates between the two given dates .
How can i do this .Is there any FM for this ?
Regards,
Zia
03-23-2007 10:09 AM
use this
CSCP_PARA1_GET_PERIODS
data:begin of daytab occurs 0.
include structure scscp_period_str.
data:end of daytab.
call function 'CSCP_PARA1_GET_PERIODS'
exporting
i_datuv = r_budat-low
i_datub = r_budat-high
i_timeunit = 'D'
tables
et_dates = daytab.
here u have to put one more logic.
loop at daytab where datuv in r_budat.
endloop.
So u will get all the dates
Regards
prabhu
03-23-2007 10:09 AM
use this
CSCP_PARA1_GET_PERIODS
data:begin of daytab occurs 0.
include structure scscp_period_str.
data:end of daytab.
call function 'CSCP_PARA1_GET_PERIODS'
exporting
i_datuv = r_budat-low
i_datub = r_budat-high
i_timeunit = 'D'
tables
et_dates = daytab.
here u have to put one more logic.
loop at daytab where datuv in r_budat.
endloop.
So u will get all the dates
Regards
prabhu
03-23-2007 10:14 AM
03-23-2007 10:16 AM
hi dear
you can simply do this in abap coding
by just giving
if datfrom > datto in where condition of ur select program
reward points if useful
regards
amit singla
03-23-2007 10:17 AM
its better to do in while ---endwhile.
I am here giving u pseudocode
date1 = 01/01/2007.
date2 =- 31/03/2007
while date1 <= date2.
date1= date1 + 1.
endwhile.
here at each loop pass u get a different date which is less than date2.
Hence u can get all the dates between those two dates.
regards,
Sujatha.
Message was edited by:
Sujatha Reddy
03-23-2007 10:27 AM
Hi Shaik,
Plz check this out.
select-options: s_date for sy-datum.
s_date-low = '01/01/2007'.
s_date-sign = 'E'.
s_date-option = "EQ".
s_date-high = '31/03/2007'.
Regards,
Kiran B