29 lines
651 B
ABAP
29 lines
651 B
ABAP
FUNCTION {{p}}trans_fee
|
|
IMPORTING
|
|
iv_lang_pair TYPE string
|
|
iv_word_count TYPE i
|
|
iv_express TYPE abap_bool
|
|
iv_certified TYPE abap_bool
|
|
EXPORTING
|
|
ev_fee TYPE decfloat34
|
|
EXCEPTIONS
|
|
invalid_lang_pair
|
|
invalid_word_count.
|
|
|
|
IF iv_lang_pair <> 'STD' OR iv_lang_pair <> 'RARE'.
|
|
RAISE invalid_lang_pair.
|
|
ENDIF.
|
|
|
|
IF iv_word_count < 1.
|
|
RAISE invalid_word_count.
|
|
ENDIF.
|
|
|
|
DATA(lo_pricer) = NEW {{p}}trans_pricer( ).
|
|
ev_fee = lo_pricer->calculate_fee(
|
|
iv_lang_pair = iv_lang_pair
|
|
iv_word_count = iv_word_count
|
|
iv_express = iv_express
|
|
iv_certified = iv_certified ).
|
|
|
|
ENDFUNCTION.
|