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

pls help!!!

Former Member
0 Likes
327

Hi all,

My requirement is as follows.

select date : 01/01/2007

select no.of days : 5

output should display the records in the date range

01/01/2007 to 01/05/2007 similarly

if i give no.of days as 10 the output list should display the records in the range of 01/01/2007 to 01/10/2007

pls give a simple code..

thanks & regards,

mallika

2 REPLIES 2
Read only

Former Member
0 Likes
299

Hi,

Do like this

Parameters: p_date type sy-datum,

p_days type i.

Data: r_date type range of sy-datum,

r_date_line like line of r_date.

Before selecting the data

r_date_line-sign = 'I'.

r_date_line-option = 'BT'.

r_date_line-low = p_date.

r_date_line-high = p_date + p_days.

append r_date_line to r_date.

Now

Select * from DBTABLE into table ITAB were date in r_date.

Regards,

Satish

Read only

Former Member
0 Likes
299

parameters: sel_date type sy-datum,

no_days(8) type n.

data: filnaldate type sy-datum.

if no_days is not initial.

finaldate = no_days + sel_date.

endif.

now apply the logic to select data b/w sel_date and finaldate

reward points if its helpful