‎2006 Mar 15 3:41 AM
Hi,
I want to select data from BKPF depending upon the date range given in the selection screen.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
" Selection Criteria
SELECT-OPTIONS : S_DATE FOR SY-DATUM OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK B1.
How do I do that??.. Please help.
Thank You,
SB.
‎2006 Mar 15 3:44 AM
HI SB,
Create Indexes and select the data ...
i.e,
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
" Selection Criteria
<b>SELECT-OPTIONS : S_DATE FOR BKPF-BLDAT OBLIGATORY.</b>
SELECTION-SCREEN : END OF BLOCK B1.
<b> SELECT * FROM BKPF WHERE BLDAT IN s_date.</b>
Regards,
Santosh P
Message was edited by: Santosh Kumar Patha
‎2006 Mar 15 3:44 AM
TABLES: BKPF.
DATA itab LIKE TABLE OF bkpf WITH HEADER LINE.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
" Selection Criteria
SELECT-OPTIONS : S_DATE FOR <b>BKPF-BLDAT</b> OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK B1.
<b>SELECT *
FROM BKPF
INTO TABLE itab
WHERE BLDAT IN s_date.</b>
‎2006 Mar 15 3:44 AM
HI SB,
Create Indexes and select the data ...
i.e,
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
" Selection Criteria
<b>SELECT-OPTIONS : S_DATE FOR BKPF-BLDAT OBLIGATORY.</b>
SELECTION-SCREEN : END OF BLOCK B1.
<b> SELECT * FROM BKPF WHERE BLDAT IN s_date.</b>
Regards,
Santosh P
Message was edited by: Santosh Kumar Patha
‎2006 Mar 15 3:50 AM
Hi SB,
Santhosh is right.. An INDEX will be very useful if you are not using the key fields BUKRS,BELNR & GJAHR in the WHERE clause and just want to SELECT by BLDAT (Document date) or BUDAT (Posting Date).
Regards,
Suresh Datti
‎2006 Mar 15 3:51 AM
Hi,
But will this selection select all the dates in the "from" date "to" date & between date ranges also ??
Thank You,
SB.
‎2006 Mar 15 3:52 AM
‎2006 Mar 15 3:54 AM
Yes,
In the selection screen enter the date from and to in the field.
It will retrieve all the results.
‎2006 Mar 15 4:01 AM
‎2006 Mar 15 3:49 AM
hi SB,
data : itab like table of bkpf with header line.
tables :bkpf.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
" Selection Criteria
SELECT-OPTIONS : S_DATE FOR bkpf-bldat OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK B1.
select * from bkbf
into table itab
where bldat in s_date.regards
satesh
‎2006 Mar 15 3:55 AM
hi Sb,
yes..it will select ..
if you want to select only either one of them ..
use
select * from bkpf into table itab where bldat eq s_date-low.simliarly s_date-high.
regards
satesh
‎2006 Mar 15 3:56 AM
Hi,
Declare internal table of BKPF.
In select statement compare the date in select-option with BUDAT .
select * from BKPF into where budat in S_date.
I think this will help u out....
Thanks,
Sreevani
‎2006 Mar 15 2:13 PM
There's no need to create an index. There already is one on budat. If you construct your select properly, you'll be able to use it.
Rob