‎2008 Dec 01 12:35 PM
Hi Guru's
i want to retrive data between two finish date and start date.
i write following code but this code work not properly.
select gltrp gstrp aufnr from afko into corresponding fields of table
itab1 where aufnr in orderno and gstrp in FINISHDT
and gltrp in STARTDT.
please suggest me.
Regard
sam.
‎2008 Dec 01 12:40 PM
Hi Sam
Do it like this:
and make sure you are also including date field in the selection and you ca ngive the date range in select option.
select gltrp gstrp aufnr gstrp from afko into corresponding fields of table
itab1 where aufnr in orderno and gstrp eq p_start and gltrp eq p_finish.
Regards
Neha
Edited by: Neha Shukla on Dec 1, 2008 6:12 PM
‎2008 Dec 01 12:37 PM
Hello,
begda -> begin date.
endda -> enddate.
where begda <= sy-datum
and endda >= sy-datum.
Above statement will fetch the data valid today.
Hope it helps.
Thanks,
Jayant
‎2008 Dec 01 12:39 PM
As you didnt tell how the two ranges table are filled no one can help you. I would suggest to take less then and reater then instead range tables.
‎2008 Dec 01 12:40 PM
Hi
Use BETWEEN in the WHERE clause
Hope this will solve your problem
Regards
Ramchander Rao.K
‎2008 Dec 01 12:40 PM
Hi Sam
Do it like this:
and make sure you are also including date field in the selection and you ca ngive the date range in select option.
select gltrp gstrp aufnr gstrp from afko into corresponding fields of table
itab1 where aufnr in orderno and gstrp eq p_start and gltrp eq p_finish.
Regards
Neha
Edited by: Neha Shukla on Dec 1, 2008 6:12 PM
‎2008 Dec 01 1:31 PM
first u get first and last date useing following FM
'FIRST_AND_LAST_DAY_IN_YEAR_GET'
‎2008 Dec 01 1:33 PM
select gltrp gstrp aufnr from afko into corresponding fields of table
itab1 where aufnr in orderno and (gstrp >= STARTD and gstrp <= FINISHDT).
Regards,
Ajay
‎2008 Dec 01 1:36 PM
Hi Sam,
Use BETWEEN in WHERE clause of your SELECT query.
select gltrp gstrp aufnr from afko into corresponding fields of table
itab1 where aufnr in orderno and gstrp between STARTDT and FINISHDT.With luck,
Pritam.