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: 

All Dates between two given Dates

shaik_zia
Explorer
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

Use FM

CSCP_PARA1_GET_PERIODS

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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