Advertisement
Kenzuke

Aufgabe 3 - 2017

Jan 26th, 2020
974
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 0.77 KB | None | 0 0
  1. DATA:
  2. wa_spfli type spfli,
  3. wa_sflight type sflight,
  4. wa_scarr type scarr,
  5. summe type i,
  6. anz_fluege type i,
  7. avg(4) type p DECIMALS 2.
  8.  
  9. select * from scarr into wa_scarr.
  10.   SELECT * FROM spfli INTO wa_spfli WHERE carrid = wa_scarr-carrid.
  11.     write:/ wa_scarr-carrid, wa_scarr-carrname, wa_spfli-connid, wa_spfli-cityfrom,wa_spfli-cityto.
  12.     SELECT * FROM sflight INTO wa_sflight WHERE carrid = wa_spfli-carrid AND connid = wa_spfli-connid.
  13.       anz_fluege = anz_fluege + 1.
  14.       summe = summe + wa_sflight-seatsocc.
  15.       write:/ wa_sflight-fldate, wa_sflight-price,wa_sflight-currency,wa_sflight-seatsocc.
  16.       ENDSELECT.
  17.       avg = summe / anz_fluege.
  18.       WRITE:/ anz_fluege. write:/ avg.
  19.       anz_fluege = 0.
  20.       summe = 0.
  21.       ENDSELECT.
  22.       ENDSELECT.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement