ABAP--将数字金额转换为人民币大写字符串
来源:互联网 发布:java 上传文件 原理 编辑:程序博客网 时间:2024/06/11 18:17
function z_convert_numeric_to_chinese.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(PI_MONEY) LIKE BSEG-DMBTR
*" EXPORTING
*" REFERENCE(PO_CHINESE)
*" EXCEPTIONS
*" WRONG_MONEY
*"----------------------------------------------------------------------
if pi_money = 0.
po_chinese = '零'.
exit.
endif.
data:money_str(13).
money_str = pi_money.
if money_str cn '0123456789. '.
raise wrong_money.
endif.
data:i type i.
if money_str cs '.'.
i = sy-fdpos + 1.
money_str+sy-fdpos = money_str+i.
endif.
condense money_str no-gaps.
data:units_off type i,
curnt_off type i.
data:lastd type n,curntd type n.
data:cword(2),weight(2).
data:units(30) value '分角元拾佰仟万拾佰仟亿拾佰仟万',
digts(20) value '零壹贰叁肆伍陆柒捌玖'.
* clear:po_chinese,units_off.
lastd = 0.
curnt_off = strlen( money_str ) - 1.
while curnt_off >= 0.
curntd = money_str+curnt_off(1).
i = curntd * 2.
cword = digts+i(2).
weight = units+units_off(2).
i = units_off / 2.
if curntd = 0. "Current digit is 0
if i = 2 or i = 6 or i = 10.
clear:cword.
if curnt_off = 0.
clear:weight.
endif.
elseif lastd = 0.
clear:cword,weight.
else.
clear:weight.
endif.
endif.
concatenate cword weight po_chinese into po_chinese.
lastd = curntd.
subtract 1 from curnt_off.
add 2 to units_off.
endwhile.
if po_chinese ns '分'.
concatenate po_chinese '整' into po_chinese.
else.
cword = po_chinese.
if cword = '零'.
shift po_chinese by 2 places.
endif.
endif.
endfunction.
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1180463
- ABAP--将数字金额转换为人民币大写字符串
- ABAP--将数字金额转换为人民币大写字符串
- ABAP--将数字金额转换为人民币大写字符串(增加UNICODE版本)
- ABAP--将数字金额转换为人民币大写字符串(增加UNICODE版本)
- 将数字金额转换为人民币大写字符串
- 将数字字符串转换为人民币大写
- js将数字金额转换为大写人民币
- 人民币大写金额转换为数字
- 将人民币数字转换为中文大写
- .net 将数字转换为人民币大写
- JS实现将数字金额转换为大写人民币汉字的方法
- 将数字金额转换成大写人民币形式
- PHP将数字金额转化为中文人民币大写
- 将数字转换为大写金额
- 将数字转换为大写金额
- JavaScript将数字转换为大写金额
- Java学习小试牛刀之数字金额转换为人民币大写
- JS将人民币小写金额转换为大写
- ABAP--SAP的SYSTEM的函数列表和代码示例
- 使用'SAPGUI_SET_PROPERTY'函数是GUI屏幕可见和不可见
- FI--R/3 功能详解----财务会计
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- FI--SAP财务成本知识库
- ABAP--将数字金额转换为人民币大写字符串
- ABAP--如何限制自己开发的耗时报表在sap系统中运行的个数,以保证正常业务的进行
- ABAP--如何创建动态结构的报表
- JAVA内存溢出
- 将EXCEL文件上传到SAP AS的内表
- 获取当前使用某个TCODE的用户的程序样例
- ABAP--SAP显示处理进度的函数
- SAP和ABAP内存的区别
- 如何使用SMOD和CMOD进行SD的用户增强