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

Dates range exclusion problem

Former Member
0 Likes
780

I have searched the forums for this, but could not get the answer.

My requirement:

There is a select option for dates: s_dates.

There is a variable which holds one date: lv_date.

Before i can use the s_dates in my select statement, i need to delete all the dates after lv_date.

My opinion:

Get all the dates using any FM: *date*, then delete the dates greater than lv_date.

But i am not convinced this is professional way.

Can anyone please suggest me a better way of doing this.

1 ACCEPTED SOLUTION
Read only

guilherme_frisoni
Contributor
0 Likes
740

Hi Naveen,

maybe a silly solution, but couldn't this just work as you need?

clear s_dates.

s_dates-sign = 'E'.

s_dates-option = 'GT'.

s_date-slow = lv_date

append s_dates.

Then use your s_dates normally in SELECT.

Give a try.

Regards,

Frisoni

3 REPLIES 3
Read only

Former Member
0 Likes
740

What *DATE* FM would you use to get all the dates? (There are a lot of both FMs and dates.)

Rob

Read only

guilherme_frisoni
Contributor
0 Likes
741

Hi Naveen,

maybe a silly solution, but couldn't this just work as you need?

clear s_dates.

s_dates-sign = 'E'.

s_dates-option = 'GT'.

s_date-slow = lv_date

append s_dates.

Then use your s_dates normally in SELECT.

Give a try.

Regards,

Frisoni

Read only

Former Member
0 Likes
740

Thanks Rob and Guilherme for responding.

Rob,

I was thinking of using the FM: DAY_ATTRIBUTES_GET, but this i could only use for the sign 'BT', for rest all i need to use if conditions to calculate.

Guilherme,


Yes, i had this thought, but was not sure, because the both conditions overlap.

But just tested it and it works. 



Thanks both of you for your time.