PARAMETERS: p_days TYPE i OBLIGATORY DEFAULT '90'.
START-OF-SELECTION.
DATA: last_date TYPE d.
DATA: it_users TYPE STANDARD TABLE OF usr02 WITH DEFAULT KEY.
DATA(lv_erdat) = sy-datum.
lv_erdat = lv_erdat - p_days.
* Dialognutzer ('A') lesen, die sich in den letzten x Tagen nicht angemeldet haben
SELECT * FROM usr02 INTO TABLE @it_users
WHERE ustyp = 'A'
AND trdat = '00000000'
AND erdat <= @lv_erdat.
IF sy-subrc = 0.
SORT: it_users BY bname.
WRITE: / |USER \| LAST LOGIN \| CREATED|.
ULINE.
LOOP AT it_users ASSIGNING FIELD-SYMBOL(<u>).
WRITE: / <u>-bname, '|', <u>-trdat, '|', <u>-erdat.
ENDLOOP.
ENDIF.