*** SALDO DO CRÉDITO **********
EXPORTING
i_partner = <id_kunnr>
i_segment = ls_sgm-credit_sgmnt
IMPORTING
e_amount_l = l_amount.
ADD <total> TO l_amount.
*********** CALCULA EM PERCENTUAL SE ULTRAPASSOU O VALOR
CALL FUNCTION 'UKM_CALCULATE_EXPOSURE'
EXPORTING
i_credit_limit = ls_sgm-credit_limit
i_commitment = l_amount
IMPORTING
e_exposure_percent = l_exp_percent.
IF l_exp_percent > '99.9'.
***** LIMPA OBJETOS
FIELD-SYMBOLS <lo_check_worth> TYPE REF TO cl_ukm_credit_check_simu.
ASSIGN ('(SAPLUKM_CREDIT_WORTHINESS_SIMU)g_gui_check_worthiness')
TO <lo_check_worth>.
IF sy-subrc = 0.
FREE <lo_check_worth>.
ENDIF.
FIELD-SYMBOLS <lo_check_worth> TYPE REF TO cl_ukm_credit_check_simu.
ASSIGN ('(SAPLUKM_CREDIT_WORTHINESS_SIMU)g_gui_check_worthiness')
TO <lo_check_worth>.
IF sy-subrc = 0.
FREE <lo_check_worth>.
ENDIF.
*********** VERIFICA PARTIDAS EM ABERTO EM ATRASO
CALL FUNCTION 'UKM_CREDIT_CHECK_SIMU'
EXPORTING
i_partner = <id_kunnr>
i_segment = ls_sgm-credit_sgmnt
i_currency = 'BRL'
i_no_dialog = abap_true
IMPORTING
e_check_result = ls_check_result.
CHECK ls_check_result IS NOT INITIAL.
DATA(lt_denial) = ls_check_result-denial_reasons[].
CALL FUNCTION 'UKM_CREDIT_CHECK_SIMU'
EXPORTING
i_partner = <id_kunnr>
i_segment = ls_sgm-credit_sgmnt
i_currency = 'BRL'
i_no_dialog = abap_true
IMPORTING
e_check_result = ls_check_result.
CHECK ls_check_result IS NOT INITIAL.
DATA(lt_denial) = ls_check_result-denial_reasons[].
endif.
Nenhum comentário:
Postar um comentário