* event handler for checking and processing user input and
* for defining navigation
  TRANSLATE:
    wa1-cityfrom TO UPPER CASE,
    wa1-cityto   TO UPPER CASE.

  CALL METHOD application->check_date
    EXPORTING
      flug_input = wa1
      page       = page
    IMPORTING
      mess       = mess
      cursor     = cursor.
  CALL METHOD application->check_city
    EXPORTING
      flug_input = wa1
      page       = page
    IMPORTING
      mess       = mess
      cursor     = cursor.

* Auswahlliste von Zielort in Abhngigkeit von ausgewhltem Abflugort!
  IF cityfrom EQ 'Abflugort' .
    cursor  = 'cityfrom'.
    MESSAGE e002(zflug) WITH cityfrom
      INTO mess.
    page->messages->add_message(
      condition = cursor
      message = mess ).
*      message = 'Whlen Sie bitte einen Ablugort!' ).
    navigation->set_parameter( 'cursor' ).
  ENDIF.
* ob der Zielort gewhlt wird.
  IF cityto EQ 'Zielort' .
    cursor  = 'cityto'.
    page->messages->add_message(
      condition = cursor
      message = 'Whlen Sie bitte einen Zielort!' ).
    navigation->set_parameter( 'cursor' ).
  ENDIF.

  IF NOT mess IS INITIAL.
    navigation->set_parameter( 'cursor' ).
    navigation->set_parameter( 'wa1' ).
  ELSE.
    CASE event_id.
      WHEN 'find'.
        itab = application->get_flightlist_small( wa1 ).
* itab mit Daten ber Server-Cookie zwischenspeichern
        username = sy-uname.
        CALL METHOD cl_bsp_server_side_cookie=>set_server_cookie
          EXPORTING
            name                  = 'HALLO'
            application_name      = runtime->application_name
            application_namespace = runtime->application_namespace
            username              = username
            session_id            = runtime->session_id
            data_value            = itab
            data_name             = 'itab'
            expiry_time_rel       = 3600.

        navigation->set_parameter( 'wa1' ).
        navigation->goto_page( 'flights.htm' ) .
      WHEN 'exit'.
        navigation->exit( 'http://www.fh-augsburg.de' ).
    ENDCASE.
  ENDIF.

