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 Date calculation

Former Member
0 Likes
678

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

5 REPLIES 5
Read only

Former Member
0 Likes
566

Hi Ambi,

IN you code,

do this

v_date = p_sydatum - 3.

select *

from likp

into table itab

where

.

..

.

lfdat < v_date.

Regards,

Ravi

Read only

Former Member
0 Likes
566

hi use this code

<b>prev_date = p_sydatum - 3.

select f1 f2 f3

from likp

into itab

where lfdat le prev_date.</b>

Read only

Former Member
0 Likes
566
p_newdat = p_sydatum - 3.

selet * from likp into table it_likp where lfdat GE p_newdat and lfdat LT p_sydatu.
Read only

rahulkavuri
Active Contributor
0 Likes
566
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 form

check the above code... replace the date field with variable which stores P_SYDATUM - 3Days

Read only

Former Member
0 Likes
566

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