‎2007 May 15 2:23 PM
hi experts how can i filter records by month of given date. I use the given below statement. but it gives error message. Pls anyone give solution.
SELECT VBELN POSNR EDATU
FROM VBEP
INTO TABLE T_VBEP
WHERE EDATU+4(2) LE 3.
Thanks.
‎2007 May 15 2:26 PM
Hi
First fetch all records from table.
then in the loop seggregate the records.
SELECT VBELN POSNR EDATU
FROM VBEP
INTO TABLE T_VBEP.
loop at t_vbep.
if t_vbep- EDATU+4(2) gt 4.
delete t_vbep index sy-tabix.
endif.
endloop.
Reward points if useful
Regards
Anji
‎2007 May 15 2:26 PM
Hi
First fetch all records from table.
then in the loop seggregate the records.
SELECT VBELN POSNR EDATU
FROM VBEP
INTO TABLE T_VBEP.
loop at t_vbep.
if t_vbep- EDATU+4(2) gt 4.
delete t_vbep index sy-tabix.
endif.
endloop.
Reward points if useful
Regards
Anji
‎2007 May 15 2:27 PM
‎2007 May 15 2:27 PM
Within select query the condition like edatu+4(2) is not possible,so use within loop endloop.
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 15 2:28 PM
You can also do it this way...
DATA: MONTH_INI TYPE SY-DATUM,
MONTH_END TYPE SY-DATUM.
MONTH_INI = '20070501'.
MONTH_END = '20070531'.
SELECT VBELN POSNR EDATU
FROM VBEP
INTO TABLE T_VBEP
WHERE EDATU BETWEEN MONTH_INI AND MONTH_END.
Greetings,
Blag.
‎2007 May 15 2:29 PM
Hi..
SELECT VBELN POSNR EDATU
FROM VBEP
INTO TABLE T_VBEP.
*WHERE EDATU+4(2) LE 3. * remove this line.
<b>delete t_vbep where edatu+4(2) gt 3.</b>
‎2007 May 15 2:30 PM
parameter : s_date like sy-datum .
select vbeln posnr edatu from vbep into table t_vbep where edatu le s_date.
Girish
‎2007 May 15 2:38 PM
Like this:
SELECT vbeln posnr edatu
FROM vbep
INTO TABLE t_vbep
WHERE edatu LIKE '____03__'
OR edatu LIKE '____02__'
OR edatu LIKE '____01__'
OR edatu LIKE '____00__'.
Rob
‎2007 May 15 2:55 PM
parameter : <b>s_date LIKE T009B-POPER .</b>
data : begin_date like sy-datum , end_date like sy-datum.
call function module
G_POSTING_DATE_OF_PERIOD_GET
import parameters :
period = <b> s_date</b>
variant = '24' from the sap or else ask you fi consultant he will tell you the varaint of the period .
year = 2007
Export parameters
from_date = <b>begin_date</b>
to_date = <b>end_date .</b>
select vbeln posnr edatu from vbep into table t_vbep where <b>edatu between begin_date and end_date .</b>
i think this is what the exact technicality
Girish