1.创建一个CONVERSION_EXIT_ZXXX_OUTPUT的函数,ZXXX可自定义
1 FUNCTION conversion_exit_z001_output. 2 *"---------------------------------------------------------------------- 3 *"*"本地接口: 4 *" IMPORTING 5 *" REFERENCE(INPUT) 6 *" EXPORTING 7 *" REFERENCE(OUTPUT) 8 *"---------------------------------------------------------------------- 9 10 DATA: output1(20), 11 output2(20), 12 outnum(16) TYPE p DECIMALS 2. 13 outnum = input. 14 IF input >= 0. 15 WRITE outnum TO output1. 16 ELSE. 17 outnum = outnum * ( -1 ). 18 WRITE outnum TO output1. 19 CONCATENATE '-' output1 INTO output1. 20 ENDIF. 21 22 CONDENSE output1 NO-GAPS. 23 WRITE output1 TO output2 RIGHT-JUSTIFIED. 24 output = output2. 25 CLEAR: output2. 26 27 ENDFUNCTION.
2.将Fieldcat的edit_mask字段赋值为’==ZXXX’。ZXXX参考定义的函数名称
标签:output1,20,负号,前置,ZXXX,WRITE,output2,ABAP,outnum From: https://www.cnblogs.com/TigerMan/p/17661945.html