‎2009 Feb 24 2:10 PM
Hi,
i want to count number of PERMIT_NO date wise.
for Example.
Date PERMIT_NO
02.02.2009 3451
02.02.2009 3452
02.02.2009 3453
03.02.2009 3454
03.02.2009 3455
03.02.2009 3456
03.02.2009 3457
04.02.2009 3458
04.02.2009 3459
04.02.2009 3460
04.02.2009 3461
04.02.2009 3462
out put :
date count
02.02.2009 3
03.02.2009 4
04.02.2009 5
A m ore informative subject will get you more and better answers.
Edited by: Rob Burbank on Feb 24, 2009 11:22 AM
‎2009 Feb 25 12:22 PM
Hi Karthikeyan,
Have you checked my code.
It should work povided that if any fields are available before the date they should have the same value for
each date.
ie.
say for example your int tab contains fields and entries as below.
field1 Date PERMIT_NO
a 02.02.2009 3451
b 02.02.2009 3452
c 02.02.2009 3453.as the field 1 has different values at end of will be executed for each date and the count will be 1 only for each date.
in this case create another int tab with fields date and count and calculate the count using the same
logic.
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Feb 25, 2009 1:22 PM
‎2009 Feb 24 2:15 PM
Hi,
Below logic will give the count for each date.
SORT it_tab BY date.
LOOP AT it_tab INTO wa_tab.
ADD 1 TO w_count.
AT END OF date.
WRITE: / wa_tab-date, w_count. "If you need you can update this count in the int tab
CLEAR w_count.
ENDAT.
ENDLOOP.Hope this helps you.
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Feb 24, 2009 3:16 PM
‎2009 Feb 24 2:18 PM
Hi,
Use this logic.
Let me consider internal table name as DATE_COUNT having two fields DATE and PERMIT_NO.
For Output:
data counter type i value 0.
Loop at DATE_COUNT into workarea.
count = count + 1.
AT END OF DATE.
write: / workarea-date, counter.
counter = 0.
ENDAT.
ENDLOOP.
Thanks and Regards,
Suresh
‎2009 Feb 25 11:31 AM
Hi,
sorry its not giving correct answer.
the output will be like this.
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
03.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
‎2009 Feb 25 11:31 AM
Hi,
sorry its not giving correct answer.
the output will be like this.
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
02.01.2009 1
03.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
05.01.2009 1
‎2009 Feb 25 11:37 AM
hi,
sort itab by date.
data: cnt type i value 1.
loop at itab into wa_itab.
at end of date.
wrtie: wa_itab-date, cnt.
endat.
cnt = cnt + 1.
endloop.
Cheers,
Rudhir
‎2009 Feb 25 11:40 AM
Create an internal table with 2 fields: 1 for your date and 1 for a counter. Then simply collect your entries into that internal table.
types: begin of ty_dates,
date(10) type c,
count type i,
end of ty_dates.
data: it_dates type table of ty_dates,
wa_date type ty_dates.
loop at [your itab].
wa_dates-date = [your itab]-date.
wa_dates-count = 1.
collect wa_dates to it_dates.
endloop.
‎2009 Feb 25 12:22 PM
Hi Karthikeyan,
Have you checked my code.
It should work povided that if any fields are available before the date they should have the same value for
each date.
ie.
say for example your int tab contains fields and entries as below.
field1 Date PERMIT_NO
a 02.02.2009 3451
b 02.02.2009 3452
c 02.02.2009 3453.as the field 1 has different values at end of will be executed for each date and the count will be 1 only for each date.
in this case create another int tab with fields date and count and calculate the count using the same
logic.
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Feb 25, 2009 1:22 PM
‎2009 Feb 26 4:00 AM
Hi Manoj Kumar,
i got the output thank you so much.
Regards,
K.Karthikeyan.
‎2009 Feb 25 12:33 PM
Hi Karthick,
this may help..
data:
w_count type i.
loop at itab.
add 1 to count.
at end of date.
write:/ itab-date,
w_count.
w_count = 0.
endat.
endloop.
Regards,
Mdi.Deeba
‎2009 Feb 25 12:34 PM
Hi Karthikeyan,
Date PERMIT_NO
02.02.2009 3451
02.02.2009 3452
02.02.2009 3453
03.02.2009 3454
03.02.2009 3455
03.02.2009 3456
03.02.2009 3457
04.02.2009 3458
04.02.2009 3459
04.02.2009 3460
04.02.2009 3461
04.02.2009 3462
sort itab by date permit_no.
data: l_itab like itab ,
l_count type i .
loop at itab
move itab to l_itab.
i = i + 1.
at end of date.
write : \ 1(10) l_itab-date
13 i .
clear i.
endat.
endloop.
Regards,
Anil
‎2019 May 02 9:41 AM
I want this answer with full code..
Its urgent please help me..
Thank you..
‎2019 May 02 11:35 AM