I have an internal table that is filled with 108 entries. From 9 to 9 entries it's repeating the entries and I wanted to delete those duplicates. Since they're exactly the same I used the delete adjacent duplicates from itab comparing all fields. Also tried without comparing all fields. No success.
If it helps, my table has 9 fields: bukrs, hkont, gjahr, belnr, budat, waers, shkzg, wrbtr, dmbtr and dmbe2. They're from BSIS and they're in this order too.
This is the DO loop in which is the SELECTenter code here. I've putted the DELETE outside of the DO loop.
The two first SELECT's are working fine and belong to the previous code that existed.
DO 12 TIMES.
lv_aux = lv_aux + 1.
lv_tamanho = STRLEN( lv_aux ).
IF lv_tamanho = 1.
CONCATENATE '0' lv_aux INTO lv_aux.
ENDIF.
CONCATENATE p_gjahr lv_aux '01' INTO z_v_first_day.
PERFORM get_last_day_of_month USING z_v_first_day
CHANGING lv_last_day.
" some other code irrelevant to the issue
SELECT bukrs hkont gjahr belnr budat waers shkzg dmbtr wrbtr dmbe2 FROM bsis
APPENDING CORRESPONDING FIELDS OF TABLE gt_bancbsis
WHERE hkont = '0051100001'
AND bukrs EQ p_bukrs
AND budat <= lv_last_day.
" some other code irrelevant to the issue
ENDDO.
DELETE ADJACENT DUPLICATES FROM gt_bancbsis COMPARING ALL FIELDS.
This is a picture of the internal table gt_bancbsis in the dubugger.
