‎2007 Oct 29 11:15 AM
hi
i want to know how to write a select stament to pick only those records which belongs to recent date.
in mara one guy has inserted records wrongly i have to list all those recods which
belongs to recent date from the date field of the table mara.
regards
sami
‎2007 Oct 29 11:17 AM
hi,
without using any date, u cant take any record, u have to ask ur functional consultant, wat is the recent date?
regards
karthik
‎2007 Oct 29 11:19 AM
Hi sami,
Good!
If you know the date from which you want to retrieve then
SELECT * FROM MARA
INTO TABLE itab
Where ERSDA >= g_date ( from which date u want to filter)
Regards,
Sunil
‎2007 Oct 29 11:33 AM
i have to list the recent date records.
in the date fields so many dates will be there but i have to retrieve
only those freshly or recently entered recods in compare to todays date
‎2007 Oct 29 11:23 AM
Hi,
try this.
data: l_date type sy-datum.
l_date = sy-datum.
select * from vbak into lt_vbak where erdat LE sy-datum.
sort lt_vbak by erdat descending.
reward point if useful
Regards,
Niyaz
‎2007 Oct 29 11:28 AM
Hi Sami,
You can get the records corresponding to the particular date by using the Query:-
select * from Mara into table itab
where ERSDA like <particular date>
Reward if useful.
Regards,
Shilpi
‎2007 Oct 29 11:33 AM
hi,
use code for
Select * from Mara into it_mara.
endselect.
sort it_mara by ersda descending.
The very first record after sorting is your recent date.
take help from this code :
data : it_mara type STANDARD TABLE OF mara.
data : wa_mara type mara.
select * from mara into CORRESPONDING FIELDS OF TABLE it_mara.
sort it_mara by ersda DESCENDING.
loop at it_mara into wa_mara.
WRITE wa_mara-ersda.
WRITE wa_mara-matnr.
WRITE wa_mara-ernam.
WRITE / .
endloop.
Reward points, if helpful,
Sandeep Kaushik