01-08-2018 6:27 PM
I need count the records from itab with various conditions , my itab is as below
cycle date
01 01/02/2010
02 04/01/2010
01 03/01/2010
03 06/01/2010
04 07/01/2010
02 04/01/2010
03 06/01/2010
01 01/02/2010
03 05/01/2016
02 04/01/2010
03 06/01/20107
for each cycle there will one or two dates , so i need count the records and display as below.
cycle date no records
01 01/02/2010 2
01 03/01/2010 1
02 04/01/2010 3
03 06/01/2010 3
03 05/01/2016 1
04 07/01/2010 1 I know AT NEW can be used , but not vey sure how it is useful in this scenarios.
Thanks for your inputs
NK
01-08-2018 6:36 PM
You could to sort your internal table by date field.. And to do something like:
loop at it_tab into ls_tab.
if ls_tab-date ne lv_date_old.
append initial line to it_out assigning field-symbol(<out>).
move-corresponding ls_tab to <out>.
endif.
add 1 to <out>-counter.
lv_date_old = ls_tab-date.
endloop.
01-08-2018 6:36 PM
You could to sort your internal table by date field.. And to do something like:
loop at it_tab into ls_tab.
if ls_tab-date ne lv_date_old.
append initial line to it_out assigning field-symbol(<out>).
move-corresponding ls_tab to <out>.
endif.
add 1 to <out>-counter.
lv_date_old = ls_tab-date.
endloop.
01-08-2018 6:41 PM
01-08-2018 6:42 PM
01-08-2018 6:43 PM
Would be nice to
01-08-2018 6:44 PM
01-08-2018 6:54 PM
01-09-2018 1:18 AM
01-09-2018 5:05 AM
01-09-2018 7:53 AM
You know that ON CHANGE OF has been obsolete for a very long time.? Why are you using obsolete code? What version of ABAP are you on - 2.1?