‎2007 Oct 16 11:30 AM
Hi All
I have a internal table with fields and data as:
salesoffice, coordinator, invoicetype , invoice_dt, order_creation dt
london AA 001 26/01/2007 25/01/2007
london AA 001 23/01/2007 22/01/2007
london BB 003 11/01/2007 01/01/2007
I want the summarized report in this format
sales_office, coordinator, inv_type, wk1, wk2
london AA 001 2 0
BB 003 0 1
where wk1 is the diff between invoice_dt and order creation date. if the diff is <=7 it counts the number of records and put in wk1, simmilarly for wk2 i.e if diff is <=14.
if any body can help me with this that will be great.
cheers
AJ
‎2007 Oct 16 11:36 AM
1) define a data-el. type i wk1 and wk2 in another internal table ztab without invoice_dt and order_creation dt.
2) fill wk, wk2
z = invoice_dt - order_creation dt.
if z between 8 and 14.
wk2 = z.
elseif z le 7
wk1 = z.
endif.3) use collect command
A.
Message was edited by:
Andreas Mann
‎2007 Oct 16 11:41 AM
Hi AJ,
from your subject it is hard to guess what is your question.
you do not need fields wK1, wk2,...
use a field wk type integer.
and a count type integer value 1.
loop at the intarnal table and compute wk = ( invoice_dt - order_creation dt) div 7.
wk = 0 means <= 7 days, wk = 1 is <= 14 days and so on.
COLLECT the results, the count will add up accordingly.
Regards,
Clemens