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 Selection

Former Member
0 Likes
1,612

Dear friends,

How to select the record from BSEG table between Date range. Please give me the solution . Am also try to find the solution in SDN also.

select-options post_dt for bkpf-budat obligatory default sy-datum NO-EXTENSION.

select belnr budat from bkpf into corresponding fields of table it_head

where bukrs eq compcode

and gjahr eq year

and blart eq doctype

and budat in post_dt

order by belnr budat.

For this select query is working in perfect for single date only. But i want to select the date date range wise.

Thanks

Saravanan R

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,160

Remove NO-EXTENSION from select query beacuse it will suppress the upper limit and it work just as parameter.

select-options post_dt for bkpf-budat obligatory default sy-datum.

Provide the upper and the lower value data from BSEG table will be fetched according to range.

Regards,

Gurpreet

7 REPLIES 7
Read only

Former Member
0 Likes
1,161

Remove NO-EXTENSION from select query beacuse it will suppress the upper limit and it work just as parameter.

select-options post_dt for bkpf-budat obligatory default sy-datum.

Provide the upper and the lower value data from BSEG table will be fetched according to range.

Regards,

Gurpreet

Read only

Former Member
0 Likes
1,160

Hi:

just do like this

SELECT-OPTIONS post_dt FOR bkpf-budat OBLIGATORY DEFAULT sy-datum

NO-EXTENSION.

Regards

Shashi

Read only

0 Likes
1,160

Hi,,

I want how to check the select statement query

Read only

0 Likes
1,160

HI,

U can check the Select Quert by using IN s_option.

Like eg:--

Select * form Zemp where empno in s_empno.

Hope this example will help u...

here Zemp is a table...... empno is a field s_empno is a Select-option.

Thanks and rEgards

Suraj S Nair

Read only

0 Likes
1,160

Hi,

Your coding works fine and retrieves all records which satisfy WHERE clause. Check at your table level how many records you have for your condition and check with internal table content.

Regards,

Prasanth

Read only

Former Member
0 Likes
1,160

Hi,

Dont use No-Extention as this will enable ur selection option to act like a Parameter, as ur requrement is for Date range, do as per Gurpreets suggestion.

Read only

Former Member
0 Likes
1,160

hi,

With NO-extension the select-option works as a Parameter..... and its not as per ur requirement to have a range at selection.....

Thanks

Suraj