Upload
sathish-kumar-dhoni
View
36
Download
35
Embed Size (px)
DESCRIPTION
EHP6
Citation preview
Include RFIDCN_ACC_DOC_F02.
Form convert_numeric_to_chinese.
FORM convert_numeric_to_chinese USING iv_money LIKE idcn_s_doc_info-total_num* Ends of Note 1789453 CHANGING ev_chinese TYPE idcn_s_doc_info-total.
DATA money_str(33). DATA lv_ipos TYPE i.
DATA: lv_units_off TYPE i, lv_curnt_off TYPE i. DATA: lv_lastd TYPE n, lv_curntd TYPE n. DATA: lv_cword(2), lv_weight(2).*Begin of modification by note 1995485
* CONSTANTS: units(30) VALUE '分角元拾佰仟万拾佰仟亿拾佰仟万', "#EC STRING_OK
* digts(20) VALUE '零壹贰叁肆伍陆柒捌玖'. "#EC STRING_OK DATA : units(30) TYPE c, "#EC STRING_OK digts(20) TYPE c. "#EC STRING_OK units = text-P01. digts = text-P02.*End of modification by note 1995485
CLEAR ev_chinese.
IF iv_money = 0.*Begin of modification by note 1995485
* ev_chinese = '零'. "#EC STRING_OK ev_chinese = text-P03.*End of modification by note 1995485 EXIT. ENDIF.
money_str = iv_money. CONDENSE money_str NO-GAPS.
IF money_str CN '0123456789. '. "incorrect value ev_chinese = ' '. ENDIF.
IF money_str CS '.'. lv_ipos = sy-fdpos + 1. money_str+sy-fdpos = money_str+lv_ipos.
ENDIF. CONDENSE money_str NO-GAPS.
*** clear:ev_money,units_off. lv_lastd = 0. lv_curnt_off = strlen( money_str ) - 1. WHILE lv_curnt_off >= 0. lv_curntd = money_str+lv_curnt_off(1).
lv_cword = digts+lv_curntd(1). lv_weight = units+lv_units_off(1).
lv_ipos = lv_units_off / 1. IF lv_curntd = 0. "Current digit is 0 IF lv_ipos = 2 OR lv_ipos = 6 OR lv_ipos = 10. CLEAR lv_cword. IF lv_curnt_off = 0. CLEAR lv_weight. ENDIF. ELSEIF lv_lastd = 0. CLEAR: lv_cword, lv_weight. ELSE. CLEAR: lv_weight. ENDIF. ENDIF. CONCATENATE lv_cword lv_weight ev_chinese INTO ev_chinese . lv_lastd = lv_curntd. SUBTRACT 1 FROM lv_curnt_off. ADD 1 TO lv_units_off. ENDWHILE.
*Begin of modification by note 1995485
* IF ev_chinese NS '分'. "#EC STRING_OK* CONCATENATE ev_chinese '整' INTO ev_chinese. "#EC STRING_OK* ELSE.* lv_cword = ev_chinese.
* IF lv_cword = '零'. "#EC STRING_OK* SHIFT ev_chinese BY 1 PLACES.* ENDIF.* ENDIF. IF ev_chinese NS text-P04. "#EC STRING_OK CONCATENATE ev_chinese text-P05 INTO ev_chinese. "#EC STRING_OK ELSE. lv_cword = ev_chinese. IF lv_cword = text-P03. "#EC STRING_OK SHIFT ev_chinese BY 1 PLACES. ENDIF.
ENDIF.*End of modification by note 1995485
ENDFORM. "convert_numeric_to_chinese
Caution, Please make sure that changes have to be completely same with our screen shoot. No more space and blank line allowed!!!!