*&---------------------------------------------------------------------*
*& Report  ZZ_AUFGABE_Dynpro                                           *
*&---------------------------------------------------------------------*

REPORT  zz_aufgabe_Dynpro   .

DATA: wa_scarr TYPE scarr,
      wa_spfli type spfli,
      table_spfli TYPE STANDARD TABLE OF spfli ,
      wa_sflight TYPE sflight,
      idx TYPE i,
      wa_idx like idx,
      anz TYPE i,
      wa_anz like anz ,
      anz_pbo TYPE i ,
      anz_pai TYPE i .  

DATA: ok_code TYPE sy-ucomm,
      save_ok LIKE ok_code .

DATA: wa_mandt TYPE scarr-mandt,
      wa_carrid TYPE scarr-carrid,
      wa_carrname TYPE scarr-carrname,
      wa_currcode TYPE scarr-currcode,
      wa_url TYPE scarr-url,
      wa_connid type spfli-connid,
      wa_cityfrom type spfli-cityfrom,
      wa_cityto type spfli-cityto,
      wa_fltime type spfli-fltime .

PARAMETER: p_carrid TYPE scarr-carrid .

START-OF-SELECTION .

  anz = 0 .
  idx = 1 .

  SELECT SINGLE * FROM scarr INTO wa_scarr
         where carrid = p_carrid .

* Lesen in eine interne Tabelle
  SELECT *
     FROM   spfli
     INTO wa_spfli
     where carrid = p_carrid .
    anz = anz + 1 .
    APPEND wa_spfli TO table_spfli .
  ENDSELECT .

  wa_anz = anz .

* Dynpro-Felder der SCARR-Tabelle füllen






  CALL SCREEN 100.


*---------------------------------------------------------------------*
*  MODULE status_0100 OUTPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  anz_pbo = anz_pbo + 1 .
  SET PF-STATUS 'STATUS_100'.
  SET TITLEBAR '100'.

* Datensatz der Tabelle SPFLI aus der internen Tabelle
* für den Index idx lesen.
* Dynpro-Felder mit dem gelesenen Datensatz füllen





ENDMODULE.                    "status_0100 OUTPUT

*---------------------------------------------------------------------*
*  MODULE user_command_0100 INPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  anz_pai = anz_pai + 1 .
  save_ok = ok_code.
  CLEAR ok_code.
  
* Index-Zähler entsprechend der Aktion
* hoch oder herunter, auf den Anfang oder das Ende setzen.  
  CASE save_ok.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
      LEAVE PROGRAM.
    WHEN 'FIRST' .

    WHEN 'PREVIOUS' .

    WHEN 'NEXT' .
 
    WHEN 'LAST' .

*    WHEN OTHERS.
  ENDCASE.
ENDMODULE.                    "user_command_0100 INPUT