CONVERSION_EXIT_Z0001_OUTPUT
FUNCTION conversion_exit_z0001_output.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
DATA: output1(16) TYPE c,
outdatum TYPE p DECIMALS 2.
IF input <> space.
TRY.
outdatum = input.
CATCH cx_root.
CLEAR output.
RETURN.
ENDTRY.
IF input > 0.
MOVE outdatum TO output .
ELSE.
outdatum = outdatum * ( -1 ).
MOVE outdatum TO output1 .
CONCATENATE '-' output1 INTO output.
CONDENSE output NO-GAPS .
ENDIF.
ELSE.
output = space.
ENDIF.
ENDFUNCTION.
CONVERSION_EXIT_Z0001_INPUT
FUNCTION conversion_exit_z0001_input.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
DATA: lv_num(16) TYPE p DECIMALS 4,
lv_char TYPE char50.
CHECK input IS NOT INITIAL.
TRY.
lv_num = input.
CATCH cx_root.
CLEAR output.
RETURN.
ENDTRY.
output = lv_num.
ENDFUNCTION.
除金额需要在ALV的fieldcat上面设置:
<fs_filedcat>-edit_mask = '==Z0001'.
其次Excel导出需前置负号,需要对应的金额需要参考带币别的金额类型,或者ALV参考带币别的金额类型
例如:
gs_fieldcat-qfieldname = &6. " 参照计量单位的字段名称
&6 = 'WAERS'
或者:
定义的时候,参考