I am creating a presentation at work going over ABAP code. I did some excercises and I…
- User
I am creating a presentation at work going over ABAP code. I did some excercises and I wrote some ABAP code and I want to Explan all ABAP syntax for each Exercise.
- Page 3 &--------------------------------------------------------------------- *& Report zb_005_car &--------------------------------------------------------------------- *& &--------------------------------------------------------------------- REPORT zb_005_car.
TYPES: BEGIN OF str_car, brand(40) TYPE c, model(40) TYPE c, mileage TYPE i, fueltank_cap TYPE i, fuel_efficiency(6) TYPE c, END OF str_car.
DATA coolcar TYPE str_car.
*Page 4 coolcar-brand = 'Mercedes'. coolcar-model = 'SLR'. coolcar-mileage = '10254'. coolcar-fueltank_cap = '70'.
WRITE: / 'Brand: ', coolcar-brand, / 'Model: ', coolcar-model, / 'Mileage: ', coolcar-mileage, / 'Fuel-Tank Capacity: ', coolcar-fueltank_cap.
*Page 5 PARAMETERS: trip_f TYPE i, trip_m TYPE i, country TYPE c.
DATA result TYPE f.
*Page 6 CASE country. WHEN 'G'. result = trip_f / ( trip_m / 100 ). WRITE result TO coolcar-fuel_efficiency EXPONENT 0. WRITE: / 'Brand: ', coolcar-brand, / 'Model: ', coolcar-model, / 'Mileage: ', coolcar-mileage, ' km', / 'Fuel-Tank Capacity: ', coolcar-fueltank_cap, ' liters', / 'Results: ', coolcar-fuel_efficiency, '1/100km'. WHEN 'U'. result = trip_f / ( trip_m / 100 ). WRITE result TO coolcar-fuel_efficiency EXPONENT 0. WRITE: / 'Brand: ', coolcar-brand, / 'Model: ', coolcar-model, / 'Mileage: ', coolcar-mileage, ' miles', / 'Fuel-Tank Capacity: ', coolcar-fueltank_cap, ' gallons', / 'Results: ', coolcar-fuel_efficiency, 'mpg'. ENDCASE.
and this is the second program excersise.
&--------------------------------------------------------------------- *& Report zb_005_flights &--------------------------------------------------------------------- *& &--------------------------------------------------------------------- REPORT zb_005_flights.
DATA it_flights TYPE TABLE OF spfli. DATA wa_flight TYPE spfli.
SELECT * FROM spfli INTO TABLE it_flights.
LOOP AT it_flights INTO wa_flight. WRITE:/ wa_flight-connid, wa_flight-cityfrom, wa_flight-countryfr, wa_flight-cityto, wa_flight-countryto. ENDLOOP.
*Page 7 IF sy-subrc = 0. LOOP AT it_flights INTO wa_flight. WRITE:/ wa_flight-connid, wa_flight-cityfrom, wa_flight-countryfr, wa_flight-cityto, wa_flight-countryto. ENDLOOP. ELSE. WRITE: 'The SQL Statement was not executed successfully. Please try again later.'. ENDIF.
*Page 11 &--------------------------------------------------------------------- *& Report zb_005_preson &--------------------------------------------------------------------- *& &--------------------------------------------------------------------- REPORT zb_005_preson.
- Assistant