2007 May 11 6:27 AM
hi all,
i want to convert amount value(netwr) which is numeric into words.
eg.
2,500 as two thousand five hundred.
can any body send me sample code for this, or any functional module for this.
thanks
venkat
2007 May 11 6:29 AM
hi Venkat,
Use FM HR_IN_CHG_INR_WRDS or SPELL_AMOUNT
Here is the sample code
DATA AMT_IN_NUM LIKE PC207-BETRG.
DATA AMT_IN_WORDS(100) TYPE c.
PARAMETERS: AMOUNT LIKE AMT_IN_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = AMOUNT
IMPORTING
AMT_IN_WORDS = AMT_IN_WORDS
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE AMT_IN_WORDS.
hi all,
i want to convert amount value(netwr) which is numeric into words.
eg.
2,500 as two thousand five hundred.
can any body send me sample code for this, or any functional module for this.
thanks
venkat
2007 May 11 6:29 AM
hi Venkat,
Use FM HR_IN_CHG_INR_WRDS or SPELL_AMOUNT
Here is the sample code
DATA AMT_IN_NUM LIKE PC207-BETRG.
DATA AMT_IN_WORDS(100) TYPE c.
PARAMETERS: AMOUNT LIKE AMT_IN_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = AMOUNT
IMPORTING
AMT_IN_WORDS = AMT_IN_WORDS
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE AMT_IN_WORDS.
2007 May 11 6:32 AM
Hi
use the function modules
<b>SPELL_AMOUNT or
FM HR_IN_CHG_INR_WRDS</b>
search for where used list of them you will get lot of sample codes
Reward points if useful
Regards
Anji
2007 May 11 6:32 AM
Hi,
Use FM SPELL_AMOUNT You will get your requirement.
Thanks
Ravi
2007 May 11 6:34 AM
Hi,
Try this Function Module,
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '123'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM.
Thanks.
Reward if helpful.
2016 Apr 15 10:41 AM
2007 May 11 6:35 AM
2007 May 11 6:36 AM
Hi,
Use the below function module SPELL_AMOUNT
Regards
Sudheer
2016 Apr 15 10:42 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |