Methode get_flightlist

METHOD get_flightlist.

DATA: from TYPE bapisfldst,
to TYPE bapisfldst,
wa_date TYPE bapisfldra,
it_date TYPE TABLE OF bapisfldra,
ret_tab TYPE TABLE OF bapiret2.

from-city = cityfrom.
to-city = cityto.

IF datelow IS INITIAL AND datehigh IS INITIAL.
ELSEIF datelow IS INITIAL.
wa_date-option = 'BT'.
wa_date-sign = 'I'.
wa_date-low = '19000101'.
wa_date-high = datehigh.
APPEND wa_date TO it_date.
ELSEIF datehigh IS INITIAL.
wa_date-option = 'BT'.
wa_date-sign = 'I'.
wa_date-low = datelow.
wa_date-high = '20991231'.
APPEND wa_date TO it_date.
ELSE.
wa_date-option = 'BT'.
wa_date-sign = 'I'.
wa_date-low = datelow.
wa_date-high = datehigh.
APPEND wa_date TO it_date.
ENDIF.

CALL FUNCTION 'BAPI_FLIGHT_GETLIST'
EXPORTING
destination_from = from
destination_to = to
TABLES
date_range = it_date
flight_list = flightlist
return = ret_tab.

ENDMETHOD.