FUNCTION zf_cn_num2.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(I_JE) TYPE BSEG-DMBTR
*" EXPORTING
*" REFERENCE(E_JE) TYPE CHAR100
*"----------------------------------------------------------------------
DATA:s_zs TYPE spell,
s_j TYPE spell,
s_f TYPE spell,
v_nu TYPE char30,
v_zs TYPE char30,
v_xs TYPE char30,
v_j TYPE char30,
v_f TYPE char30.
v_nu = i_je.
SPLIT v_nu AT '.' INTO v_zs v_xs.
v_j = v_xs(1).
v_f = v_xs+1(1).
IF v_zs <> '0' .
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
language = '1' "sy-langu"
currency = sy-waers
amount = v_zs
filler = ' '
IMPORTING
in_words = s_zs.
ENDIF.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
language = '1' "sy-langu"
currency = sy-waers
amount = v_j
filler = ' '
IMPORTING
in_words = s_j.
IF v_f <> '0' .
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
language = '1' "sy-langu"
currency = sy-waers
amount = v_f
filler = ' '
IMPORTING
in_words = s_f.
ENDIF.
IF s_j-word = '零' AND s_f IS INITIAL . "如果没有小数位数 如 11.00"
CONCATENATE s_zs-word '元整' INTO e_je.
ELSEIF s_zs IS INITIAL . "如果没有证书位 如 0.10 0.01 0.11"
IF s_j-word <> '零' .
CONCATENATE s_j-word '角' INTO e_je .
ENDIF.
IF s_f IS NOT INITIAL.
CONCATENATE e_je s_f-word '分' INTO e_je.
ENDIF.
ELSE. "如果整数小数位都有 如 11.01 11.10 11.11"
CONCATENATE s_zs-word '元' INTO e_je.
IF s_j-word = '零' AND s_f IS NOT INITIAL .
CONCATENATE e_je s_j-word INTO e_je.
ELSE.
CONCATENATE e_je s_j-word '角' INTO e_je .
ENDIF.
IF s_f IS NOT INITIAL .
CONCATENATE e_je s_f-word '分' INTO e_je.
ENDIF.
ENDIF.
ENDFUNCTION.
sap金额数字转汉字大写
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- functionconvertCurrency(money) { //汉字的数字 varcnNums =newAr...