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

Reg: Date ranges

Former Member
0 Likes
519

Hi All,

there is a problem in date ranges

i need to fecth data based on create date and date on last change.

vbak-erdat is create date.

vbak-eadat is date on last change

for example

-i have created 2 sales orders yestday.

- today i created 2 sales orders .

-but i have modfiy yestdays sales orders also.

so i need to get today what have created and what i have modfiy data . so know it should get 4 sales orders.

code is like this....

select avbeln aerdat aeadat akunnr

bmatnr bwerks

into coressponding fields of table it_vbak

from vbak as a inner join vbap as b on avbeln = bvbeln

where a~vbeln in lr_vbeln and date ranges.

so how to write code for date range based on on create date and date on last change.

pls can you help me

thanks

mars

Hi All,

there is a problem in date ranges

i need to fecth data based on create date and date on last change.

vbak-erdat is create date.

vbak-eadat is date on last change

for example

-i have created 2 sales orders yestday.

- today i created 2 sales orders .

-but i have modfiy yestdays sales orders also.

so i need to get today what have created and what i have modfiy data . so know it should get 4 sales orders.

code is like this....

select avbeln aerdat aeadat akunnr

bmatnr bwerks

into coressponding fields of table it_vbak

from vbak as a inner join vbap as b on avbeln = bvbeln

where a~vbeln in lr_vbeln and date ranges.

so how to write code for date range based on on create date and date on last change.

pls can you help me

thanks

mars

2 REPLIES 2
Read only

Former Member
0 Likes
485

Hello Marreddy,

Do like this :

vbak-erdat is create date.

vbak-eadat is date on last change

select avbeln aerdat aeadat akunnr

bmatnr bwerks

into coressponding fields of table it_vbak

from vbak as a inner join vbap as b on avbeln = bvbeln

where avbeln in lr_vbeln and ( aerdat = sy-datum or a~eadat = sy-datum ) .

Thanks,

Greetson

Read only

naimesh_patel
Active Contributor
0 Likes
485

Try like:


select a~vbeln a~erdat a~eadat a~kunnr
b~matnr b~werks
into coressponding fields of table it_vbak
from vbak as a inner join vbap as b on a~vbeln = b~vbeln
where a~vbeln in lr_vbeln 
and ( a~erdat in S_date_range or a~eadat in s_date_range)    "<<

Regards,

Naimesh Patel