FUNCTION {{p}}ski_rental_old IMPORTING iv_equipment TYPE string iv_days TYPE i iv_customer TYPE string iv_insurance TYPE abap_bool EXPORTING ev_price TYPE decfloat34 ev_deposit TYPE decfloat34 EXCEPTIONS invalid_equipment invalid_days invalid_customer. DATA lv_daily TYPE decfloat34. DATA lv_discount TYPE decfloat34. DATA lv_total TYPE decfloat34. DATA lv_duration_disc TYPE decfloat34. IF iv_days < 1. RAISE invalid_days. ENDIF. IF iv_equipment = 'SKI'. lv_daily = 25. ELSEIF iv_equipment = 'SNOWBOARD'. lv_daily = 30. ELSEIF iv_equipment = 'BOOTS'. lv_daily = 10. ELSEIF iv_equipment = 'HELMET'. lv_daily = 5. ELSE. RAISE invalid_equipment. ENDIF. IF iv_customer = 'ADULT'. lv_discount = 0. ELSEIF iv_customer = 'CHILD'. lv_discount = 50. ELSEIF iv_customer = 'SENIOR'. lv_discount = 20. ELSE. RAISE invalid_customer. ENDIF. lv_total = lv_daily * iv_days. lv_total = lv_total - lv_total * lv_discount / 100. IF iv_days >= 7. lv_duration_disc = 10. ELSEIF iv_days >= 3. lv_duration_disc = 5. ELSE. lv_duration_disc = 0. ENDIF. lv_total = lv_total - lv_total * lv_duration_disc / 100. IF iv_insurance = abap_true. lv_total = lv_total + 5 * iv_days. ENDIF. ev_price = round( val = lv_total dec = 2 mode = cl_abap_math=>round_half_up ). IF iv_equipment = 'SKI'. ev_deposit = 100. ELSEIF iv_equipment = 'SNOWBOARD'. ev_deposit = 120. ELSEIF iv_equipment = 'BOOTS'. ev_deposit = 20. ELSEIF iv_equipment = 'HELMET'. ev_deposit = 10. ENDIF. IF iv_insurance = abap_true. ev_deposit = ev_deposit + 50. ENDIF. ENDFUNCTION.