2008 Aug 04 5:52 PM
Hello All,
I have to search record from the DB via date field in such a way that
suppose this mounth is aug. then i have to search all record created on aug
no matter in which year it was created.
Thanks
2008 Aug 04 8:50 PM
Try this way:
DATA: lt_vbak TYPE TABLE OF vbak,
lv_date(8) TYPE c.
lv_date = sy-datum.
lv_date(4) = '____'.
lv_date+6(2) = '__'.
SELECT * FROM vbak
INTO TABLE lt_vbak
WHERE erdat LIKE lv_date.
This will only return orders created in the current month regardless of day or year.
Regards,
Michael
2008 Aug 05 4:36 AM
Hi,
Check the code
DATA: T_flight TYPE TABLE OF SFLIGHT,
DATE TYPE SY-DATUM,
DATE_TEMP(2) TYPE C,
DATE_CHECK(8) type c.
DATE = SY-DATUM.
DATE_TEMP = DATE+4(2).
concatenate '____' DATE_TEMP '__' INTO DATE_CHECK.
"( 1st string consist of 4 underscore
" and 3rd string has 2 underscore,
" as _ is the escape char for single char in open SQL )
SELECT *
FROM SFLIGHT
INTO TABLE t_FLIGHT
WHERE FLDATE like DATE_CHECK.
Regards,
anirban
2008 Aug 05 12:48 PM
Hi,
While searching for record in select statement just compare months. like
select *
from <db table>
into table <itab>
where s_date4(2) eq db_field4(2).
where s_date in the date entered by you and db_field is the date field which you want to compare.
Hope this will give some idea,
Regards,
Aswini.