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

Date Range in ABAP Query

sridhar_muthekepalli3
Active Contributor
0 Likes
3,837

Dear Friends,

In the query, I have created, I want to select a date/Month/Year in select options.

The user must be able to select any month or any months from the current year or previous year or future year

Please suggest simple and easy abap code

Regards

Sridhar

Dear Friends,

In the query, I have created, I want to select a date/Month/Year in select options.

The user must be able to select any month or any months from the current year or previous year or future year

Please suggest simple and easy abap code

Regards

Sridhar

6 REPLIES 6
Read only

SachinArtani
Active Participant
0 Likes
2,631

Why don't you just use Select Options for date like this -

SELECT-OPTIONS s_date FOR sy-datum.

You can select as many dates as you want and select any month of any year you want.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,631

Sorry, I don't understand the question. Can you give more details?

Read only

Pavithra_madhu
Participant
0 Likes
2,631

To get date range this is the coding..

SELECT-OPTIONS : s_datum FOR sy-datum.

If it is not the answer please explain your problem clearly..

Read only

sridhar_muthekepalli3
Active Contributor
0 Likes
2,631

Dear Friends,

Thanks for all the answers

After the Query execution, I am getting single field only.

It should be in range , ex: 01.01.2019 to 31.12.2019 or 01.01.209 to 06.03.2019.

In the code section, it is showing as

1.Data

2. Intilization

3. At selection-screen output

4.Start-of-selection

5.Record of processing

6.End-of Selection (before List)

7.End-of-selection(List)

8.Top-of-page

9.At selection-screen

10.Free Code.

I am functional consultant. I am trying to do this myself and learn in the process.

Will appreciate, if you let me know, where to write the simple abap code,

Regards

Sridhar

Read only

0 Likes
2,631

You are using PARAMETERS instead of SELECT-OPTIONS as suggested above.
But this is really a basic question. Please consult the ABAP documentation first (Transaction ABAPDOCU)

Read only

sridhar_muthekepalli3
Active Contributor
0 Likes
2,631

Dear Friends,

I was able to display Date range in the selection screen.

Thanks for all ht help.

Regards

Sridhar