PARAMETERS: p_year TYPE gjahr .
AT SELECTION-SCREEN on VALUE-REQUEST FOR p_year .
TYPES: BEGIN OF ty_year ,
year TYPE gjahr,
END OF ty_year .
data: it_year TYPE STANDARD TABLE OF ty_year WITH HEADER LINE .
DATA: i_return TYPE ddshretval OCCURS 0 WITH HEADER LINE,
c TYPE c VALUE 'S',
year TYPE gjahr .
year = sy-datum+0(4) .
DO 50 TIMES.
it_year-year = year .
append it_year .
SUBTRACT 1 FROM year .
ENDDO.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_YEAR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'crid'
value_org = c
TABLES
value_tab = it_year
return_tab = i_return.
AT SELECTION-SCREEN on VALUE-REQUEST FOR p_year .
TYPES: BEGIN OF ty_year ,
year TYPE gjahr,
END OF ty_year .
data: it_year TYPE STANDARD TABLE OF ty_year WITH HEADER LINE .
DATA: i_return TYPE ddshretval OCCURS 0 WITH HEADER LINE,
c TYPE c VALUE 'S',
year TYPE gjahr .
year = sy-datum+0(4) .
DO 50 TIMES.
it_year-year = year .
append it_year .
SUBTRACT 1 FROM year .
ENDDO.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_YEAR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'crid'
value_org = c
TABLES
value_tab = it_year
return_tab = i_return.