CLASS lcl_vehicle DEFINITION.
PUBLIC SECTION.
METHODS get_average_fuel
IMPORTING im_distance TYPE s_distance
im_fuel TYPE s_capacity
RETURNING value(re_fuel) TYPE s_consum.
ENDCLASS.
DATA : r_veh1 TYPE REF TO lcl_vehicle,
r_veh2 TYPE REF TO lcl_vehicle,
avg_fuel TYPE s_consum.
...
avg_fuel =
r_veh1->get_average_fuel( im_distance = 500 im_fuel = '50.0')
+ r_veh2->get_average_fuel( im_distance =600 im_fuel = '60.0')
위의 Functional Method구문관련해서..
CLASS에서 선언된 METHOD는 Instance Method이므로 PUBLIC이나 PRIVATE이나
둘다 쓰여도 상관없다고 합니다.
그리하여 Functional Method사용시에
avg_fuel =
r_veh1->get_average_fuel( im_distance = 500 im_fuel = '50.0')
+ r_veh2->get_average_fuel( im_distance =600 im_fuel = '60.0')
(result = ref -> func_method_name)
을 쓴다고 알고 있습니다..
위구문의 전체적인 해석(ex) RETURNING이 왜 Functional Method에서 쓰이는지 등등)
관련해서 요청합니다....^^;;