BAPI_SALESORDER_CREATEFROMDAT2 銷售訂單建立 使用手工定價時 價格KBETR 欄位 自動乘以10
BAPI_SALESORDER_CREATEFROMDAT2
跟蹤程式發現: 當WAERS 為空時,價格會自動乘以10.
IF NOT ex_konvkom-waers IS INITIAL.
* Annahme: Feld COND_VALUE enthält Währungsmenge
IF NOT conditions_in-cond_value IS INITIAL.
CLEAR ex_konvkom-kbetr.
CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_INTERN_9'
EXPORTING
currency = ex_konvkom-waers
amount_external = conditions_in-cond_value
max_number_of_digits = digits_11
IMPORTING
amount_internal = ex_konvkom-kbetr
return = gs_return.
IF NOT gs_return IS INITIAL.
MOVE-CORRESPONDING gs_return TO return.
return-id = gs_return-code(2).
return-number = gs_return-code+2(3).
return-parameter = 'CONDITIONS_IN'.
return-row = sy-tabix.
return-field = 'COND_VALUE'.
APPEND return.
CLEAR return.
ENDIF.
ENDIF.
ELSE.
* Annahme: Feld COND_VALUE enthält Prozentwert
IF NOT conditions_in-cond_value IS INITIAL.
CLEAR ex_konvkom-kbetr.
* ex_konvkom-kbetr = conditions_in-cond_value / 10.
ex_konvkom-kbetr = conditions_in-cond_value * 10.
ENDIF.
ENDIF.