FUNCTION ysd_cov_num_to_en.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(FROM_NUM) TYPE DMBTR
*" EXPORTING
*" REFERENCE(TO_STR) TYPE STRING
*"----------------------------------------------------------------------
DATA num(16) TYPE p DECIMALS 0 .
DATA pnum(2) TYPE i.
DATA temp1 TYPE i .
DATA temp2 TYPE i .
DATA temp3 TYPE i .
DATA temp4 TYPE i .
DATA tempq TYPE i .
DATA tempw TYPE i .
DATA tempe TYPE i .
DATA tempr TYPE i .
DATA temp(16) TYPE i.
DATA tempii TYPE i .
DATA ls_return TYPE string.
DATA ls_str TYPE string.
DATA moff TYPE i VALUE 0.
****
temp = from_num.
ls_str = from_num.
FIND '.' IN ls_str MATCH OFFSET moff.
IF moff > 0.
num = ls_str+0(moff).
moff = moff + 1.
ls_str = ls_str+moff(2).
pnum = ls_str.
ELSE.
num = temp.
pnum = 0.
ENDIF.
IF from_num < 0.
ls_return = 'Negative'.
ELSE.
ls_return = ''.
ENDIF.
num = ABS( num ).
****
*************************************************
temp = num .
temp1 = temp DIV 1000000000 .
temp = temp MOD 1000000000 .
temp2 = temp DIV 1000000 .
temp = temp MOD 1000000 .
temp3 = temp DIV 1000 .
temp = temp MOD 1000 .
temp4 = temp .
********************************************************
IF temp1 <> 0 .
tempii = temp1 .
tempw = tempii DIV 100 .
tempii = tempii MOD 100 .
tempe = tempii DIV 10 .
tempii = tempii MOD 10 .
tempr = tempii .
*********************
IF tempw <> 0 .
tempii = tempw .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
CONCATENATE ls_return 'Hundred' INTO ls_return SEPARATED BY ' '. "WRITE 'Hundred' .
ENDIF .
*********************
tempii = tempe .
CASE tempii.
WHEN 1 .
tempii = temp1 MOD 100.
CASE tempii.
WHEN 11 .
CONCATENATE ls_return 'Eleven' INTO ls_return SEPARATED BY ' '. "WRITE 'Eleven' .
WHEN 12 .
CONCATENATE ls_return 'Twelve' INTO ls_return SEPARATED BY ' '. "WRITE 'Twelve' .
WHEN 13 .
CONCATENATE ls_return 'Thirteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirteen' .
WHEN 14 .
CONCATENATE ls_return 'Fourteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourteen' .
WHEN 15 .
CONCATENATE ls_return 'Fifteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifteen' .
WHEN 16 .
CONCATENATE ls_return 'Sixteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixteen' .
WHEN 17 .
CONCATENATE ls_return 'Seventeen' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventeen' .
WHEN 18 .
CONCATENATE ls_return 'Eighteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighteen' .
WHEN 19 .
CONCATENATE ls_return 'Nineteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Nineteen' .
ENDCASE.
tempr = 0. "leotian
WHEN 0 .
IF tempr <> 0 .
IF ls_return <> ''.
CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
tempii = tempr.
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
tempe = 0. "leotian
WHEN 2 .
CONCATENATE ls_return 'Twenty' INTO ls_return SEPARATED BY ' '. "WRITE 'Twenty' .
WHEN 3 .
CONCATENATE ls_return 'Thirty' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirty' .
WHEN 4 .
CONCATENATE ls_return 'Fourty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourty' .
WHEN 5 .
CONCATENATE ls_return 'Fifty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifty' .
WHEN 6 .
CONCATENATE ls_return 'Sixty' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixty' .
WHEN 7 .
CONCATENATE ls_return 'Seventy' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventy' .
WHEN 8 .
CONCATENATE ls_return 'Eighty' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighty' .
WHEN 9 .
CONCATENATE ls_return 'Ninty' INTO ls_return SEPARATED BY ' '. "WRITE 'Ninty' .
ENDCASE.
***********************
IF tempr <> 0 And tempe <> 0.
tempii = tempr .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
***********************
CONCATENATE ls_return 'Billion' INTO ls_return SEPARATED BY ' '. "WRITE 'billion' .
"CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE / .
ENDIF .
***************************************************************
IF temp2 <> 0 .
* IF ls_return <> ''.
* CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
* ENDIF.
tempii = temp2 .
tempw = tempii DIV 100 .
tempii = tempii MOD 100 .
tempe = tempii DIV 10 .
tempii = tempii MOD 10 .
tempr = tempii .
*********************
IF tempw <> 0 .
tempii = tempw .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
CONCATENATE ls_return 'Hundred' INTO ls_return SEPARATED BY ' '. "WRITE 'Hundred' .
ENDIF .
*********************
tempii = tempe .
CASE tempii.
WHEN 1 .
tempii = temp2 MOD 100 .
CASE tempii.
WHEN 11 .
CONCATENATE ls_return 'Eleven' INTO ls_return SEPARATED BY ' '. "WRITE 'Eleven' .
WHEN 12 .
CONCATENATE ls_return 'Twelve' INTO ls_return SEPARATED BY ' '. "WRITE 'Twelve' .
WHEN 13 .
CONCATENATE ls_return 'Thirteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirteen' .
WHEN 14 .
CONCATENATE ls_return 'Fourteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourteen' .
WHEN 15 .
CONCATENATE ls_return 'Fifteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifteen' .
WHEN 16 .
CONCATENATE ls_return 'Sixteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixteen' .
WHEN 17 .
CONCATENATE ls_return 'Seventeen' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventeen' .
WHEN 18 .
CONCATENATE ls_return 'Eighteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighteen' .
WHEN 19 .
CONCATENATE ls_return 'Nineteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Nineteen' .
ENDCASE.
tempr = 0. "leotian
WHEN 0 .
IF tempr <> 0 .
IF ls_return <> ''.
CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
tempii = tempr.
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
tempe = 0. "leotian
WHEN 2 .
CONCATENATE ls_return 'Twenty' INTO ls_return SEPARATED BY ' '. "WRITE 'Twenty' .
WHEN 3 .
CONCATENATE ls_return 'Thirty' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirty' .
WHEN 4 .
CONCATENATE ls_return 'Fourty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourty' .
WHEN 5 .
CONCATENATE ls_return 'Fifty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifty' .
WHEN 6 .
CONCATENATE ls_return 'Sixty' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixty' .
WHEN 7 .
CONCATENATE ls_return 'Seventy' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventy' .
WHEN 8 .
CONCATENATE ls_return 'Eighty' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighty' .
WHEN 9 .
CONCATENATE ls_return 'Ninty' INTO ls_return SEPARATED BY ' '. "WRITE 'Ninty' .
ENDCASE.
***********************
IF tempr <> 0 And tempe <> 0.
tempii = tempr .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
***********************
CONCATENATE ls_return 'Million' INTO ls_return SEPARATED BY ' '. "WRITE 'million' .
"CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE / .
ENDIF .
***************************************************************
IF temp3 <> 0 .
* IF ls_return <> ''.
* CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
* ENDIF.
tempii = temp3 .
tempw = tempii DIV 100 .
tempii = tempii MOD 100 .
tempe = tempii DIV 10 .
tempii = tempii MOD 10 .
tempr = tempii .
*********************
IF tempw <> 0 .
tempii = tempw .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
CONCATENATE ls_return 'Hundred' INTO ls_return SEPARATED BY ' '. "WRITE 'Hundred' .
ENDIF .
*********************
tempii = tempe .
CASE tempii.
WHEN 1 .
tempii = temp3 MOD 100 .
CASE tempii.
WHEN 11 .
CONCATENATE ls_return 'Eleven' INTO ls_return SEPARATED BY ' '. "WRITE 'Eleven' .
WHEN 12 .
CONCATENATE ls_return 'Twelve' INTO ls_return SEPARATED BY ' '. "WRITE 'Twelve' .
WHEN 13 .
CONCATENATE ls_return 'Thirteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirteen' .
WHEN 14 .
CONCATENATE ls_return 'Fourteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourteen' .
WHEN 15 .
CONCATENATE ls_return 'Fifteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifteen' .
WHEN 16 .
CONCATENATE ls_return 'Sixteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixteen' .
WHEN 17 .
CONCATENATE ls_return 'Seventeen' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventeen' .
WHEN 18 .
CONCATENATE ls_return 'Eighteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighteen' .
WHEN 19 .
CONCATENATE ls_return 'Nineteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Nineteen' .
ENDCASE.
tempr = 0. "leotian
WHEN 0 .
IF tempr <> 0 .
IF ls_return <> ''.
CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
tempii = tempr.
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
tempe = 0. "leotian
WHEN 2 .
CONCATENATE ls_return 'Twenty' INTO ls_return SEPARATED BY ' '. "WRITE 'Twenty' .
WHEN 3 .
CONCATENATE ls_return 'Thirty' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirty' .
WHEN 4 .
CONCATENATE ls_return 'Fourty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourty' .
WHEN 5 .
CONCATENATE ls_return 'Fifty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifty' .
WHEN 6 .
CONCATENATE ls_return 'Sixty' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixty' .
WHEN 7 .
CONCATENATE ls_return 'Seventy' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventy' .
WHEN 8 .
CONCATENATE ls_return 'Eighty' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighty' .
WHEN 9 .
CONCATENATE ls_return 'Ninty' INTO ls_return SEPARATED BY ' '. "WRITE 'Ninty' .
ENDCASE.
***********************
IF tempr <> 0 And tempe <> 0.
tempii = tempr .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
***********************
CONCATENATE ls_return 'Thousand' INTO ls_return SEPARATED BY ' '. "WRITE 'thousAnd' .
ENDIF .
***************************************************************
IF temp4 <> 0 .
* IF ls_return <> ''.
* CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
* ENDIF.
tempii = temp4 .
tempw = tempii DIV 100 .
tempii = tempii MOD 100 .
tempe = tempii DIV 10 .
tempii = tempii MOD 10 .
tempr = tempii .
*********************
IF tempw <> 0 .
tempii = tempw .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
CONCATENATE ls_return 'Hundred' INTO ls_return SEPARATED BY ' '. "WRITE 'Hundred' .
ENDIF .
*********************
tempii = tempe .
CASE tempii.
WHEN 1 .
tempii = temp4 MOD 100.
CASE tempii.
WHEN 11 .
CONCATENATE ls_return 'Eleven' INTO ls_return SEPARATED BY ' '. "WRITE 'Eleven' .
WHEN 12 .
CONCATENATE ls_return 'Twelve' INTO ls_return SEPARATED BY ' '. "WRITE 'Twelve' .
WHEN 13 .
CONCATENATE ls_return 'Thirteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirteen' .
WHEN 14 .
CONCATENATE ls_return 'Fourteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourteen' .
WHEN 15 .
CONCATENATE ls_return 'Fifteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifteen' .
WHEN 16 .
CONCATENATE ls_return 'Sixteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixteen' .
WHEN 17 .
CONCATENATE ls_return 'Seventeen' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventeen' .
WHEN 18 .
CONCATENATE ls_return 'Eighteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighteen' .
WHEN 19 .
CONCATENATE ls_return 'Nineteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Nineteen' .
ENDCASE.
tempr = 0. "leotian
WHEN 0 .
IF tempr <> 0 .
IF ls_return <> ''.
CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
tempii = tempr.
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
tempe = 0. "leotian
WHEN 2 .
CONCATENATE ls_return 'Twenty' INTO ls_return SEPARATED BY ' '. "WRITE 'Twenty' .
WHEN 3 .
CONCATENATE ls_return 'Thirty' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirty' .
WHEN 4 .
CONCATENATE ls_return 'Fourty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourty' .
WHEN 5 .
CONCATENATE ls_return 'Fifty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifty' .
WHEN 6 .
CONCATENATE ls_return 'Sixty' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixty' .
WHEN 7 .
CONCATENATE ls_return 'Seventy' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventy' .
WHEN 8 .
CONCATENATE ls_return 'Eighty' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighty' .
WHEN 9 .
CONCATENATE ls_return 'Ninty' INTO ls_return SEPARATED BY ' '. "WRITE 'Ninty' .
ENDCASE.
***********************
IF tempr <> 0 And tempe <> 0.
tempii = tempr .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
***********************
ENDIF .
IF ls_return <> ''.
CONCATENATE ls_return 'Dollars' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
***********************
"处理小数
IF pnum > 0.
tempii = pnum .
tempw = tempii DIV 100 .
tempii = tempii MOD 100 .
tempe = tempii DIV 10 .
tempii = tempii MOD 10 .
tempr = tempii .
*********************
IF tempw <> 0 .
tempii = tempw .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
CONCATENATE ls_return 'Hundred' INTO ls_return SEPARATED BY ' '. "WRITE 'Hundred' .
ENDIF .
*********************
tempii = tempe .
CASE tempii.
WHEN 1 .
tempii = pnum MOD 100.
CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
CASE tempii.
WHEN 11 .
CONCATENATE ls_return 'Eleven' INTO ls_return SEPARATED BY ' '. "WRITE 'Eleven' .
WHEN 12 .
CONCATENATE ls_return 'Twelve' INTO ls_return SEPARATED BY ' '. "WRITE 'Twelve' .
WHEN 13 .
CONCATENATE ls_return 'Thirteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirteen' .
WHEN 14 .
CONCATENATE ls_return 'Fourteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourteen' .
WHEN 15 .
CONCATENATE ls_return 'Fifteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifteen' .
WHEN 16 .
CONCATENATE ls_return 'Sixteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixteen' .
WHEN 17 .
CONCATENATE ls_return 'Seventeen' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventeen' .
WHEN 18 .
CONCATENATE ls_return 'Eighteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighteen' .
WHEN 19 .
CONCATENATE ls_return 'Nineteen' INTO ls_return SEPARATED BY ' '. "WRITE 'Nineteen' .
ENDCASE.
tempr = 0. "leotian
WHEN 0 .
IF tempr <> 0 .
IF ls_return <> ''.
CONCATENATE ls_return 'And' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
tempii = tempr.
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
tempe = 0. "leotian
WHEN 2 .
CONCATENATE ls_return 'Twenty' INTO ls_return SEPARATED BY ' '. "WRITE 'Twenty' .
WHEN 3 .
CONCATENATE ls_return 'Thirty' INTO ls_return SEPARATED BY ' '. "WRITE 'Thirty' .
WHEN 4 .
CONCATENATE ls_return 'Fourty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fourty' .
WHEN 5 .
CONCATENATE ls_return 'Fifty' INTO ls_return SEPARATED BY ' '. "WRITE 'Fifty' .
WHEN 6 .
CONCATENATE ls_return 'Sixty' INTO ls_return SEPARATED BY ' '. "WRITE 'Sixty' .
WHEN 7 .
CONCATENATE ls_return 'Seventy' INTO ls_return SEPARATED BY ' '. "WRITE 'Seventy' .
WHEN 8 .
CONCATENATE ls_return 'Eighty' INTO ls_return SEPARATED BY ' '. "WRITE 'Eighty' .
WHEN 9 .
CONCATENATE ls_return 'Ninty' INTO ls_return SEPARATED BY ' '. "WRITE 'Ninty' .
ENDCASE.
***********************
IF tempr <> 0 And tempe <> 0.
tempii = tempr .
CASE tempii.
WHEN 1 .
CONCATENATE ls_return 'One' INTO ls_return SEPARATED BY ' '. "WRITE 'One' .
WHEN 2 .
CONCATENATE ls_return 'Two' INTO ls_return SEPARATED BY ' '. "WRITE 'Two' .
WHEN 3 .
CONCATENATE ls_return 'Three' INTO ls_return SEPARATED BY ' '. "WRITE 'Three' .
WHEN 4 .
CONCATENATE ls_return 'Four' INTO ls_return SEPARATED BY ' '. "WRITE 'Four' .
WHEN 5 .
CONCATENATE ls_return 'Five' INTO ls_return SEPARATED BY ' '. "WRITE 'Five' .
WHEN 6 .
CONCATENATE ls_return 'Six' INTO ls_return SEPARATED BY ' '. "WRITE 'Six' .
WHEN 7 .
CONCATENATE ls_return 'Seven' INTO ls_return SEPARATED BY ' '. "WRITE 'Seven' .
WHEN 8 .
CONCATENATE ls_return 'Eight' INTO ls_return SEPARATED BY ' '. "WRITE 'Eight' .
WHEN 9 .
CONCATENATE ls_return 'Nine' INTO ls_return SEPARATED BY ' '. "WRITE 'Nine' .
ENDCASE.
ENDIF .
IF ls_return <> ''.
CONCATENATE ls_return 'Cents only' INTO ls_return SEPARATED BY ' '. "WRITE 'And'.
ENDIF.
ENDIF.
***********************
"返回结果
to_str = ls_return.
ENDFUNCTION.