‎2008 May 07 11:53 AM
Hi,
i want to write one select statement for getting the sales document numbers from vbak table where date from 1.02.2008 to 31.02.2008.
I have written code like this.
SELECT VBELN
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT-LOW = 'V_E_FDAY' AND ERDAT-HIGH = 'V_E_LDAY'.
it is showing error. please help me.(erdat field is there in the table vbak).How can i write the code
‎2008 May 07 11:59 AM
hi use
SELECT VBELN
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT between V_E_FDAY and V_E_LDAY.
if it_vbap is type vbak than use
SELECT *
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT between V_E_FDAY and V_E_LDAY.
reward if useful
‎2008 May 07 12:07 PM
Hi,
try this.
data : it_vbak type STANDARD TABLE OF VBAK.
PARAMETERS : V_E_FDAY TYPE SY-DATUM,
V_E_LDAY TYPE SY-DATUM.
SELECT *
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT >= V_E_FDAY
AND ERDAT <= V_E_LDAY.
Reward points if helpful..................
‎2008 May 07 12:09 PM
SELECT VBELN
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT IN (V_E_FDAY, V_E_LDAY).
If this doesn't work then let me know how you have defined V_E_FDAYand V_E_LDAY.
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers
‎2008 May 07 12:11 PM
define a select option with name input and internal table itab with a field of type vbeln. then
select vbeln from vbak into itab where date in input.
reward if it is helpful.
‎2008 May 07 12:11 PM
hi check this..
data: it_vbak type vbak occurs 0 with header line.
select-options: s_date for sy-datum.
SELECT VBELN
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT le s_date-low
AND ERDAT ge s_date-low
.
regards,
venkat
‎2008 May 07 12:12 PM
hi friend
try this one
SELECT VBELN
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT BETWEEN 'date1' AND 'date2'.
or
SELECT VBELN
FROM VBAK
INTO TABLE IT_VBAK
WHERE ERDAT >= 'date1'
AND Hkont <= 'date2'.
Reward points if helpfull
.