‎2007 Jul 11 10:48 AM
Hi,
I have a date in my internal table i_tab and which i am using as for all entries for retrieving entries from table A016 which has two dates as datbi(Validity end date of the condition record) and datab(Validity start date of the condition record) and i need to fetch only those records from A016 which has date between ....validity period..
eg: if i have date 01.01.2006 in my i_tab
then only those records from A016 where start date and end date is having this 01.01.2006 in between..
whats the way out?
Regards
Gunjan
‎2007 Jul 11 10:51 AM
Hello,
DATA: itab LIKE a016 OCCURS 0 WITH HEADER LINE.
SELECT * FROM a016 INTO TABLE itab WHERE datab GE sy-datum AND datbi LE sy-datum.
Rewards if it helps.
Regards,
Deepu.k
‎2007 Jul 11 10:53 AM
Use in this format.
SELECT * FROM VBRK
INTO TABLE itab
WHERE FKDAT GE date1 AND
FDDAT LE date2.
or
DATA : i_vbrk type vbrk occurs 0.
select * from VBRK into table i_vbrk where
ERDAT GE date1 and
ERDAT LE date2 .
‎2007 Jul 11 10:55 AM
Hi,
Check this code:
CHECK I_TAB[] IS NOT INITIAL.
SELECT....
...
FROM A016
FOR ALL ENTRIES IN I_TAB
WHERE ...
AND DATBI GT I_TAB-DATE
AND DATAB LE I_TAB-DATE.
‎2007 Jul 11 11:14 AM
hi,
DATA: itab LIKE a016 OCCURS 0 WITH HEADER LINE.
parameters: datab like a016-datab,
datbi like a016-datbi.
select * from a016 into table itab where datab eq datab and datbi eq datbi.
if helpful reward some points.
with regards,
Suresh.A