90days or 3months data from the date today

Hi,
I have problem on this query, I need to extract the customers that is on 90days or 3months in their subscription of the product from the date today. I know that the startdate field must be used on the condition but don't know the right formula. I have tried different condition but I'm not getting the exact data. I have tried this AND sysdate-startdate<=90 but this give me also customers with less 90 days into their subscription but I just need customers with exact 90days. While this one startdate=sysdate-90 doesn't give me results but there should be.
SELECT     
c.id,
i.firstname||i.name as Name,
to_char(c.startdate,'MM/DD/YYYY') as start_date,
to_char(c.enddate,'MM/DD/YYYY') as expire_date,
to_char(c.canceldate,'MM/DD/YYYY') as cancellation_date
FROM     customer c,
          info i
WHERE     i.id                     = s.id
AND sysdate-startdate<=90
AND c.enddate>=sysdate
AND c.cancellation_date >= sysdate
Thank you.

As David says, there's a hell of a difference between 3 months ago and 90 days ago.
SQL> ed
Wrote file afiedt.buf
  1  with t as (select trunc(sysdate,'YYYY') as start_date from dual)
  2      ,x as (select rownum rn from dual connect by rownum <= trunc(add_months(sysdate,12),'YYYY')-trunc(sysdate,'YYYY'))
  3  --
  4  select start_date+rn-1 as dt
  5        ,add_months(start_date+rn-1,-3) as "3_months_ago"
  6        ,start_date+rn-1-90 as "90_days_ago"
  7* from t,x
SQL> /
DT          3_months_ag 90_days_ago
01-Jan-2011 01-Oct-2010 03-Oct-2010
02-Jan-2011 02-Oct-2010 04-Oct-2010
03-Jan-2011 03-Oct-2010 05-Oct-2010
04-Jan-2011 04-Oct-2010 06-Oct-2010
05-Jan-2011 05-Oct-2010 07-Oct-2010
06-Jan-2011 06-Oct-2010 08-Oct-2010
07-Jan-2011 07-Oct-2010 09-Oct-2010
08-Jan-2011 08-Oct-2010 10-Oct-2010
09-Jan-2011 09-Oct-2010 11-Oct-2010
10-Jan-2011 10-Oct-2010 12-Oct-2010
11-Jan-2011 11-Oct-2010 13-Oct-2010
12-Jan-2011 12-Oct-2010 14-Oct-2010
13-Jan-2011 13-Oct-2010 15-Oct-2010
14-Jan-2011 14-Oct-2010 16-Oct-2010
15-Jan-2011 15-Oct-2010 17-Oct-2010
16-Jan-2011 16-Oct-2010 18-Oct-2010
17-Jan-2011 17-Oct-2010 19-Oct-2010
18-Jan-2011 18-Oct-2010 20-Oct-2010
19-Jan-2011 19-Oct-2010 21-Oct-2010
20-Jan-2011 20-Oct-2010 22-Oct-2010
21-Jan-2011 21-Oct-2010 23-Oct-2010
22-Jan-2011 22-Oct-2010 24-Oct-2010
23-Jan-2011 23-Oct-2010 25-Oct-2010
24-Jan-2011 24-Oct-2010 26-Oct-2010
25-Jan-2011 25-Oct-2010 27-Oct-2010
26-Jan-2011 26-Oct-2010 28-Oct-2010
27-Jan-2011 27-Oct-2010 29-Oct-2010
28-Jan-2011 28-Oct-2010 30-Oct-2010
29-Jan-2011 29-Oct-2010 31-Oct-2010
30-Jan-2011 30-Oct-2010 01-Nov-2010
31-Jan-2011 31-Oct-2010 02-Nov-2010
01-Feb-2011 01-Nov-2010 03-Nov-2010
02-Feb-2011 02-Nov-2010 04-Nov-2010
03-Feb-2011 03-Nov-2010 05-Nov-2010
04-Feb-2011 04-Nov-2010 06-Nov-2010
05-Feb-2011 05-Nov-2010 07-Nov-2010
06-Feb-2011 06-Nov-2010 08-Nov-2010
07-Feb-2011 07-Nov-2010 09-Nov-2010
08-Feb-2011 08-Nov-2010 10-Nov-2010
09-Feb-2011 09-Nov-2010 11-Nov-2010
10-Feb-2011 10-Nov-2010 12-Nov-2010
11-Feb-2011 11-Nov-2010 13-Nov-2010
12-Feb-2011 12-Nov-2010 14-Nov-2010
13-Feb-2011 13-Nov-2010 15-Nov-2010
14-Feb-2011 14-Nov-2010 16-Nov-2010
15-Feb-2011 15-Nov-2010 17-Nov-2010
16-Feb-2011 16-Nov-2010 18-Nov-2010
17-Feb-2011 17-Nov-2010 19-Nov-2010
18-Feb-2011 18-Nov-2010 20-Nov-2010
19-Feb-2011 19-Nov-2010 21-Nov-2010
20-Feb-2011 20-Nov-2010 22-Nov-2010
21-Feb-2011 21-Nov-2010 23-Nov-2010
22-Feb-2011 22-Nov-2010 24-Nov-2010
23-Feb-2011 23-Nov-2010 25-Nov-2010
24-Feb-2011 24-Nov-2010 26-Nov-2010
25-Feb-2011 25-Nov-2010 27-Nov-2010
26-Feb-2011 26-Nov-2010 28-Nov-2010
27-Feb-2011 27-Nov-2010 29-Nov-2010
28-Feb-2011 30-Nov-2010 30-Nov-2010
01-Mar-2011 01-Dec-2010 01-Dec-2010
02-Mar-2011 02-Dec-2010 02-Dec-2010
03-Mar-2011 03-Dec-2010 03-Dec-2010
04-Mar-2011 04-Dec-2010 04-Dec-2010
05-Mar-2011 05-Dec-2010 05-Dec-2010
06-Mar-2011 06-Dec-2010 06-Dec-2010
07-Mar-2011 07-Dec-2010 07-Dec-2010
08-Mar-2011 08-Dec-2010 08-Dec-2010
09-Mar-2011 09-Dec-2010 09-Dec-2010
10-Mar-2011 10-Dec-2010 10-Dec-2010
11-Mar-2011 11-Dec-2010 11-Dec-2010
12-Mar-2011 12-Dec-2010 12-Dec-2010
13-Mar-2011 13-Dec-2010 13-Dec-2010
14-Mar-2011 14-Dec-2010 14-Dec-2010
15-Mar-2011 15-Dec-2010 15-Dec-2010
16-Mar-2011 16-Dec-2010 16-Dec-2010
17-Mar-2011 17-Dec-2010 17-Dec-2010
18-Mar-2011 18-Dec-2010 18-Dec-2010
19-Mar-2011 19-Dec-2010 19-Dec-2010
20-Mar-2011 20-Dec-2010 20-Dec-2010
21-Mar-2011 21-Dec-2010 21-Dec-2010
22-Mar-2011 22-Dec-2010 22-Dec-2010
23-Mar-2011 23-Dec-2010 23-Dec-2010
24-Mar-2011 24-Dec-2010 24-Dec-2010
25-Mar-2011 25-Dec-2010 25-Dec-2010
26-Mar-2011 26-Dec-2010 26-Dec-2010
27-Mar-2011 27-Dec-2010 27-Dec-2010
28-Mar-2011 28-Dec-2010 28-Dec-2010
29-Mar-2011 29-Dec-2010 29-Dec-2010
30-Mar-2011 30-Dec-2010 30-Dec-2010
31-Mar-2011 31-Dec-2010 31-Dec-2010
01-Apr-2011 01-Jan-2011 01-Jan-2011
02-Apr-2011 02-Jan-2011 02-Jan-2011
03-Apr-2011 03-Jan-2011 03-Jan-2011
04-Apr-2011 04-Jan-2011 04-Jan-2011
05-Apr-2011 05-Jan-2011 05-Jan-2011
06-Apr-2011 06-Jan-2011 06-Jan-2011
07-Apr-2011 07-Jan-2011 07-Jan-2011
08-Apr-2011 08-Jan-2011 08-Jan-2011
09-Apr-2011 09-Jan-2011 09-Jan-2011
10-Apr-2011 10-Jan-2011 10-Jan-2011
11-Apr-2011 11-Jan-2011 11-Jan-2011
12-Apr-2011 12-Jan-2011 12-Jan-2011
13-Apr-2011 13-Jan-2011 13-Jan-2011
14-Apr-2011 14-Jan-2011 14-Jan-2011
15-Apr-2011 15-Jan-2011 15-Jan-2011
16-Apr-2011 16-Jan-2011 16-Jan-2011
17-Apr-2011 17-Jan-2011 17-Jan-2011
18-Apr-2011 18-Jan-2011 18-Jan-2011
19-Apr-2011 19-Jan-2011 19-Jan-2011
20-Apr-2011 20-Jan-2011 20-Jan-2011
21-Apr-2011 21-Jan-2011 21-Jan-2011
22-Apr-2011 22-Jan-2011 22-Jan-2011
23-Apr-2011 23-Jan-2011 23-Jan-2011
24-Apr-2011 24-Jan-2011 24-Jan-2011
25-Apr-2011 25-Jan-2011 25-Jan-2011
26-Apr-2011 26-Jan-2011 26-Jan-2011
27-Apr-2011 27-Jan-2011 27-Jan-2011
28-Apr-2011 28-Jan-2011 28-Jan-2011
29-Apr-2011 29-Jan-2011 29-Jan-2011
30-Apr-2011 31-Jan-2011 30-Jan-2011
01-May-2011 01-Feb-2011 31-Jan-2011
02-May-2011 02-Feb-2011 01-Feb-2011
03-May-2011 03-Feb-2011 02-Feb-2011
04-May-2011 04-Feb-2011 03-Feb-2011
05-May-2011 05-Feb-2011 04-Feb-2011
06-May-2011 06-Feb-2011 05-Feb-2011
07-May-2011 07-Feb-2011 06-Feb-2011
08-May-2011 08-Feb-2011 07-Feb-2011
09-May-2011 09-Feb-2011 08-Feb-2011
10-May-2011 10-Feb-2011 09-Feb-2011
11-May-2011 11-Feb-2011 10-Feb-2011
12-May-2011 12-Feb-2011 11-Feb-2011
13-May-2011 13-Feb-2011 12-Feb-2011
14-May-2011 14-Feb-2011 13-Feb-2011
15-May-2011 15-Feb-2011 14-Feb-2011
16-May-2011 16-Feb-2011 15-Feb-2011
17-May-2011 17-Feb-2011 16-Feb-2011
18-May-2011 18-Feb-2011 17-Feb-2011
19-May-2011 19-Feb-2011 18-Feb-2011
20-May-2011 20-Feb-2011 19-Feb-2011
21-May-2011 21-Feb-2011 20-Feb-2011
22-May-2011 22-Feb-2011 21-Feb-2011
23-May-2011 23-Feb-2011 22-Feb-2011
24-May-2011 24-Feb-2011 23-Feb-2011
25-May-2011 25-Feb-2011 24-Feb-2011
26-May-2011 26-Feb-2011 25-Feb-2011
27-May-2011 27-Feb-2011 26-Feb-2011
28-May-2011 28-Feb-2011 27-Feb-2011
29-May-2011 28-Feb-2011 28-Feb-2011
30-May-2011 28-Feb-2011 01-Mar-2011
31-May-2011 28-Feb-2011 02-Mar-2011
01-Jun-2011 01-Mar-2011 03-Mar-2011
02-Jun-2011 02-Mar-2011 04-Mar-2011
03-Jun-2011 03-Mar-2011 05-Mar-2011
04-Jun-2011 04-Mar-2011 06-Mar-2011
05-Jun-2011 05-Mar-2011 07-Mar-2011
06-Jun-2011 06-Mar-2011 08-Mar-2011
07-Jun-2011 07-Mar-2011 09-Mar-2011
08-Jun-2011 08-Mar-2011 10-Mar-2011
09-Jun-2011 09-Mar-2011 11-Mar-2011
10-Jun-2011 10-Mar-2011 12-Mar-2011
11-Jun-2011 11-Mar-2011 13-Mar-2011
12-Jun-2011 12-Mar-2011 14-Mar-2011
13-Jun-2011 13-Mar-2011 15-Mar-2011
14-Jun-2011 14-Mar-2011 16-Mar-2011
15-Jun-2011 15-Mar-2011 17-Mar-2011
16-Jun-2011 16-Mar-2011 18-Mar-2011
17-Jun-2011 17-Mar-2011 19-Mar-2011
18-Jun-2011 18-Mar-2011 20-Mar-2011
19-Jun-2011 19-Mar-2011 21-Mar-2011
20-Jun-2011 20-Mar-2011 22-Mar-2011
21-Jun-2011 21-Mar-2011 23-Mar-2011
22-Jun-2011 22-Mar-2011 24-Mar-2011
23-Jun-2011 23-Mar-2011 25-Mar-2011
24-Jun-2011 24-Mar-2011 26-Mar-2011
25-Jun-2011 25-Mar-2011 27-Mar-2011
26-Jun-2011 26-Mar-2011 28-Mar-2011
27-Jun-2011 27-Mar-2011 29-Mar-2011
28-Jun-2011 28-Mar-2011 30-Mar-2011
29-Jun-2011 29-Mar-2011 31-Mar-2011
30-Jun-2011 31-Mar-2011 01-Apr-2011
01-Jul-2011 01-Apr-2011 02-Apr-2011
02-Jul-2011 02-Apr-2011 03-Apr-2011
03-Jul-2011 03-Apr-2011 04-Apr-2011
04-Jul-2011 04-Apr-2011 05-Apr-2011
05-Jul-2011 05-Apr-2011 06-Apr-2011
06-Jul-2011 06-Apr-2011 07-Apr-2011
07-Jul-2011 07-Apr-2011 08-Apr-2011
08-Jul-2011 08-Apr-2011 09-Apr-2011
09-Jul-2011 09-Apr-2011 10-Apr-2011
10-Jul-2011 10-Apr-2011 11-Apr-2011
11-Jul-2011 11-Apr-2011 12-Apr-2011
12-Jul-2011 12-Apr-2011 13-Apr-2011
13-Jul-2011 13-Apr-2011 14-Apr-2011
14-Jul-2011 14-Apr-2011 15-Apr-2011
15-Jul-2011 15-Apr-2011 16-Apr-2011
16-Jul-2011 16-Apr-2011 17-Apr-2011
17-Jul-2011 17-Apr-2011 18-Apr-2011
18-Jul-2011 18-Apr-2011 19-Apr-2011
19-Jul-2011 19-Apr-2011 20-Apr-2011
20-Jul-2011 20-Apr-2011 21-Apr-2011
21-Jul-2011 21-Apr-2011 22-Apr-2011
22-Jul-2011 22-Apr-2011 23-Apr-2011
23-Jul-2011 23-Apr-2011 24-Apr-2011
24-Jul-2011 24-Apr-2011 25-Apr-2011
25-Jul-2011 25-Apr-2011 26-Apr-2011
26-Jul-2011 26-Apr-2011 27-Apr-2011
27-Jul-2011 27-Apr-2011 28-Apr-2011
28-Jul-2011 28-Apr-2011 29-Apr-2011
29-Jul-2011 29-Apr-2011 30-Apr-2011
30-Jul-2011 30-Apr-2011 01-May-2011
31-Jul-2011 30-Apr-2011 02-May-2011
01-Aug-2011 01-May-2011 03-May-2011
02-Aug-2011 02-May-2011 04-May-2011
03-Aug-2011 03-May-2011 05-May-2011
04-Aug-2011 04-May-2011 06-May-2011
05-Aug-2011 05-May-2011 07-May-2011
06-Aug-2011 06-May-2011 08-May-2011
07-Aug-2011 07-May-2011 09-May-2011
08-Aug-2011 08-May-2011 10-May-2011
09-Aug-2011 09-May-2011 11-May-2011
10-Aug-2011 10-May-2011 12-May-2011
11-Aug-2011 11-May-2011 13-May-2011
12-Aug-2011 12-May-2011 14-May-2011
13-Aug-2011 13-May-2011 15-May-2011
14-Aug-2011 14-May-2011 16-May-2011
15-Aug-2011 15-May-2011 17-May-2011
16-Aug-2011 16-May-2011 18-May-2011
17-Aug-2011 17-May-2011 19-May-2011
18-Aug-2011 18-May-2011 20-May-2011
19-Aug-2011 19-May-2011 21-May-2011
20-Aug-2011 20-May-2011 22-May-2011
21-Aug-2011 21-May-2011 23-May-2011
22-Aug-2011 22-May-2011 24-May-2011
23-Aug-2011 23-May-2011 25-May-2011
24-Aug-2011 24-May-2011 26-May-2011
25-Aug-2011 25-May-2011 27-May-2011
26-Aug-2011 26-May-2011 28-May-2011
27-Aug-2011 27-May-2011 29-May-2011
28-Aug-2011 28-May-2011 30-May-2011
29-Aug-2011 29-May-2011 31-May-2011
30-Aug-2011 30-May-2011 01-Jun-2011
31-Aug-2011 31-May-2011 02-Jun-2011
01-Sep-2011 01-Jun-2011 03-Jun-2011
02-Sep-2011 02-Jun-2011 04-Jun-2011
03-Sep-2011 03-Jun-2011 05-Jun-2011
04-Sep-2011 04-Jun-2011 06-Jun-2011
05-Sep-2011 05-Jun-2011 07-Jun-2011
06-Sep-2011 06-Jun-2011 08-Jun-2011
07-Sep-2011 07-Jun-2011 09-Jun-2011
08-Sep-2011 08-Jun-2011 10-Jun-2011
09-Sep-2011 09-Jun-2011 11-Jun-2011
10-Sep-2011 10-Jun-2011 12-Jun-2011
11-Sep-2011 11-Jun-2011 13-Jun-2011
12-Sep-2011 12-Jun-2011 14-Jun-2011
13-Sep-2011 13-Jun-2011 15-Jun-2011
14-Sep-2011 14-Jun-2011 16-Jun-2011
15-Sep-2011 15-Jun-2011 17-Jun-2011
16-Sep-2011 16-Jun-2011 18-Jun-2011
17-Sep-2011 17-Jun-2011 19-Jun-2011
18-Sep-2011 18-Jun-2011 20-Jun-2011
19-Sep-2011 19-Jun-2011 21-Jun-2011
20-Sep-2011 20-Jun-2011 22-Jun-2011
21-Sep-2011 21-Jun-2011 23-Jun-2011
22-Sep-2011 22-Jun-2011 24-Jun-2011
23-Sep-2011 23-Jun-2011 25-Jun-2011
24-Sep-2011 24-Jun-2011 26-Jun-2011
25-Sep-2011 25-Jun-2011 27-Jun-2011
26-Sep-2011 26-Jun-2011 28-Jun-2011
27-Sep-2011 27-Jun-2011 29-Jun-2011
28-Sep-2011 28-Jun-2011 30-Jun-2011
29-Sep-2011 29-Jun-2011 01-Jul-2011
30-Sep-2011 30-Jun-2011 02-Jul-2011
01-Oct-2011 01-Jul-2011 03-Jul-2011
02-Oct-2011 02-Jul-2011 04-Jul-2011
03-Oct-2011 03-Jul-2011 05-Jul-2011
04-Oct-2011 04-Jul-2011 06-Jul-2011
05-Oct-2011 05-Jul-2011 07-Jul-2011
06-Oct-2011 06-Jul-2011 08-Jul-2011
07-Oct-2011 07-Jul-2011 09-Jul-2011
08-Oct-2011 08-Jul-2011 10-Jul-2011
09-Oct-2011 09-Jul-2011 11-Jul-2011
10-Oct-2011 10-Jul-2011 12-Jul-2011
11-Oct-2011 11-Jul-2011 13-Jul-2011
12-Oct-2011 12-Jul-2011 14-Jul-2011
13-Oct-2011 13-Jul-2011 15-Jul-2011
14-Oct-2011 14-Jul-2011 16-Jul-2011
15-Oct-2011 15-Jul-2011 17-Jul-2011
16-Oct-2011 16-Jul-2011 18-Jul-2011
17-Oct-2011 17-Jul-2011 19-Jul-2011
18-Oct-2011 18-Jul-2011 20-Jul-2011
19-Oct-2011 19-Jul-2011 21-Jul-2011
20-Oct-2011 20-Jul-2011 22-Jul-2011
21-Oct-2011 21-Jul-2011 23-Jul-2011
22-Oct-2011 22-Jul-2011 24-Jul-2011
23-Oct-2011 23-Jul-2011 25-Jul-2011
24-Oct-2011 24-Jul-2011 26-Jul-2011
25-Oct-2011 25-Jul-2011 27-Jul-2011
26-Oct-2011 26-Jul-2011 28-Jul-2011
27-Oct-2011 27-Jul-2011 29-Jul-2011
28-Oct-2011 28-Jul-2011 30-Jul-2011
29-Oct-2011 29-Jul-2011 31-Jul-2011
30-Oct-2011 30-Jul-2011 01-Aug-2011
31-Oct-2011 31-Jul-2011 02-Aug-2011
01-Nov-2011 01-Aug-2011 03-Aug-2011
02-Nov-2011 02-Aug-2011 04-Aug-2011
03-Nov-2011 03-Aug-2011 05-Aug-2011
04-Nov-2011 04-Aug-2011 06-Aug-2011
05-Nov-2011 05-Aug-2011 07-Aug-2011
06-Nov-2011 06-Aug-2011 08-Aug-2011
07-Nov-2011 07-Aug-2011 09-Aug-2011
08-Nov-2011 08-Aug-2011 10-Aug-2011
09-Nov-2011 09-Aug-2011 11-Aug-2011
10-Nov-2011 10-Aug-2011 12-Aug-2011
11-Nov-2011 11-Aug-2011 13-Aug-2011
12-Nov-2011 12-Aug-2011 14-Aug-2011
13-Nov-2011 13-Aug-2011 15-Aug-2011
14-Nov-2011 14-Aug-2011 16-Aug-2011
15-Nov-2011 15-Aug-2011 17-Aug-2011
16-Nov-2011 16-Aug-2011 18-Aug-2011
17-Nov-2011 17-Aug-2011 19-Aug-2011
18-Nov-2011 18-Aug-2011 20-Aug-2011
19-Nov-2011 19-Aug-2011 21-Aug-2011
20-Nov-2011 20-Aug-2011 22-Aug-2011
21-Nov-2011 21-Aug-2011 23-Aug-2011
22-Nov-2011 22-Aug-2011 24-Aug-2011
23-Nov-2011 23-Aug-2011 25-Aug-2011
24-Nov-2011 24-Aug-2011 26-Aug-2011
25-Nov-2011 25-Aug-2011 27-Aug-2011
26-Nov-2011 26-Aug-2011 28-Aug-2011
27-Nov-2011 27-Aug-2011 29-Aug-2011
28-Nov-2011 28-Aug-2011 30-Aug-2011
29-Nov-2011 29-Aug-2011 31-Aug-2011
30-Nov-2011 31-Aug-2011 01-Sep-2011
01-Dec-2011 01-Sep-2011 02-Sep-2011
02-Dec-2011 02-Sep-2011 03-Sep-2011
03-Dec-2011 03-Sep-2011 04-Sep-2011
04-Dec-2011 04-Sep-2011 05-Sep-2011
05-Dec-2011 05-Sep-2011 06-Sep-2011
06-Dec-2011 06-Sep-2011 07-Sep-2011
07-Dec-2011 07-Sep-2011 08-Sep-2011
08-Dec-2011 08-Sep-2011 09-Sep-2011
09-Dec-2011 09-Sep-2011 10-Sep-2011
10-Dec-2011 10-Sep-2011 11-Sep-2011
11-Dec-2011 11-Sep-2011 12-Sep-2011
12-Dec-2011 12-Sep-2011 13-Sep-2011
13-Dec-2011 13-Sep-2011 14-Sep-2011
14-Dec-2011 14-Sep-2011 15-Sep-2011
15-Dec-2011 15-Sep-2011 16-Sep-2011
16-Dec-2011 16-Sep-2011 17-Sep-2011
17-Dec-2011 17-Sep-2011 18-Sep-2011
18-Dec-2011 18-Sep-2011 19-Sep-2011
19-Dec-2011 19-Sep-2011 20-Sep-2011
20-Dec-2011 20-Sep-2011 21-Sep-2011
21-Dec-2011 21-Sep-2011 22-Sep-2011
22-Dec-2011 22-Sep-2011 23-Sep-2011
23-Dec-2011 23-Sep-2011 24-Sep-2011
24-Dec-2011 24-Sep-2011 25-Sep-2011
25-Dec-2011 25-Sep-2011 26-Sep-2011
26-Dec-2011 26-Sep-2011 27-Sep-2011
27-Dec-2011 27-Sep-2011 28-Sep-2011
28-Dec-2011 28-Sep-2011 29-Sep-2011
29-Dec-2011 29-Sep-2011 30-Sep-2011
30-Dec-2011 30-Sep-2011 01-Oct-2011
31-Dec-2011 30-Sep-2011 02-Oct-2011
365 rows selected.
SQL>If you look at the dates around the end of May, 3 months ago stays at 28th Feb for 4 days, whilst 90 days ago is continually progressive.
Also, if you look at the dates around 29th and 30th November, then the 3 months ago misses the 30th August out (that's what David was talking about)
Depends what the actual requirements are, but if it's for a daily rolling window, I'd probably go for the 90 days version. If it's for months reports, I'd go for the monthly version.
Edited by: BluShadow on 11-Feb-2011 12:14

Similar Messages

  • I recently bought Macbook pro  and i don't how to download Mp3 from the internet browser. it's easy on PC as you how to clickright button on mouse and then chosse save link or file. any idea how to do this?

    Hi.
    I recenly bought Macbook and as I am new to Apple word I don't know anything about the OS.
    I was trying to download Mp3 from the internet today and I just could not. when I am using PC I just click the right button and save the link or file.
    Please help me. Any idea how to download MP3?

    I had been downloading from that site for many times but from PC. When I use the left button on mouse it will take me to the internet player on my PC but if I use the right button I have to choose 'save file as' and then I save it.
    But on MACbook when I use two fingers on my trackpad there is only few options like and one of them is 'save link as' but not 'save file as'

  • "...an error occurred while sending data from the iPhone" - caused by latest iPhone update today?

    I've been syncing my iPhone to my (non-apple) desktop for several months without difficulty.
    Today I accepted the latest upgrade to my iPhone software.
    Since it installed, it will not sync.
    It gives the error message "iTunes could not sync calendars to the iPhone "Steve's iPhone" because an error occurred while sending data from the iPhone."  After rebooting the desktop, the error repeats, and it's now in hour 2 of the continuing message "Syncing Steve's iPhone (Step 2 of 2) - Finishing sync"
    Has anyone else run into this Undocumented Feature of the latest upgrade?
    As bugs go, this is pretty serious for those of us who depend on syncing the iPhone and desktop for our business!
    Thanks to anyone who can help!
    Steve Callender

    Tried rebooting the phone, and now it works.
    Guess there's 2 lessons here -
    Boot again when installing new SW, even if the phone reboots itself during installation, and
    Boot to see if that fixes a problem before posting it.
    Steve

  • HT1657 If I download a movie today, but will not be watching it for a few weeks (i.e. when overseas) - when does the 'activation' period start?  Do I have 48 hours from the download date or when I first watch the movie?

    If I download a movie today, but will not be watching it for a few weeks (i.e. when overseas) - when does the 'activation' period start?  Do I have 48 hours from the download date or when I first watch the movie?

    You have 30 days from when you download it, but when you then start watching it you have 48 hours (24 if your account is US based) to finish watching it before it expires.

  • I got data, but i can't use the internet today from  my iphone 4

    i got data, but i can't use the internet today from my iphone 4
    it says "could not activate cellular data network
                you are not subscribed to a cellular data service"

    Hello - This isn't a response since I have the EXACT problem.  I paid "MyTechHelp" $100 because they said they could fix it and they couldn't.  I've narrowed my understanding to this:
    1.  The phone does not need to be jailbroken
    2.  Plug the phone into iTunes and back up the phone then restore and it will be Unlocked. I got a message from iTunes saying congratulations "your phone is unlocked"
    3.  Don't pay to unlock or jailbreak ..I wasted $200 already doing that
    4.  The APN needs to be reset to your carrier ... If I figure out how I'll respond soon
    5.  I tried unlockit.co.nz and that doesn't work

  • Everytime I try to update to iOS5 on my iPhone 4 I get an error containing 0xE while it is trying to backup data from the iPhone.  I have done everything suggested in Apple support.  How can I upgrade to iOS5 without losing all the data on my phone?

    Everytime I try to update to iOS5 on my iPhone 4 I get an error containing 0xE while it is backing up data from the iPhone before installing the new operating system.  I have done everything suggested in Apple support with no success.  I still get the error everytime (about 5 minutes into backing up iPhone data).  How can I upgrade to iOS5 without losing all the data on my iPhone (the error message says that if I continue I will lose all data on the phone)?  If I have already synced the phone before upgrading the OS, would I be able to restore my data after installing the new OS by syncing after the OS upgrade is complete?  Any help would be greatly appreciated. 

    I had the same problem today and was able to resolve it without having to do a restore or reset. The problem had something to do with my mail accounts. The upgrade reset my mail settings, switching both my gmail and my .mac mail to "archive all mail". I went into the General Settings, disabled that setting, and resynced the phone. The "other" storage allottment dropped back down to less than a gig.
    Before you restore or reset, I would try that first.

  • I have an iphone 4s that i got last week and i set it up just using the phone. today my dad restored it as my mothers iphone so i lost all of my data. I tried to restore it as my original phone i had but i exited out of itunes and now my phone wont showup

    I have an iphone 4s that i got last week and i set it up just using the phone. today my dad restored it as my mothers iphone so i lost all of my data. I tried to restore it as my original phone i had but i exited out of itunes and now my phone wont showup in itunes or on my computer

    Did you fail to import them to your computer before restoring?
    Not good.
    They are likely gone.
    You can try restoring from backup.

  • Is there any way so that I Being able to clear out old data from the Order

    Hi Friends,
    Is there any way so that I Being able to clear out old data from the Order Gate forecast, tolerance, and confirmed order to date tables on a monthly basis?
    Means I want data in data table for particular time (I want that if suppose today is 13-11-2008 then my data table must contain data from 13-10-2008 to 13-11-2008.
    Is it possible thru ABAP development or thru any t codes ?
    Any pointers will be rewarded.
    Regards

    hi,
    Before archiving you have to put the Deletion flag for the object(May be for PO, MMR etc as per your req.)...
    After that the you use the archiving procedure to archive the docs which are already flagged for deletion...
    For MMR you use the transaction SARA...and its respective object for the archiving....
    You can use the SDN search to see the many threads on it...
    Or use this link as per your req. and make the search...
    http://help.sap.com/saphelp_erp2004/helpdata/EN/75/ee0fa855c811d189900000e8322d00/frameset.htm
    Regards
    Priyanka.P

  • I wish to generate reports from the database an out put it but i need to enter a date from and to ina  html input box

    i wish to generate reports from the database an out put it
    but i need to enter a date from and to ina html input box
    in the input box a data of range will be input from a start
    to latest
    latest being the default as today's date.
    any help tips snipplets, concepts , turot=rails.
    thanks

    easycfm.com has tutorials for people who are brand new.
    If you don't know much about sql, I have heard good things
    about the book, Teach Yourself SQL in 10 Minutes by Ben
    Forta.

  • The attempt to read data from the server failed

    Today I was looking into an error with several IMAP accounts in Apple Mail:
    +The attempt to read data from the server "<<servername.tld>>" failed.+
    At first I thought this was an Apple Mail problem, as the accounts in question seemed to work just fine when not used in combination. One possible answer to this problem is rather short:
    Apple Mail uses IMAP caching, which uses more than 4 connections at the same time to the mail server. Some mail servers (like courier-imap in its default configuration) do not allow that much connections from the same IP address. The more accounts you are trying to connect to at the same time raises this number of connections. Meaning while you could probably check one account for new mails, the second will ultimately fail for no obvious reasons. The only solution to this problem is to raise the connections allowed by your IMAP server software. this solution only applies to people who have root access to their mail server.
    in courier-imap you have to edit /etc/courier-imap/imapd
    and change MAXPERIP=4 to a higher number (5 to 10 times the number of accounts you want to check simultaneously)
    and change MAXDAEMONS=40 to a higher number (with only one user 200 might work, whereas if you serve multiple users, something like 500 or higher might be better suited).
    of course increasing the numbers increases load on your server. this is why there are these restrictions in place.

    MY SOLUTION REPOSTED FROM ANOTHER THREAD:
    I've just solved a similar issue.
    I have a dedicated server running Plesk 9.5 and when I upgraded to iLife 11 and Snow Leopard this error appeared. I could quickly click "get mail" and I'd get all my mail, but only 3-4 of my 9 mail accounts would connect. Theo others would have the error:
    "The server error encountered was: The attempt to read data from the server..."
    I found solutions for those using IMAP mail:
    modify the /etc/courier-imap/imapd configuration file and change MAXDAEMONS from 40 to 80 and MAXPERIP from 4 to 40. This allows all the machines behind my home firewall to connect to multiple accounts on the e-mail server with mailbox caching enabled.
    I'd made this change on my server but it didn't seem to have any effect. It dawned on me that I'm using POP, not IMAP. So I found in /etc/courier-imap/pop3d the same settings. I changed the MAXDAEMONS from 40 to 80 and MAXPERIP from 4 to 40 and voila, all my connections concurrently worked.
    This has taken me more than two days to fix and I hope posting this helps someone else with the same issue.

  • How to dispaly datas from the table, base on the selection screen

    hi there gurus,
    im currently developing a stock aging report,
    i have completed one program but it do not allow me to excutes the program althought the syntax is correct.
    i would to get some ideas from you, regarding how to extract the datas from the tables?
    my selction screen will be, mat number, date, and gl account.
    and the out put datas are, mbew-matnr, makt-maktx, mbew-lbkum, mara_meins, mbew-salk3,and the consumptions for the past 12months and the values for it.
    can u plz guide me with this,
    thank you,.
    this is kind of very urgent program that i need to finish , plz help me.

    here is the total code the i do
    REPORT  ZSTK_AGING_REP2.
    *TABLES
    TABLES: mseg,
            mara,
            makt,
            SKAT,
            SKA1,
            MARV,
            T001,
            T030,
            T149D,
            AM07M,
            MCMSEG,
            T001K,
            T001W,
            T134M,
            vbak,
            mbew,
    mcon, rmcb0, marc, t024w,  mvke, v134w, t438a, propf, maprf, t000, t024e
    , tvko.
    DATA: BEGIN OF ta_material OCCURS 2,
           werks LIKE mard-werks,
           lgort LIKE mard-lgort,
           matnr LIKE mard-matnr,
           labst LIKE mard-labst,
           umlme LIKE mard-umlme,
           insme LIKE mard-insme,
           einme LIKE mard-einme,
           speme LIKE mard-speme,
           retme LIKE mard-retme,
           verpr LIKE mbew-verpr,
           maktx LIKE makt-maktx,
           meins LIKE mara-meins,
          bukrs LIKE t001-bukrs,
          konto LIKE t030-konts,
          butxt LIKE t001-butxt,
          txt50 LIKE skat-txt50,
          MABTR LIKE MCMSEG-DMBTR,
          SKBTR LIKE MCMSEG-DMBTR,
          WAERS LIKE T001-WAERS,
          WAER2 LIKE T001-WAERS,
          BWKEY LIKE MBEW-BWKEY,
          LBKUM LIKE MBEW-LBKUM,
         MEINS LIKE MARA-MEINS,
             SALK3 LIKE MBEW-SALK3,
             WAERS1 LIKE T001-WAERS,
             BUKRS1 LIKE T001-BUKRS,
             KONTO1 LIKE T030-KONTS,
            lbkum LIKE mbew-lbkum,
              erdat LIKE vbak-erdat,
          END OF ta_material.
    DATA: BEGIN OF ta_mseg OCCURS 2,
            mblnr LIKE mseg-mblnr,
    *->Begin of KL02+ -
            mjahr like mseg-mjahr,
            zeile like mseg-zeile,
    *->End of KL02+ -
            meins LIKE mseg-meins,
            menge LIKE mseg-menge,
            werks LIKE mseg-werks,
            lgort LIKE mseg-lgort,
            matnr LIKE mseg-matnr,
            budat LIKE mkpf-budat,
            saknr LIKE SKA1-SAKNR,
          END OF ta_mseg.
    single recs based on MATNR
    DATA: BEGIN OF i_matnr OCCURS 0,
            werks LIKE mard-werks,
            lgort LIKE mard-lgort,
            matnr LIKE mard-matnr,
            maktx LIKE makt-maktx,
            mblnr LIKE mseg-mblnr,
            verpr LIKE mbew-verpr,
            labst LIKE mard-labst,                    "Valuated stock with
    *unrestricted use
            umlme LIKE mard-umlme,                    "Stock in transfer
    *(from one storage location to another)
            insme LIKE mard-insme,                    "Stock in quality
    *inspection
            einme LIKE mard-einme,                    "Total Stock of All
    *Restricted Batches
            speme LIKE mard-speme,                    "Blocked stock
            retme LIKE mard-retme,                    "Blocked Stock Returns
            meins LIKE mara-meins,                    "base unit
          bukrs LIKE t001-bukrs,
          konto LIKE t030-konts,
          butxt LIKE t001-butxt,
          txt50 LIKE skat-txt50,
          MABTR LIKE MCMSEG-DMBTR,
          SKBTR LIKE MCMSEG-DMBTR,
          WAERS LIKE T001-WAERS,
          WAER2 LIKE T001-WAERS,
          BWKEY LIKE MBEW-BWKEY,
          LBKUM LIKE MBEW-LBKUM,
         MEINS LIKE MARA-MEINS,
             SALK3 LIKE MBEW-SALK3,
             WAERS1 LIKE T001-WAERS,
             BUKRS1 LIKE T001-BUKRS,
             KONTO1 LIKE T030-KONTS,
            lbkum LIKE mbew-lbkum,
           END OF i_matnr.
    recs based on MBLNR
    DATA: BEGIN OF i_mblnr OCCURS 0,
            mblnr LIKE mseg-mblnr,
            werks LIKE mseg-werks,
            lgort LIKE mseg-lgort,
            matnr LIKE mseg-matnr,
            menge LIKE mseg-menge,
            meint LIKE mseg-meins,
            budat LIKE mkpf-budat,
         bukrs LIKE t001-bukrs,
         konts LIKE t030-konts,
         butxt LIKE t001-butxt,
         txt50 LIKE skat-txt50,
         MABTR LIKE MCMSEG-DMBTR,
         SKBTR LIKE MCMSEG-DMBTR,
         WAERS LIKE T001-WAERS,
         WAER2 LIKE T001-WAERS,
         BWKEY LIKE MBEW-BWKEY,
          LBKUM LIKE MBEW-LBKUM,
         MEINS LIKE MARA-MEINS,
             SALK3 LIKE MBEW-SALK3,
             WAERS1 LIKE T001-WAERS,
             BUKRS1 LIKE T001-BUKRS,
             KONTO1 LIKE T030-KONTS,
           END OF i_mblnr.
    TYPES: BEGIN OF t_mat,
            lgort LIKE mseg-lgort,
            werks LIKE mseg-werks,
            matnr LIKE mseg-matnr,
            mblnr LIKE mseg-mblnr,
            maktx LIKE makt-maktx,
            meins LIKE mara-meins,
    meng0 LIKE mbew-lbkum,
    value0 LIKE mbew-salk3,
           meng0  LIKE mard-labst,                   "0 to 10 days
           value0 LIKE mseg-dmbtr,
           meng1  LIKE mard-labst,                   "11 to 30 days
           value1 LIKE mseg-dmbtr,
           meng2 LIKE mard-labst,                   "31 to 60 days
           value2 LIKE mseg-dmbtr,
           meng3 LIKE mard-labst,                   "61-90
           value3 LIKE mseg-dmbtr,
           meng4 LIKE mard-labst,                   "90 days onwards
           value4 LIKE mseg-dmbtr,
           END OF t_mat.
    DATA: i_mat2 TYPE t_mat OCCURS 0 WITH HEADER LINE.
    TYPES: BEGIN OF t_mat2,
            lgort LIKE mard-lgort,                    " storage location
            cnt0(5),
            cnt1(5),
            cnt2(5),
            cnt3(5),
            cnt4(5),
       meng0 LIKE mbew-lbkum,
    value0 LIKE mbew-salk3,
           meng0  LIKE mard-labst,                   "0 to 10 days
           value0 LIKE mseg-dmbtr,
           meng1  LIKE mard-labst,                   "11 to 30 days
           value1 LIKE mseg-dmbtr,
           meng2 LIKE mard-labst,                   "31 to 60 days
           value2 LIKE mseg-dmbtr,
           meng3 LIKE mard-labst,                   "61-90
           value3 LIKE mseg-dmbtr,
           meng4 LIKE mard-labst,                   "90 days onwards
           value4 LIKE mseg-dmbtr,
           END OF t_mat2.
    DATA: i_matsum TYPE t_mat2 OCCURS 0 WITH HEADER LINE.
    DATA:  w_mengb TYPE mbew-lbkum,
           w_workqyt TYPE mbew-lbkum,
           w_index TYPE sy-tabix,
    *DATA: w_mengb TYPE mard-labst,     "tmp Balance qty
         w_workqty TYPE mard-labst,   "Work qty
         w_index TYPE sy-tabix,
          w_days(5)  TYPE n,           "duration difference (days)
          w_mths(5)  TYPE n,           "duration difference (mths)
          w_dat1 TYPE sy-datum,        "date
          w_dat2 TYPE sy-datum,        "today's date
          w_detl(1) TYPE c,
          w_summ(1) TYPE c,
          w_denom TYPE i,
          w_numer TYPE i,
          w_conv TYPE i,
          w_ttlcnt TYPE i,
          w_cnt TYPE i,
          v_topofpage(1),
         w_meng LIKE mard-labst,
           w_meng LIKE mbew-lbkum,
    *sapscript values
          w_title(20) TYPE c.              "Summary / Detail Report
    DATA: lv_peinh LIKE mbew-peinh,  "Price Unit
          lv_verpr LIKE mbew-verpr.  "Moving Price
    proram comes here
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_werks FOR mseg-werks,
                    s_lgort FOR mseg-lgort,
                    s_matnr FOR mara-matnr,
                    s_saknr FOR ska1-saknr,
                    S_ERDAT FOR VBAK-ERDAT.
    PARAMETERS: pck_detl RADIOBUTTON GROUP rep1,
                pck_summ RADIOBUTTON GROUP rep1,
                pck_dtsm RADIOBUTTON GROUP rep1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK blk1.
    top of the page
      TOP-OF-PAGE.
      PERFORM  f_top_of_page.
      FORM f_top_of_page .
      IF v_topofpage = 'D'.
    *-->Report header for detail report
        WRITE:/2 'Printed By :', sy-uname,
               80 'Stock Aging Report - Detail',
               180 'Printed on:', sy-datum, sy-timlo,
               220 'Page:', sy-pagno.
        WRITE:/,/,/.
        WRITE:/2 'Storage',
               10 'Matl ID',
               22 'Matl Description',
               61 'UOM',
               78 '<--=<QTY ON THIS DATE -->',
              78 '<-- =< 10 days -->',
              112 '<--11 to 30 days -->',
              148 '<--31 to 60 days -->',
              181 '<--61 to 90 days -->',
              216 '<-- > 90 days -->',
               /2 'Location',
               76 'Qty',
               92 'Value'.
              112 'Qty',
              128 'Value',
              148 'Qty',
              164 'Value',
              181 'Qty',
              195 'Value',
              216 'Qty',
              231 'Value'.
        WRITE:/2 sy-uline(235).
      ELSE.
    *-->Report header for Summary report
        WRITE:/2 'Printed By :', sy-uname,
               80 'Stock Aging Report - Summary',
               180 'Printed on:', sy-datum, sy-timlo,
               220 'Page:', sy-pagno.
        WRITE:/,/,/.
        WRITE:/2 'Storage',
               10 'Matl ID',
               22 'Matl Description',
               61 'UOM',
               78 '<--< QTY ON THIS DATE -->',
              78 '<-- < 10 days -->',
              112 '<--11 to 30 days -->',
              148 '<--31 to 60 days -->',
              181 '<--61 to 90 days -->',
              216 '<-- > 90 days -->',
               /2 'Location',
               76 'Qty',
               92 'Value'.
              112 'Qty',
              128 'Value',
              148 'Qty',
              164 'Value',
              181 'Qty',
              195 'Value',
              216 'Qty',
              231 'Value'.
        WRITE:/2 sy-uline(235).
      ENDIF.
    ENDFORM.                    " f_top_of_page
    *start-of-selection
    *PERFOM f_data_selection.
    FORM f_data_selection.
      SELECT a~werks
             a~lgort
             a~matnr
            a~saknr
            a~lbkum
            a~erdat
            a~labst
             a~umlme
             a~insme
             a~einme
             a~speme
             a~retme
           b~verpr    "this field no long been used
             c~maktx
             d~meins
             INTO CORRESPONDING FIELDS OF TABLE ta_material
             FROM mard AS a
             INNER JOIN makt AS c ON amatnr = cmatnr
             INNER JOIN mara AS d ON amatnr = dmatnr
             WHERE a~matnr IN s_matnr
               AND a~werks IN s_werks
               AND a~lgort IN s_lgort
              AND a~saknr IN s_saknr
              AND a~erdat IN s_erdat
               AND c~spras = 'EN'.
    *--> SC01 - End  of Insertion **
    *-->Select material documents
      SELECT a~mblnr
            a~mjahr
            a~zeile
            a~meins
            a~menge
            a~werks
            a~lgort
            a~matnr
            b~budat
            INTO CORRESPONDING FIELDS OF TABLE ta_mseg
      FROM mseg AS a INNER JOIN mkpf AS b
      ON amblnr = bmblnr
      AND amjahr = bmjahr
      FOR ALL ENTRIES IN ta_material
      WHERE matnr = ta_material-matnr
      AND a~werks = ta_material-werks
      AND a~lgort = ta_material-lgort
      AND algort NE aumlgo
      AND a~shkzg = 'S'
      AND a~smbln EQ space
      AND a~smblp EQ space.
    *--> SC03 - Start of Insertion **
    If MBLNR exist in MSEG-SMBLN and this
    record's SHKZG = 'H'. Remove it from the table.
    This is becuase this particular record has already been reverse.
      LOOP AT ta_mseg.
        SELECT SINGLE *
                 FROM mseg
                WHERE smbln = ta_mseg-mblnr
    *->Begin of KL02+ -
                  and SMBLP = ta_mseg-zeile.
                 AND shkzg = 'H'.  "return.           " KL02-
    *->End of KL02+ -
        IF sy-subrc = 0.
          DELETE ta_mseg.
        ENDIF.
      ENDLOOP.
    *--> SC03 - Enf   of Insertion **
    ENDFORM.                    " f_data_selection
    *IMPORTANT , NEED TO CHECK LATER
    FORM f_data_preparation.
    *-->Append data for report details
      LOOP AT ta_material.
        DATA: ta_msegtemp LIKE ta_mseg OCCURS 2 WITH HEADER LINE.
    *-->Loop at all material documents into a temp table
        REFRESH ta_msegtemp. CLEAR ta_msegtemp.
        LOOP AT ta_mseg WHERE matnr = ta_material-matnr AND
                              werks = ta_material-werks AND
                              lgort = ta_material-lgort.
          ta_msegtemp = ta_mseg. APPEND ta_msegtemp.
        ENDLOOP.
    *-->Add up all the stock for the material
        CLEAR w_mengb.
        w_mengb = ta_material-labst +
                        ta_material-umlme +
                        ta_material-insme +
                        ta_material-einme +
                        ta_material-speme +
                        ta_material-retme.
        IF w_mengb IS INITIAL.
          CONTINUE.
        ENDIF.
    *-->sort msegtemp by posting date
        SORT ta_msegtemp BY budat DESCENDING.
    *-->get the values from the material documents into the report output
        LOOP AT ta_msegtemp.
    *->Begin of KL02- -
         CALL FUNCTION 'HRCM_TIME_PERIOD_CALCULATE'
           EXPORTING
             begda               = ta_msegtemp-budat
             endda               = sy-datum
           IMPORTING
            NOYRS               =
             nomns               = w_mths
             nodys               = w_days
          EXCEPTIONS
            invalid_dates       = 1
            overflow            = 2
            OTHERS              = 3
    *->End of KL02- -
    *->Begin of KL02+ -
    *-->Get the days difference btw two dates
          clear w_days.
          w_days = sy-datum - ta_msegtemp-budat.
    *--> Include today's date into calculation
          w_days = w_days + 1.
    *->End of KL02+ -
    check base unit, do conversion
          IF ta_material-meins <> ta_msegtemp-meins.
            CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
              EXPORTING
                i_matnr              = ta_material-matnr
                i_in_me              = ta_msegtemp-meins
                i_out_me             = ta_material-meins
                i_menge              = ta_msegtemp-menge
              IMPORTING
                e_menge              = ta_msegtemp-menge
              EXCEPTIONS
                error_in_application = 1
                error                = 2
                OTHERS               = 3.
          ENDIF.
    *--> SC01 - Start of Insertion **
          SELECT SINGLE peinh
                        verpr
                   INTO (lv_peinh,
                         lv_verpr)
                   FROM mbew
                  WHERE matnr = ta_material-matnr
                    AND bwkey = ta_material-werks.
          IF sy-subrc = 0.
            ta_material-verpr = lv_verpr.
          ENDIF.
    *--> SC01 - End   of Insertion **
    *-->check whether the mseg value is LE than the stock value
          IF ta_msegtemp-menge LE w_mengb.
    *-->Days < 10 days
            IF w_days  LE 1 AND w_days EQ 366.
              i_mat2-meng0 = i_mat2-meng0 + ta_msegtemp-menge.
              IF NOT lv_peinh EQ 0.
                i_mat2-value0 = ( i_mat2-meng0 / lv_peinh ) *
    ta_material-verpr."+SC01
              ENDIF.
    **-->Days 11 - 30 days
           ELSEIF w_days >= 11 AND w_days =< 30.
             i_mat2-meng1 = i_mat2-meng1 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value1 = ( i_mat2-meng1 / lv_peinh ) *
    *ta_material-verpr."+SC01
             ENDIF.
    **-->Days 31-60 days
           ELSEIF w_days >= 31 AND w_days =< 60.
             i_mat2-meng2 = i_mat2-meng2 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value2 = ( i_mat2-meng2 / lv_peinh ) *
    *ta_material-verpr."+SC01
             ENDIF.
    **-->Days 61-90 days
           ELSEIF w_days >= 61 AND w_days =< 90.
             i_mat2-meng3 = i_mat2-meng3 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value3 = ( i_mat2-meng3 / lv_peinh ) *
    *ta_material-verpr.
             ENDIF.
    **-->Days > 90 days
           ELSEIF w_days > 90.
             i_mat2-meng4 = i_mat2-meng4 + ta_msegtemp-menge.
             IF NOT lv_peinh EQ 0.
               i_mat2-value4 = ( i_mat2-meng4 / lv_peinh ) *
    *ta_material-verpr.
             ENDIF.
           ENDIF.
    *->End of KL002+
            w_mengb = w_mengb - ta_msegtemp-menge.
          ELSE.
            IF NOT w_mengb LE 0 .
                 IF NOT lv_peinh EQ 0.
    **->End of KL001+
                   i_mat2-value0 = ( i_mat2-meng0 / lv_peinh )
    *ta_material-verpr."+SC01
    **->Begin of KL001+
                 ENDIF.
               ELSEIF w_days GE 22.
                 i_mat2-meng3 = i_mat2-meng3 + w_mengb.
                 IF NOT lv_peinh EQ 0.
                   i_mat2-value3 = ( i_mat2-meng3 / lv_peinh )
    *ta_material-verpr.
                 ENDIF.
    **->End of KL001+
               ENDIF.
    **--> SC02 - End  of Insertioin **
           ENDIF.
    *->End of KL002-
    *->Begin of KL002+
    *--> < 10 days
                     IF w_days EQ 1 AND w_days LE 366.
              i_mat2-meng0 = i_mat2-meng0 + ta_msegtemp-menge.
              IF NOT lv_peinh EQ 0.
                i_mat2-value0 = ( i_mat2-meng0 / lv_peinh ) *
    ta_material-verpr."+SC01
              ENDIF.
             ELSEIF w_days >= 11 AND w_days =< 30.
               i_mat2-meng1 = i_mat2-meng1 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value1 = ( i_mat2-meng1 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
    **--> 31 - 60 days
             ELSEIF w_days >= 31 AND w_days =< 60.
               i_mat2-meng2 = i_mat2-meng2 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value2 = ( i_mat2-meng2 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
    **--> 61 - 90 days
             ELSEIF w_days >= 61 AND w_days =< 90.
               i_mat2-meng3 = i_mat2-meng3 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value3 = ( i_mat2-meng3 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
    **--> > 90 days
             ELSEIF w_days > 90.
               i_mat2-meng4 = i_mat2-meng4 + w_mengb.
               IF NOT lv_peinh EQ 0.
                 i_mat2-value4 = ( i_mat2-meng4 / lv_peinh ) *
    *ta_material-verpr.
               ENDIF.
              ENDIF.
    *->End of KL002+
              w_mengb = 0.
            ENDIF. " check stock value NE zero
          ENDIF.   "check Mat doc amount is LE than the stock value
    ENDIF.
        ENDLOOP. " msegtemp
    *-->append i_mat2 values
        i_mat2-werks = ta_material-werks.
        i_mat2-lgort = ta_material-lgort.
        i_mat2-matnr = ta_material-matnr.
        i_mat2-maktx = ta_material-maktx.
        i_mat2-meins = ta_material-meins.
        APPEND i_mat2. CLEAR i_mat2.
      ENDLOOP. " ta_material
    *-->Append data for summary data
      DATA: i_lgort LIKE i_mat2 OCCURS 2 WITH HEADER LINE.
      i_lgort[] = i_mat2[].
      SORT i_lgort BY werks lgort.
      DELETE ADJACENT DUPLICATES FROM i_lgort COMPARING werks lgort.
      DATA: v_cnt0(5), v_cnt1(5), v_cnt2(5), v_cnt3(5), v_cnt4(5),
            v_value0 LIKE i_matsum-value0.
           v_value1 LIKE i_matsum-value1,
           v_value2 LIKE i_matsum-value2,
           v_value3 LIKE i_matsum-value3,
           v_value4 LIKE i_matsum-value4.
      LOOP AT i_lgort.
        CLEAR v_cnt0. CLEAR v_value0.
      CLEAR v_cnt1. CLEAR v_value1.
       CLEAR v_cnt2. CLEAR v_value2.
       CLEAR v_cnt3. CLEAR v_value3.
       CLEAR v_cnt4. CLEAR v_value4.
        LOOP AT i_mat2 WHERE lgort = i_lgort-lgort AND
                             werks = i_lgort-werks.
          IF NOT i_mat2-meng0 IS INITIAL.
            v_cnt0 = v_cnt0 + 1.
            v_value0 = v_value0 + i_mat2-value0.
          ENDIF.
         IF NOT i_mat2-meng1 IS INITIAL.
           v_cnt1 = v_cnt1 + 1.
           v_value1 = v_value1 + i_mat2-value1.
         ENDIF.
         IF NOT i_mat2-meng2 IS INITIAL.
           v_cnt2 = v_cnt2 + 1.
           v_value2 = v_value2 + i_mat2-value2.
         ENDIF.
         IF NOT i_mat2-meng3 IS INITIAL.
           v_cnt3 = v_cnt3 + 1.
           v_value3 = v_value3 + i_mat2-value3.
         ENDIF.
         IF NOT i_mat2-meng4 IS INITIAL.
           v_cnt4 = v_cnt4 + 1.
           v_value4 = v_value4 + i_mat2-value4.
         ENDIF.
        ENDLOOP.
        CLEAR i_matsum.
        i_matsum-lgort = i_mat2-lgort.
        IF v_cnt0 NE space.
          i_matsum-cnt0 = v_cnt0.
          i_matsum-value0 = v_value0.
          APPEND i_matsum.
        ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt1 NE space.
         i_matsum-cnt1 = v_cnt1.
         i_matsum-value1 = v_value1.
         APPEND i_matsum.
       ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt2 NE space.
         i_matsum-cnt2 = v_cnt2.
         i_matsum-value2 = v_value2.
         APPEND i_matsum.
       ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt3 NE space.
         i_matsum-cnt3 = v_cnt3.
         i_matsum-value3 = v_value3.
         APPEND i_matsum.
       ENDIF.
       CLEAR i_matsum.
       i_matsum-lgort = i_mat2-lgort.
       IF v_cnt4 NE space.
         i_matsum-cnt4 = v_cnt4.
         i_matsum-value4 = v_value4.
         APPEND i_matsum.
       ENDIF.
      ENDLOOP.
    ENDFORM.                    "f_data_preparation
    *IMPORTANT , NEED TO CHECK LATER
    FORM f_display_data .
      IF pck_dtsm = 'X'.
    *-->Display detail
        v_topofpage = 'D'.
        PERFORM f_display_detail.
    *-->display summary
        v_topofpage = 'S'.
        NEW-PAGE.
        PERFORM f_display_summary.
      ELSEIF pck_detl = 'X'.
    *-->Display detail
        v_topofpage = 'D'.
        PERFORM f_display_detail.
      ELSEIF pck_summ = 'X'.
    *-->display summary
        v_topofpage = 'S'.
        PERFORM f_display_summary.
      ENDIF.
    ENDFORM.                    " f_display_data
    FORM f_display_detail .
      v_topofpage = 'D'.
      SORT i_mat2 BY werks lgort.
    *DATA: v_count(5),
    DATA: v_count,
            v_va1 LIKE i_mat2-value0.
           v_va2 LIKE i_mat2-value0,
           v_va3 LIKE i_mat2-value0,
           v_va4 LIKE i_mat2-value0,
           v_va5 LIKE i_mat2-value0.
      LOOP AT i_mat2.
        WRITE:/2 i_mat2-lgort,
              10 i_mat2-matnr,
              22 i_mat2-maktx(38),
              61 i_mat2-meins,
              64 i_mat2-meng0,
              82 i_mat2-value0.
             100 i_mat2-meng1,
             118 i_mat2-value1,
             136 i_mat2-meng2,
             154 i_mat2-value2,
             169 i_mat2-meng3,
             186 i_mat2-value3,
             204 i_mat2-meng4,
             222 i_mat2-value4.
    *-->Set counter and add up all values by lgort
        v_count = v_count + 1.
         v_va1 = v_va1 + i_mat2-value0.
       v_va2 = v_va2 + i_mat2-value1.
       v_va3 = v_va3 + i_mat2-value2.
       v_va4 = v_va4 + i_mat2-value3.
       v_va5 = v_va5 + i_mat2-value4.
        AT END OF lgort.
          WRITE:/10 'Cnt:',
                 15 v_count,
                 55 'Subtotal',
                 82 v_va1.
                118 v_va2,
                154 v_va3,
                186 v_va4,
                222 v_va5.
          CLEAR v_count. CLEAR v_va1.
         CLEAR v_va2. CLEAR v_va3. CLEAR v_va4. clear v_va5.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " f_display_detail
    FORM f_display_summary .
      v_topofpage = 'S'.
      LOOP AT i_matsum.
        IF NOT i_matsum-cnt0 IS INITIAL.
          WRITE:/2  i_matsum-lgort,
                 10 'Cnt:',15 i_matsum-cnt0,
                 82 i_matsum-value0.
        ENDIF.
       IF NOT i_matsum-cnt1 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:',15 i_matsum-cnt1,
                118 i_matsum-value1.
       ENDIF.
       IF NOT i_matsum-cnt2 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:',15 i_matsum-cnt2,
                154 i_matsum-value2.
       ENDIF.
       IF NOT i_matsum-cnt3 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:', 15 i_matsum-cnt3,
                186 i_matsum-value3.
       ENDIF.
       IF NOT i_matsum-cnt4 IS INITIAL.
         WRITE:/2  i_matsum-lgort,
                10 'Cnt:', 15 i_matsum-cnt4,
                222 i_matsum-value4.
       ENDIF.
      ENDLOOP.
    ENDFORM.                    " f_display_summary

  • How can I set the date today as default value in a parameter?

    Hi,
    I have in my report a date parameter and I want to set as default value the date today.
    How can I do this?
    Thanks in advance

    If you are using a datatemplate , you can have a beforereport trigger that will have a package call.
    In the package spec, define a date variable and also define the function beforereporttrigger that retruns boolean.
    In the body, define the beforereporttrigger function with
    begin
    select sysdate into specvariable from dual
    return(true);
    end;
    You can then use the variable in the datatemplate as :variable.
    Hope this helps.
    - Vasu -

  • Error 8 while loading the data from the souce system

    Hi Gurus
    Every day we are loading some data from one of our souce systems through process chain
    But today all the loads failed complaining about error 8 while extacting the data
    connection to source system is fine
    we have the problem while loading master data from the same source system
    any solution?
    Thanks in advance

    Hi,
    Check with basis team regarding any patches applied in source system or not ? If yes then replicate all data sources and activate again.
    hope it helps...
    regards,
    Raju

  • PR Deliv Date doesn't take from the Master data or Info Record

    Dear All,
    When i create a PR manualy by ME51N, the delivery date can always calculate from the planned delivery time in info record or Material master, but when the PR is generate from a Sales order, the delivery date always the date when the SO is created.
    Can anyone please advice me on this issue?
    Thank you very much,
    Regards,
    Chee Wee

    CW,
    You still have not mentioned the Planned delivery time in the two purchase requisitions (auto vs manual).  I will assume they are the same for now. Planned delivery time can be viewed in ME53N > select item; review item details, select 'quantities/dates' tab.  PDT is displayed, along with GRPT.  Let me know if they are dramatically different.
    It sounds like you are using SAP's "Individual Purchase Order" functionality.
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/dd/5601d4545a11d1a7020000e829fd11/frameset.htm
    If you are not, then it is probably a similar but customized functionality ('create PO automatic' is not typical unless you have an EDI relationship that needs this functionality).  No matter, the solution is probably the same..
    In this scenario, during Sales order entry, the system will normally propose a date to the order entry person, based on planned delivery time.  If this person does not 'fix' the date at that time, then the system will create a purchase requisition with a delivery date that matches the requirements date of the Sales order, regardless of Planned delivery time.   If the order entry person instead selects the 'Fix date qty flag' during order entry, the system will accept the standard Purchase Requisition scheduling (starting from today and including Planned Delivery time), and create a confirmation date in the Sales order that is consistent with the planned delivery time.  The confirmation date then becomes the requirements date for the Sales order.
    You can review the fix-date-qty flag in the sales order.  VA03 > select item > then Goto > item > schedule lines. The Fixed Date and Qty is a checkbox in the upper left hand side.  I am not in front of a system this evening, so I can't advise you if you change the flag and re-ATP the order, if the Purchase requisition will automatically be rescheduled.  If it is not, you should be able to first delete the PR, and then set the FDQ flag in the SD order/item to get the schedule dates you require.
    It is possible to have the fixed date quantity flag to be defaulted to 'set' if it meets with your business requirements.  OVZJ > Select Sales Org/Dist channel/division.  Set or unset as the default setting.  You can always change this flag manually within the sales doc, regardless of the default setting, so there is little danger here.
    Rgds,
    DB49

  • Filter a List for data from the Previous Month

    Hello,
    I have audit data for each month of the year.  At the beginning of one month I pull a report from the previous month.  I would like to have a view in my SharePoint list that shows only the data from the previous month.
    I am not a programmer or developer, so I was wondering if this is possible without out of the box tools.
    Here is what I have done so far:
    Created two calculated columns to find the start and end date of the previous month
              Previous Month Start =DATE(YEAR([Date of Review]),MONTH([Date of Review])-1,1)
              Previous Month End   =DATE(YEAR([Date of Review]),MONTH([Date of Review]),0)
    I have verified these two calculations do show the correct dates. 
    So I can generate the dates, but I don't know how to set up a view filter that will show only data from the previous month. 
    Please help.

    What you need is the calculated column to display the start and the end of the next month, not the previous month. Then you can do a view filter where Start<Today & End>Today.
    EX: If you have a document with date 15-03-2014, you need to save the dates 01-04-2014(start) and 30-04-2014(End).
    Then If Start < [Today] and End > [Today], you can show the document

Maybe you are looking for

  • "Error 7" LV 8.5

    I am receiving an "Error 7 occurred at Open File +.vipen File" while running a GUI. Typically if I have a problem like this, it is because one of my hard drives has lost connection. This is not the case this time. We have not changed anything that we

  • Please help me to resolve " No substitute cost center mainta

    We are working on SAP 4.6c version. In my project,HR and FI servers are different. I am facing a  issue which pertains to HR-FI -ALE Integration and that error is " No substitute cost center maintained" this error encountered when i am trying to do p

  • HELP : Convert socket programming from Ipv4 to IPv6

    Hi all, I need help in converting my Ipv4 socket programing to Ipv6. How can I do this? I already have an Ipv4 socket programming that is working but when I tried to convert it to Ipv6 it doesn't work . this is my Ipv4 socket programming : DatagramPa

  • No video memory. no memory acceleration for Intel HD graphics. what now?

    I did a quick double buffering on my pc with a Intel HD graphics (integrated with CPU) and works fine but jumpy and flickering a little. I run a check on the BufferedStrategy, BufferCapability and ImageCapability (code below), and found that no video

  • Slow as dirt

    I'm using CS5.5 on a 12 core MAC with 64 gb memory on a RAID 0 with Western Digital Black Caviar drives 2 TB.  The video is 1920x1080i my menus are photoshop layered and have never been an issue before, but this 12 core MAC is rendering the menus lik