‎2006 May 16 10:12 AM
Hai guys,
I have date input(P_SYDATUM) field in screen.
I want to retrive records from LIKP table where fields LIKP-LFDAT < (P_SYDATUM - 3Days)
If my input date is 2006/05/02, i want to fetch records till 3days before date
(ie say 2006/04/29.)
how to do this. suggestion please.
Thanks.
Ambichan
‎2006 May 16 10:15 AM
Hi Ambi,
IN you code,
do this
v_date = p_sydatum - 3.
select *
from likp
into table itab
where
.
..
.
lfdat < v_date.
Regards,
Ravi
‎2006 May 16 10:16 AM
hi use this code
<b>prev_date = p_sydatum - 3.
select f1 f2 f3
from likp
into itab
where lfdat le prev_date.</b>
‎2006 May 16 10:17 AM
p_newdat = p_sydatum - 3.
selet * from likp into table it_likp where lfdat GE p_newdat and lfdat LT p_sydatu.
‎2006 May 16 10:17 AM
FORM GET_DATA.
SELECT VBELN
VBTYP
AUDAT
AUGRU
AUART
NETWR
WAERK FROM VBAK INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN AND VBTYP = P_VBTYP
AND ERDAT > '01.01.2004' AND NETWR > 0.
end formcheck the above code... replace the date field with variable which stores P_SYDATUM - 3Days
‎2006 May 16 10:23 AM
Hi Ambi,
parameter p_date type datum.
data: v_date type datum.
v_date = p_date - 3.
write: 'Entered date is ' ,p_date, 'Difference is' ,v_date.
V_Date gives the difference after 3 days.
U can use this V_Date in select statement to compare with LFDAT.
regards,
Kalyan