Code:
DATA: g_year TYPE gjahr.
SELECT-OPTIONS: s_year FOR g_year.
...
SELECT ... FROM ...
WHERE left( aedat, 4 ) in @s_year[]
INTO TABLE ...
Ну или по старинке (идея: на основе селект-опшенсов для года сформировать селект-опшенсы для дат):
Code:
DATA: g_year TYPE gjahr.
SELECT-OPTIONS: s_year FOR g_year.
...
DATA: trange_date TYPE RANGE OF d.
DATA: range_date LIKE LINE OF trange_date.
FIELD-SYMBOLS: <year> LIKE s_year.
LOOP AT s_year ASSIGNING <year>.
MOVE-CORRESPONDING <year> TO range_date.
CONCATENATE range_date-low '0101' INTO range_date-low.
IF range_date-high = '0000'.
range_date-high(4) = range_date-low(4).
range_date-option = " тут нужно менять операции: EQ на BT и т.д., сходу все не припомню
ENDIF.
CONCATENATE range_date-high '1231' INTO range_date-high.
APPEND range_date TO trange_date.
ENDLOOP.
SELECT ... FROM ... INTO TABLE ...
WHERE aedat IN trange_date.