Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Date range!!

Former Member
0 Likes
1,107

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

4 REPLIES 4
Read only

Former Member
0 Likes
784

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

Read only

Former Member
0 Likes
784

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 .

Read only

Former Member
0 Likes
784

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.

Read only

Former Member
0 Likes
784

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