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

Regarding Select Quirey

Former Member
0 Likes
717

Hi all,

I am having one issue,

In one table I am having the Orders Numbers along the date of creation.

In selection screen I have From and TO date.

1.I want to retrive the Order Numbers in Between From and to Date.

2.And another requirement is I want to retrive the order numbers prior to from

date,

I am not getting how to write the select quirey for these requirements.

Regards,

sarath

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
673

Hi

1.I want to retrive the Order Numbers in Between From and to Date.

<b>select VBELN ERDAT AUDAT from VBAK into table Itab where AEDAT in S_DATE.</b>

2.And another requirement is I want to retrive the order numbers prior to from

date.

<b>select VBELN ERDAT AUDAT from VBAK into table Itab

where AEDAT < S_DATE-low.</b>

Try this and see

<b>Reward points for useful Answers</b>

Regards

Anji

Hi

1.I want to retrive the Order Numbers in Between From and to Date.

<b>select VBELN ERDAT AUDAT from VBAK into table Itab where AEDAT in S_DATE.</b>

2.And another requirement is I want to retrive the order numbers prior to from

date.

<b>select VBELN ERDAT AUDAT from VBAK into table Itab

where AEDAT < S_DATE-low.</b>

Try this and see

<b>Reward points for useful Answers</b>

Regards

Anji

4 REPLIES 4
Read only

Former Member
0 Likes
674

Hi

1.I want to retrive the Order Numbers in Between From and to Date.

<b>select VBELN ERDAT AUDAT from VBAK into table Itab where AEDAT in S_DATE.</b>

2.And another requirement is I want to retrive the order numbers prior to from

date.

<b>select VBELN ERDAT AUDAT from VBAK into table Itab

where AEDAT < S_DATE-low.</b>

Try this and see

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
673

hi,

Select-options:s_date for vbak-erdat

select vbeln

from vbak

into table it_vbak

where vbeln in s_date.

Here i have taken sales order number as an example.

Read only

Former Member
0 Likes
673

hi

<b>1)</b>select Order Numbers from <ztable>

into itab

where ztable-date in s_range.

s_range is type date in selecy options

<b>2)</b>select Order Numbers from <ztable>

into itab

where ztable-date < (from date)

regards

ravish

reward if useful

Read only

Former Member
0 Likes
673

Hi,

use like this.

tables:mara.

SELECT-OPTIONS:s_date for mara-ersda.

data:BEGIN OF itab OCCURS 0,

matnr type mara-matnr,

ersda type mara-ersda,

END OF itab.

SELECT matnr ersda from mara into CORRESPONDING FIELDS OF TABLE itab where ersda in s_date.

sort itab by ersda.

loop at itab.

write:/ itab-matnr,itab-ersda.

endloop.

<b>reward if helpful</b>

rgds,

bharat.