Skip to Content
0
Former Member
Jan 14, 2008 at 02:36 PM

on change of

17 Views

Hi,

i want to use on change of instead of AT NEW cause the itab-field blnr has n index and every time when this index changes the AT NEW command makes a group change and this is not correct. so i want to use the ON CHANGE OF command but i don't know how to use it correct.

-


DATA: BEGIN OF itab OCCURS 1000,

vtref TYPE dfkkop-vtref,

gpart TYPE dfkkop-gpart,

bukrs TYPE dfkkop-bukrs,

blnr TYPE dfkkop-xblnr,

n1 TYPE adrc-name1,

n2 TYPE adrc-name2,

n3 TYPE adrc-name3,

augst TYPE dfkkop-augst,

END OF itab.

LOOP AT itab.

AT NEW vtref.

CLEAR lf_merkblnr.

lf_merkblnr = itab-blnr .

CLEAR counter.

REFRESH wa_itab.

ENDAT.

IF itab-blnr(12) EQ lf_merkblnr(12).

counter = counter + 1.

APPEND itab TO wa_itab.

ENDIF.

AT END OF vtref.

IF counter LT 20.

DELETE itab WHERE vtref = itab-vtref.

ENDIF.

ENDAT.

ENDLOOP.

regards,

tobias