需求:DEC数据在维护的时候显示0
1,设置数据元素对于的域带转换历程、
2,写转换历程函数(注意两个历程的输入和输出类型,这个需要修改)
FUNCTION conversion_exit_zdays_input. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(INPUT) TYPE CLIKE *" EXPORTING *" VALUE(OUTPUT) TYPE ZECRM_DEC *"---------------------------------------------------------------------- IF input = '0' OR input = ''. output = '0'. ELSE. TRY . output = input. CATCH cx_sy_conversion_no_number. ENDTRY. ENDIF. ENDFUNCTION.
FUNCTION conversion_exit_zdays_output. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(INPUT) TYPE ZECRM_DEC *" EXPORTING *" VALUE(OUTPUT) TYPE CLIKE *"---------------------------------------------------------------------- IF input = '' OR input = '0'. output = '0'. ELSE. output = input. CONDENSE output NO-GAPS. ENDIF. ENDFUNCTION.
效果:
^_^很多人都把资料锁进了note里,以后还怎么百度呢^_^