*大小写金额转换
DA TA: L_DXSTR(60). "大写金额
DA TA: HJ_JFJE LIKE BSEG-WRBTR. "小写金额
HJ_JFJE = '234687.88'.
PERFORM XX_CHANGE_DX USING HJ_JFJE CHANGING L_DXSTR.
*
FORM XX_CHANGE_DX using val
changing dxstr.
DA TA: ZS(15).
DA TA: XS(15).
DA TA: STR(15).
DA TA: LEN TYPE I V ALUE 0.
DA TA: CIS TYPE I V ALUE 0.
DA TA: SS(2).
DA TA: RR(1).
DA TA: STRR(15).
DA TA: change(30) TYPE C V ALUE '1壹2贰3叁4肆5伍6陆7柒8捌9玖0零'.
CLEAR DXSTR.西沙湾
MOVE V AL TO STR.
SHIFT STR LEFT DELETING LEADING SPACE.
SPLIT STR A T '.' INTO ZS XS.
LEN = STRLEN( ZS ).
CLEAR STRR.
CIS = LEN - 1.
DO LEN TIMES.
MOVE ZS+CIS(1) TO RR.
CONCA TENA TE STRR RR INTO STRR.
CIS = CIS - 1.
ENDDO.
CIS = 0.
DO LEN TIMES.
MOVE STRR+CIS(1) TO SS.
TRANSLA TE SS USING change.
CASE CIS.
WHEN 0. CONCA TENA TE SS '元' INTO DXSTR.
WHEN 1. CONCA TENA TE SS '拾' DXSTR INTO DXSTR.
WHEN 2. CONCA TENA TE SS '佰' DXSTR INTO DXSTR.
WHEN 3. CONCA TENA TE SS '仟' DXSTR INTO DXSTR.
WHEN 4. CONCA TENA TE SS '万' DXSTR INTO DXSTR.
WHEN 5. CONCA TENA TE SS '拾' DXSTR INTO DXSTR.
WHEN 6. CONCA TENA TE SS '佰' DXSTR INTO DXSTR.
WHEN 7. CONCA TENA TE SS '仟' DXSTR INTO DXSTR.
WHEN 8. CONCA TENA TE SS '亿' DXSTR INTO DXSTR.
WHEN 9. CONCA TENA TE SS '拾' DXSTR INTO DXSTR.
WHEN 10. CONCA TENA TE SS '百' DXSTR INTO DXSTR.
WHEN 11. CONCA TENA TE SS '仟' DXSTR INTO DXSTR.
ENDCASE.
CIS = CIS + 1.
ENDDO.
CLEAR SS.
IF XS <> '00'.
MOVE XS+0(1) TO SS. TRANSLA TE SS USING change.
CONCA TENA TE DXSTR SS '角' INTO DXSTR.
MOVE XS+1(1) TO SS. TRANSLA TE SS USING change.
CONCA TENA TE DXSTR SS '分' INTO DXSTR.
ENDIF.
CONCA TENA TE DXSTR '整' INTO DXSTR.
ENDFORM. " XX_CHANGE_DX
我的程序写的比较粗糙,转换方法比较笨。大家将就着看,我不高兴写注释了。如果有什么好的建议或方法,请回复,彼此交流。
领导机关FUNCTION z_xjq_rmbdx.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPOR TING
*" REFERENCE(RMBXX) LIKE BSEG-WRBTR
*" CHANGING
*" REFERENCE(RMBDX1) TYPE C
*"----------------------------------------------------------------------
DATA: BEGIN OF rmb,
by TYPE c,
sy TYPE c,
y TYPE c,
qw TYPE c,
bw TYPE c,
sw TYPE c,
w TYPE c,
q TYPE c,
b TYPE c,
s TYPE c,
g TYPE c,
d TYPE c,
j TYPE c,
f TYPE c,
n TYPE c,
END OF rmb.
DATA: BEGIN OF rmbdx,
by(2) TYPE c,
by1(4) TYPE c,
sy(2) TYPE c,
sy1(4) TYPE c,
y(2) TYPE c,
y1(2) TYPE c,
qw(2) TYPE c,
qw1(4) TYPE c,
bw(2) TYPE c,
bw1(4) TYPE c,
sw(2) TYPE c,
sw1(4) TYPE c,
w(2) TYPE c,
w1(4) TYPE c,
q(2) TYPE c,
q1(4) TYPE c,
b(2) TYPE c,
b1(4) TYPE c,
国务院放假s(2) TYPE c,
s1(4) TYPE c,
g(2) TYPE c,
d(2) TYPE c,
j(2) TYPE c,
j1(2) TYPE c,
f(2) TYPE c,
f1(2) TYPE c,
z(2) TYPE c,
END OF rmbdx.
DATA: y(1) TYPE c.
rmb = rmbxx.
IF NOT ( rmb-by IS INITIAL ) AND rmb-by NE '0'.
PERFORM dx USING rmb-by CHANGING rmbdx-by.
y = 'X'.
IF rmb-by NE '0'.
IF rmb-sy EQ '0' AND rmb-y EQ '0'.
rmbdx-by1 = '佰亿'.
ELSE.
rmbdx-by1 = '佰'.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-sy IS INITIAL ).
IF rmb-sy NE '0' OR rmb-y NE '0'.
刘涛演的电视剧PERFORM dx USING rmb-sy CHANGING rmbdx-sy.
y = 'X'.
IF rmb-sy NE '0'.
IF rmb-y EQ '0'.
眉清目秀rmbdx-sy1 = '拾亿'.
ELSE.
rmbdx-sy1 = '拾'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-y IS INITIAL ).
IF rmb-y NE '0' OR rmb-qw NE '0'.
PERFORM dx USING rmb-y CHANGING rmbdx-y.
y = 'X'.
IF rmb-y NE '0'.
rmbdx-y1 = '亿'.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-qw IS INITIAL ).
IF rmb-qw NE '0' OR rmb-bw NE '0'.
PERFORM dx USING rmb-qw CHANGING rmbdx-qw.
y = 'X'.
IF rmb-qw NE '0'.
怎么哄老婆睡觉
IF rmb-bw EQ '0' AND rmb-sw EQ '0' AND rmb-w EQ '0'.
rmbdx-qw1 = '仟万'.
ELSE.
rmbdx-qw1 = '仟'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-bw IS INITIAL ).
IF rmb-bw NE '0' OR rmb-sw NE '0'.
PERFORM dx USING rmb-bw CHANGING rmbdx-bw.
y = 'X'.
IF rmb-bw NE '0'.
IF rmb-sw EQ '0' AND rmb-w EQ '0'.
rmbdx-bw1 = '佰万'.
ELSE.
rmbdx-bw1 = '佰'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-sw IS INITIAL ).
IF rmb-sw NE'0' OR rmb-w NE '0'.
天河城跳楼
PERFORM dx USING rmb-sw CHANGING rmbdx-sw.
y = 'X'.
IF rmb-sw NE '0'.
IF rmb-w EQ '0'.
闭嘴用英语怎么说
rmbdx-sw1 = '拾万'.
ELSE.
rmbdx-sw1 = '拾'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-w IS INITIAL ).
IF rmb-w NE '0' OR rmb-q NE '0'.
PERFORM dx USING rmb-w CHANGING rmbdx-w.
y = 'X'.
IF rmb-w NE '0'.
rmbdx-w1 = '万'.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-q IS INITIAL ).
IF rmb-q NE '0' OR rmb-b NE '0'.
PERFORM dx USING rmb-q CHANGING rmbdx-q.
y = 'X'.
IF rmb-q NE '0'.
rmbdx-q1 = '仟'.
ENDIF.
ENDIF.
ENDIF.
IF NOT ( rmb-b IS INITIAL ).