02-28-2007 12:15 PM
Hi ,
I m using function module 'SPELL_AMOUNT' to convert numeric value into words.if i pass any numeric entry (10000) it shows "TEN THOUSAND".
But my requirement is to show "Ten thousand ".
Pls .guide me to modify this function module or give new function module which gives required out put .
Thx in Adv.
02-28-2007 12:22 PM
02-28-2007 12:22 PM
Hi,
The FM returns the text in CAPS only,.
You can convert into lower case and make the required things to upper case.
Regards,
Anji
02-28-2007 12:24 PM
I think u have to convert the letters to lower case.
Message was edited by:
Alexander Mariadoss
02-28-2007 12:26 PM
Hi ,
there is a function module which converts characters from upper to lower case , convert all the letters except the first one into lower case.
Regards,
Sunmit.
02-28-2007 12:26 PM
Hi,
It will give only in CAPS. You have change Manually doing coding.
Regards
Bhupal Reddy
02-28-2007 12:27 PM
hi,
you have to use this statement after getting the output from FM
translate amount to lower case
.
regards,
pankaj singh
02-28-2007 12:33 PM
hi,
us this.
transalate <EN THOUSAND> to lower case.
except fist letter,
Now u can concentenate first letter and reaming word into the stirng, then u can write that string to the output.
regards,
seshu
02-28-2007 12:27 PM
You can convert to lower case
also chk this
REPORT ZTEST.
DATA: AMT_IN_NUM LIKE PC207-BETRG.
DATA: WORDS(200) TYPE C.
AMT_IN_NUM = '10000'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = AMT_IN_NUM
IMPORTING
AMT_IN_WORDS = 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:/ WORDS.
02-28-2007 12:34 PM
Use <b><b>HR_P06I_CONVERT_TO_LOWERCASE</b></b> And Pass The Variables
After which letters u want smalls.
02-28-2007 12:38 PM
Hi,
you have to do it manually i think.
Change the words to lower case using translate command.
02-28-2007 12:39 PM
Hi Bapi.....
Use any one of these function Modules after getting the amount in words to get out put as u desired.....
<b>HR_P06I_CONVERT_TO_LOWERCASE.</b> or
<b> STRING_UPPER_LOWER_CASE</b>
Message was edited by:
RK Pasupuleti
07-17-2012 3:58 PM
07-17-2012 5:46 PM
I think there is no function that could accomplish that, but you could do it "manually" using TRANSLATE statement after SPELL_AMOUNT. I wrote below code and I got the output you need. I translate the whole string to lowercase and then just the first letter.
REPORT ztests.
DATA: amount TYPE i VALUE 10000,
in_words TYPE spell.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = amount
currency = sy-waers
language = sy-langu
IMPORTING
in_words = in_words
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
IF sy-subrc EQ 0.
TRANSLATE in_words-word TO LOWER CASE.
TRANSLATE in_words-word(1) TO UPPER CASE.
WRITE in_words-word.
ENDIF.
Hope it helps you.
Regards,
Karina Hurtado
07-19-2012 6:30 AM
Try This...
Complete Code,
DATA: ASD LIKE SPELL.
DATA: TO_STRING TYPE SPELL-WORD.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = 100
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = ASD
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE:/ ASD-WORD.
TO_STRING = ASD-WORD..
TRANSLATE TO_STRING TO LOWER CASE.
WRITE:/ TO_STRING.
ENDIF.
07-19-2012 4:36 PM
Hi Kaushik, good contribution but I think it doesn't fulfill the requirement. According what I understand, he needs first letter in capital.
" But my requirement is to show "Ten thousand "."
Regards,
Karina Hurtado
12-16-2013 11:06 AM
Hi Bobby,
try this,
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = TOT_AMT -------------> 10000
IMPORTING
AMT_IN_WORDS = IN_WORDS
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'ISP_CONVERT_FIRSTCHARS_TOUPPER'
EXPORTING
INPUT_STRING = IN_WORDS
IMPORTING
OUTPUT_STRING = AMT_WRDS.
write: AMT_WRDS.
Actual out put is "TEN THOUSAND".
By using 'ISP_CONVERT_FIRSTCHARS_TOUPPER' Fm you can get "Ten Thousand".
Thanks & Regards,
Bhargav D.
12-16-2013 11:48 AM
Hi Bobby,
please try this, this will surely be needful, i have used this code in taking output as you desired.
data : final(130).
data : v_amt type PC207-BETRG.
data: vlen type i.
v_amt = v_TOTAL.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = v_amt
IMPORTING
AMT_IN_WORDS = final
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.
*break stabap.
v_words = final.
if v_words+0(1) eq ''.
vlen = strlen( v_words ).
v_words = v_words+1(vlen).
endif.
CALL FUNCTION 'STRING_UPPER_LOWER_CASE'
EXPORTING
delimiter = '/'
string1 = v_words
IMPORTING
STRING = v_words.
* EXCEPTIONS
* NOT_VALID = 1
* TOO_LONG = 2
* TOO_SMALL = 3
* OTHERS = 4
The output will be v_words.
12-16-2013 12:12 PM
Hi bobby,
if you have got your answer, then mark those from where you have got your answer, and please
lock this discussion.
12-16-2013 1:53 PM
Did you notice that Bobby asked this almost seven years ago? He probably since learned to search before posting, so does not need to come back that often.
Thomas