Convert amount to words in Malaysian and Indonesian Language
Hi
I want to convert the number into words , the words should display in Malaysian & Indonesian Language.
I wanted to display in the report
Regards
Yram
Hi,
Incognito wrote:
Hi,
This query will give you the numbers spelled as words.
select to_char(to_date(873,'J'), 'JSP') as converted_form from dual;I am not sure as to how you can change the language through a query. I am afraid, we can not until and unless we change the required NLS parameters.Unfortunately, that returns the number in Engllish, no matter what the NLS settings are.
For other languages, I think a user-defined function is needed.
See AskTom for some ideas. About half way through that long page, there's an example that spells numbers in the German language.
A little bit earlier, there's an example for French, where they actually translate the English words into French. That example may be admired, if not imitated.
Edited by: Frank Kulash on Feb 2, 2010 2:36 PM
Added AskTom reference.
Similar Messages
-
Cannot convert pdf to word - just spins and says retrievin current session status - has been doing it for days
Hi da522811,
Are you still having trouble converting files? It sounds as though you may be trying to convert via Reader, is that correct? If so, please try logging out, and then logging back in. You may need to log out via the web interface at https://cloud.acrobat.com if you don't have access to the Sign Out button in Reader.
Please let us know how it goes.
Best,
Sara -
how can i convert amount to words using sql query
eg : Rs 10234.50
Ten Thousand Two Hundred Thirty Four Rupees Fifty PaisePerhaps the forum admin need to put the search box right next to the Create New Message button just so people get the idea that what they're asking for just may have been asked for previously by other people.As when creating a new SR in Metalink: Before posting you'll be asked to to search the bug db, knowledge base, technical forums ...etc ...
Not really a bad idea actually ... -
Any FM to convert amount to words?
Hi friends,
Is there any function module available to convert amount to words?
Regards,
Lijo JosephRefer:
Re: I want Function Name which converts number to words
Regards,
Subramanian V. -
Crystal Report-Amount in Words Need correction and Delivery date.
Dear Experts,
Issue 1
In crystal reports i'm converting Amount in to words using the following formula. In that i am getting Every thing in Uppercase with - i.e. RUPEES ONE THOUSAND-FIVE HUNDRED AND .
I need in Sentence case i.e all First Letters in Capital and also want to Remove '-'
Amount in Word
numbervar RmVal:=0;
numbervar Amt:=0;
numbervar pAmt:=0;
stringvar InWords :="Rupees ";
Amt := {OPOR.DocTotal};
if Amt > 10000000 then RmVal := truncate(Amt/10000000);
if Amt = 10000000 then RmVal := 1;
if RmVal = 1 then
InWords := InWords + " " + towords(RmVal,0) + " crore"
else
if RmVal > 1 then InWords := InWords + " " + towords(RmVal,0) + " crores";
Amt := Amt - Rmval * 10000000;
if Amt > 100000 then RmVal := truncate(Amt/100000);
if Amt = 100000 then RmVal := 1;
if RmVal = 1 then
InWords := InWords + " " + towords(RmVal,0) + " lakhs"
Else
If RmVal > 1 then InWords := InWords + " " + ToWords(RmVal,0) + "Lakhs";
Amt := Amt - Rmval * 100000;
if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0);
pAmt := (Amt - truncate(Amt)) * 100;
if pAmt > 0 then
InWords := InWords + " and " + towords(pAmt,0) + " paisa only"
else
InWords := InWords + " only";
UPPERCASE(InWords)
Issue 2.
At Delivery terms I'm using the following formula to display the delivery data. If the document date and due date is same it will print Delivery Immediate otherwise it should calculate the Delivery date from document date, but now it's printing DocDue date.
I need to calculate Delivery Date = DocDuedate - DocDate.
If {OPOR.DocDate} = {OPOR.DocDueDate} Then
"2. Delivery immediate"
Else
"2. Delivery on or before " & {OPOR.DocDueDate}
Thanks
KamalHi
Try this formula
numbervar RmVal:=0;
numbervar Amt:=0;
numbervar pAmt:=0;
stringvar InWords :="Rupees ";
Amt := {@GrandTotal} ;
if Amt > 10000000 then RmVal := truncate(Amt/10000000);
if Amt = 10000000 then RmVal := 1;
if RmVal = 1 then
InWords := InWords + " " + ProperCase (towords(RmVal,0)) + " crore"
else
if RmVal > 1 then InWords := InWords + " " + ProperCase (towords(RmVal,0)) + " crores";
Amt := Amt - Rmval * 10000000;
if Amt > 100000 then RmVal := truncate(Amt/100000);
if Amt = 100000 then RmVal := 1;
if RmVal = 1 then
InWords := InWords + " " + ProperCase (towords(RmVal,0)) + " lakhs"
Else
If RmVal > 1 then InWords := InWords + " " + ProperCase (ToWords(RmVal,0)) + " Lakhs";
Amt := Amt - Rmval * 100000;
if Amt > 0 then InWords := InWords + " " + ProperCase (towords(truncate(Amt),0));
pAmt := (Amt - truncate(Amt)) * 100;
if pAmt > 0 then
InWords := InWords + " and " + ProperCase (towords(pAmt,0)) + " paise only"
else
InWords := InWords + " only";
ProperCase(InWords)
Regards
Vivek -
Function to call to convert amount in words in R12
Hi Experts,
I am creating a custom report that will display invoice details. Included in the fields are AMOUNT and AMOUNT_IN_WORDS. I don't have problem for the AMOUNT field since i can retrieve it directly from the table. My concern is on the AMOUNT_IN_WORDS. Is there any function in EBS R12 which i can call directly in the SQL statement of my report to convert the AMOUNT into Words.
Thanks,
NestorHi mpautom,
What i'm looking for is a built-in function within EBS R12. Because the client doesn't allow creation of function.
Nestor -
PE51 convert amount into words and concatenate the value with cents
Hi gurus,
I'm facing a problem in PE51...
I have this amount: 655.690,32
And it should appear in the form like this Example:
Six hundred and fifty five thousand six hundred and ninety Dollars and Thirty-two cents.
In PE51 I have two options:
- Numbers in words (w/o DP) - give me the first underlined part
- Numbers in words(only DP) - give me the second underlined part
But I need to find a way to show then like in the example... The first and second part should appear together like if they were concatenated separated by space.
Thanks in advance.
PCYou move the v_tot_comm into an Integer and try so that u will only get SPEELING of that value.
For example pass only 23,492 instead of 23,492.58 and for 58 paise you do your string manipulation work. -
Hi
I come to this problem using the FM <b>"SPELL_AMOUNT"</b>
, everything look fine except that it does not know how to convert cents
E.g <b>1300</b> or <b>1,300</b> convert to "ONE THOUSAND THREE HUNDRED". But when it come to cents it does not know how to convert . E.g : <b>1300.35</b> or <b>1,300.35</b> become "ONE HUNDRED THIRTY THOUSAND THIRTY-FIVE"
Does anyone know how to resolve this problem.Hi Dan.
Test with this example:
data: int_val type i,
cent_val type p decimals 2,
val type p decimals 2,
IN_WORDS like spell,
SPELL_VAL(255) type c,
SPELL_CENT(255) type c.
int_val = trunc( val ).
cent_val = ( val - int_val ) * 100.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = val
CURRENCY = 'USD'
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = IN_WORDS.
SPELL_VAL = IN_WORDS-WORD.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = cent_val
CURRENCY = 'USD'
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = IN_WORDS.
SPELL_CENT = IN_WORDS-WORD.
CONCATENATE SPELL_VAL ' DOLAR ' SPELL_CENT ' CENTS ' INTO SPELL_VAL.
Thanks & Regards,
Jhon. -
Converting from Microsoft Word to Pages and removing formatting
I have a huge document in Word that needs serious text editing. I need to remove the formatting and do a simple text edit in Pages. I am relatively new to mac and am on a steep learning curve after 15 years in Microsoft Word and before that Corel! I think I am complicating the issue unnecessarily - I hope someone can give me some simple guidance.
Probably the fastest and surest way is to open the Word file in TextEdit:
Menu > Format > Make Plain Text > Save > Unicode UTF (.txt)
Then Copy and Paste that into Pages or:
Menu > Insert > Choose… > browse to .txt file
Peter -
SMARTFORMS - DUMP IN CONVERTING AMOUNT TO WORDS
final internal table
BEGIN OF STRUCT_FINAL ,
WA_FINAL - GTOTAL TYPE PAYR-WAERS,
TEXT(75) TYPE C,
END OF STRUCT_FINAL.
RECORD NOW MOVED TO WA_FINAL
IMPORT PARAMETER
WA_FINAL - GTOTAL
EXPORT PARAMETER
WA_FINAL-TEXT
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = WA_FINAL-GTOTAL
IMPORTING
AMT_IN_WORDS = WA_FINAL-TEXT
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.
WHILE DRAGGING TEXT FROM FIELD LIST ON / OFF AND ON EXECUTING IT SHOWS DUMP ERROR..
KINDLY HELPhi,
You can move value to some variable ex: v_gtotal, v_text.
v_gtotal = WA_FINAL-GTOTAL.
then
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = v_gtotal
IMPORTING
AMT_IN_WORDS = v_text
move v_text value to WA_FINAL-text -
Converting the amount in words
Hi ,
Issues is like if the amount is $137,510.82 for US currency it should give as ONE HUNDRED THIRTY-SEVEN THOUSAND FIVE HUNDRED TEN USD and 82/100.
But when the document currency is german in the check it should give as ONE HUNDRED THIRTY THOPUSAND AND 51082/100.
THE LOGIC SHOULD BE CURRENCY DEPENDENT.
HOW DO I DI THIS...following is a customized report to convert amount to words...
*& Report ZCFM_REPT_RUPEE_CONVERSION *
*This report is a copy of report 'ZRUPECO1' in Tengl server *
Date : 25-Oct-2006 *
Author : Amiya Shrivastava *
Title : Report to convert amount into words as per*
Indian spelling conventions *
Original Request number : DEVK917286 *
report zcfm_rept_rupee_conversion .
include zcfm_incl_rupee_conv_data.
*& Form COVERSION1
text
-->NUMBER text
-->ANS text
form coversion1 using number changing ans.
clear: gtab,
giritab,
giriline,
girijtab,
line ,
ans,
init, initnam, initno , init1,
cnam1, cnam2, cnam3,cnam4, point,jpoint,
kpoint,lpoint1, lpoint2,lpoint,fpoint,
cnt1 , cnt2, cnt3 ,
flhun, flth, flla, flcr1,flcr2, flchu1, flchu2, flpt, res.
refresh :
itab ,
ktab ,
jtab .
init = number.
init1 = init.
cnt1 = strlen( init ).
cnt2 = cnt1 - 1.
do cnt1 times.
initnam = init+0(1).
shift init by 1 places left.
if initnam = '.'.
cnam1 = init1+0(initno).
endif.
initno = initno + 1.
enddo.
do cnt1 times.
cnam2 = init1+0(1).
shift init1 by 1 places left.
if cnam2 = '.'.
point = init1+0(2).
exit.
endif.
enddo.
do 2 times.
jpoint = point+0(1).
shift point by 1 places left.
if sy-index = 1.
kpoint = point.
endif.
perform points.
enddo.
cnt1 = strlen( cnam1 ).
do cnt1 times.
cnam2 = cnam1+0(1).
perform calcu .
shift cnam1 by 1 places left.
enddo.
sort itab descending by index.
loop at itab.
if sy-tabix = 1.
jtab-result = itab-result.
jtab-index = itab-index.
append jtab.
else.
if itab-result = 'One ' and ( sy-tabix = 2 or sy-tabix = 5 or
sy-tabix = 7 or sy-tabix = 9 ).
perform teens.
move space to line-result.
modify jtab from line index cnt3 transporting result .
else.
if itab-result <> space.
perform ties.
else.
jtab-result = itab-result.
jtab-index = itab-index.
append jtab.
endif.
endif.
endif.
cnt3 = sy-tabix.
res = itab-result.
endloop.
skip.
loop at jtab.
case sy-tabix.
when 10.
if jtab-result <> space.
if flcr1 = 'X' and flcr2 = 'X'.
concatenate jtab-result 'Hundred Crores' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
concatenate jtab-result 'Hundred AND' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
endif.
endif.
when 9.
if flcr1 = 'X'.
if jtab-result <> space.
concatenate jtab-result 'Crores' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flcr2 = 'X'.
endif.
endif.
when 8.
if jtab-result <> space.
concatenate jtab-result 'Crores' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flcr1 = 'X'.
endif.
when 7.
if flla = 'X'.
if jtab-result <> space.
concatenate jtab-result 'Lacs' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
endif.
endif.
when 6.
if jtab-result <> space.
concatenate jtab-result 'Lacs' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flla = 'X'.
endif.
when 5.
if jtab-result <> space.
if flth = 'X'.
concatenate jtab-result 'Thousand' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
endif.
endif.
when 4.
if jtab-result <> space.
concatenate jtab-result 'Thousand' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flth = 'X'.
endif.
when 3.
if jtab-result <> space.
if flchu1 = 'X' and flchu2 = 'X'.
concatenate jtab-result 'Hundred' into line-result
separated by ' '.
else.
concatenate jtab-result 'Hundred AND' into line-result
separated by ' '.
endif.
modify jtab from line index sy-tabix transporting result.
else.
flhun = 'X'.
endif.
when 2.
if jtab-result = space.
flchu2 = 'X'.
endif.
when 1.
if jtab-result = space.
flchu1 = 'X'.
endif.
endcase.
endloop.
*SORT JTAB ASCENDING BY INDEX.
loop at jtab.
if sy-tabix = 1.
cnam4 = jtab-result.
else.
concatenate jtab-result cnam4 into cnam4 separated by space.
endif.
endloop.
if lpoint2 = space and lpoint1 = space.
lpoint = 'only'.
else.
concatenate 'Paise' lpoint2 lpoint1 'only' into lpoint separated by
space.
endif.
if cnam4 <> space.
shift cnam4 left deleting leading space.
concatenate 'Rupees' cnam4 lpoint into ans separated by space.
*WRITE : / 'RUPEES', CNAM4.
*WRITE : / ANS.
endif.
endform. "COVERSION1
*WRITE : / LPOINT NO-GAP.
form ties.
jtab-index = itab-index.
if sy-tabix = 2 or sy-tabix = 5 or sy-tabix = 7 or sy-tabix = 9.
case itab-result.
when 'Two '.
jtab-result = 'Twenty'.
when 'Three'.
jtab-result = 'Thirty'.
when 'Four '.
jtab-result = 'Fourty'.
when 'Five '.
jtab-result = 'Fifty'.
when 'Six '.
jtab-result = 'Sixty'.
when 'Seven'.
jtab-result = 'Seventy'.
when 'Eight'.
jtab-result = 'Eighty'.
when 'Nine '.
jtab-result = 'Ninety'.
when space.
jtab-result = space.
endcase.
else.
jtab-result = itab-result.
endif.
append jtab.
endform. "TIES
*& Form TEENS
text
form teens.
jtab-index = itab-index.
case res.
when 'One '.
jtab-result = 'Eleven'.
when 'Two '.
jtab-result = 'Twelve'.
when 'Three'.
jtab-result = 'Thirteen'.
when 'Four '.
jtab-result = 'Fourteen'.
when 'Five '.
jtab-result = 'Fifteen'.
when 'Six '.
jtab-result = 'Sixteen'.
when 'Seven'.
jtab-result = 'Seventeen'.
when 'Eight'.
jtab-result = 'Eighteen'.
when 'Nine '.
jtab-result = 'Nineteen'.
when space.
jtab-result = 'Ten'.
endcase.
append jtab.
endform. "TEENS
*& Form CALCU
text
form calcu .
itab-index = sy-index.
case cnam2.
when '1'.
itab-result = 'One'.
when '2'.
itab-result = 'Two'.
when '3'.
itab-result = 'Three'.
when '4'.
itab-result = 'Four'.
when '5'.
itab-result = 'Five'.
when '6'.
itab-result = 'Six'.
when '7'.
itab-result = 'Seven'.
when '8'.
itab-result = 'Eight'.
when '9'.
itab-result = 'Nine'.
when '0'.
itab-result = space.
endcase.
append itab.
endform. "CALCU
*& Form POINTS
text
form points.
if sy-index = 2.
if fpoint = space.
case jpoint.
when '1'.
lpoint1 = 'One'.
when '2'.
lpoint1 = 'Two'.
when '3'.
lpoint1 = 'Three'.
when '4'.
lpoint1 = 'Four'.
when '5'.
lpoint1 = 'Five'.
when '6'.
lpoint1 = 'Six'.
when '7'.
lpoint1 = 'Seven'.
when '8'.
lpoint1 = 'Eight'.
when '9'.
lpoint1 = 'Nine'.
when '0'.
lpoint1 = space.
endcase.
endif.
endif.
if sy-index = 1.
case jpoint.
when '1'.
perform lpointy.
when '2'.
lpoint2 = 'Twenty'.
when '3'.
lpoint2 = 'Thirty'.
when '4'.
lpoint2 = 'Forty'.
when '5'.
lpoint2 = 'Fifty'.
when '6'.
lpoint2 = 'Sixty'.
when '7'.
lpoint2 = 'Seventy'.
when '8'.
lpoint2 = 'Eighty'.
when '9'.
lpoint2 = 'Ninety'.
when '0'.
lpoint2 = space.
endcase.
endif.
endform. "POINTS
*& Form LPOINTY
text
form lpointy.
case kpoint.
when '1'.
lpoint2 = 'Eleven'.
when '2'.
lpoint2 = 'Twelve'.
when '3'.
lpoint2 = 'Thirteen'.
when '4'.
lpoint2 = 'Fourteen'.
when '5'.
lpoint2 = 'Fifteen'.
when '6'.
lpoint2 = 'Sixteen'.
when '7'.
lpoint2 = 'Seventeen'.
when '8'.
lpoint2 = 'Eighteen'.
when '9'.
lpoint2 = 'Nineteen'.
when '0'.
lpoint2 = 'Ten'.
endcase.
lpoint1 = space.
fpoint = 'X'.
endform. "LPOINTY -
Amount in words in SAP 8.8
Hello expert,
I want to convert the document amount in words in Indian standard and I am using the below Functions which I got from sdn and its working fine in SAP 2007 but it is giving error in SAP 8.8 and patch level is 5.........please give the feasible solution.....
1. Function to Convert one Digit Number to words.
CREATE Function dbo.fConvertDigit(@decNumber decimal)
returns varchar(6)
as
Begin
declare
@strWords varchar(6)
Select @strWords = Case @decNumber
When '1' then 'One'
When '2' then 'Two'
When '3' then 'Three'
When '4' then 'Four'
When '5' then 'Five'
When '6' then 'Six'
When '7' then 'Seven'
When '8' then 'Eight'
When '9' then 'Nine'
Else ''
end
return @strWords
end
2. Function to convert 2 digit number to words.
CREATE Function dbo.fConvertTens(@decNumber varchar(2))
returns varchar(30)
as
Begin
declare @strWords varchar(30)
--Is value between 10 and 19?
If Left(@decNumber, 1) = 1
begin
Select @strWords = Case @decNumber
When '10' then 'Ten'
When '11' then 'Eleven'
When '12' then 'Twelve'
When '13' then 'Thirteen'
When '14' then 'Fourteen'
When '15' then 'Fifteen'
When '16' then 'Sixteen'
When '17' then 'Seventeen'
When '18' then 'Eighteen'
When '19' then 'Nineteen'
end
end
else -- otherwise it's between 20 and 99.
begin
Select @strWords = Case Left(@decNumber, 1)
When '0' then ''
When '2' then 'Twenty '
When '3' then 'Thirty '
When '4' then 'Forty '
When '5' then 'Fifty '
When '6' then 'Sixty '
When '7' then 'Seventy '
When '8' then 'Eighty '
When '9' then 'Ninety '
end
Select @strWords = @strWords + dbo.fConvertDigit(Right(@decNumber, 1))
end
--Convert ones place digit.
return @strWords
end
3. Function to convert amt in numbers to words. (Built with the help of above 2 functions)
CREATE function dbo.fNumToWords (@decNumber decimal(12, 2))
returns varchar(300)
As
Begin
Declare
@strNumber varchar(100),
@strRupees varchar(200),
@strPaise varchar(100),
@strWords varchar(300),
@intIndex integer,
@intAndFlag integer
Select @strNumber = Cast(@decNumber as varchar(100))
Select @intIndex = CharIndex('.', @strNumber)
if(@decNumber>99999999.99)
BEGIN
RETURN ''
END
If @intIndex > 0
begin
Select @strPaise = dbo.fConvertTens(Right(@strNumber, Len(@strNumber) - @intIndex))
Select @strNumber = SubString(@strNumber, 1, Len(@strNumber) - 3)
If Len(@strPaise) > 0 Select @strPaise = @strPaise + ' paise'
end
Select @strRupees = ''
Select @intIndex=len(@strNumber)
Select @intAndFlag=2
while(@intIndex>0)
begin
if(@intIndex=8)
begin
Select @[email protected](left(@decNumber,1))' Crore '
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
else if(@intIndex=7)
begin
if(substring(@strNumber,1,1)='0')
begin
if substring(@strNumber,2,1)<>'0'
begin
if (@strRupees<>NULL and substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0' and @intAndFlag=2 and @strPaise=NULL)
begin
Select @strRupees=@strRupees+' and ' dbo.fConvertDigit(substring(@strNumber,2,1))' Lakh '
Select @intAndFlag=1
end
else
begin
Select @[email protected](substring(@strNumber,2,1))' Lakh '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
else
begin
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else
begin
if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and ' + dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
Select @intAndFlag=1
end
else
begin
Select @[email protected](substring(@strNumber,1,2))' Lakhs '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else if(@intIndex=6)
begin
if(substring(@strNumber,2,1)<>'0' or substring(@strNumber,3,1)<>'0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and @intAndFlag=2 and @strPaise='')
begin
if len(@strRupees) <= 0
begin
if convert(int,substring(@strNumber,1,1)) = 1
begin
Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
Select @intAndFlag=2
end
else
begin
Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
Select @intAndFlag=2
end
end
else
begin
if convert(int,substring(@strNumber,1,1)) = 1
begin
Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
Select @intAndFlag=1
end
else
begin
Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
Select @intAndFlag=1
end
end
end
else
begin
if convert(int,substring(@strNumber,1,1)) = 1
begin
Select @[email protected](substring(@strNumber,1,1))' Lakh '
end
else
begin
Select @[email protected](substring(@strNumber,1,1))' Lakhs '
end
end
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
else if(@intIndex=5)
begin
if(substring(@strNumber,1,1)='0')
begin
if substring(@strNumber,2,1)<>'0'
begin
if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and ' dbo.fConvertDigit(substring(@strNumber,2,1))' Thousand '
Select @intAndFlag=1
end
else
begin
Select @[email protected](substring(@strNumber,2,1))' Thousand '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
else
begin
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else
begin
if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees' and 'dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
Select @intAndFlag=1
end
else
begin
Select @[email protected](substring(@strNumber,1,2))' Thousand '
end
Select @strNumber=substring(@strNumber,3,len(@strNumber))
Select @intIndex=@intIndex-2
end
end
else if(@intIndex=4)
begin
if ( (substring(@strNumber,3,1)<>'0' or substring(@strNumber,4,1)<>'0') and substring(@strNumber,2,1)='0' and @intAndFlag=2 and @strPaise='')
begin
Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
Select @intAndFlag=1
end
else
begin
Select @[email protected](substring(@strNumber,1,1))' Thousand '
end
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
else if(@intIndex=3)
begin
if substring(@strNumber,1,1)<>'0'
begin
Select @[email protected](substring(@strNumber,1,1))' Hundred '
Select @strNumber=substring(@strNumber,2,len(@strNumber))
if( (substring(@strNumber,1,1)<>'0' or substring(@strNumber,2,1)<>'0') and @intAndFlag=2 )
begin
Select @strRupees=@strRupees+' and '
Select @intAndFlag=1
end
Select @intIndex=@intIndex-1
end
else
begin
Select @strNumber=substring(@strNumber,2,len(@strNumber))
Select @intIndex=@intIndex-1
end
end
else if(@intIndex=2)
begin
if substring(@strNumber,1,1)<>'0'
begin
Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))
Select @intIndex=@intIndex-2
end
else
begin
Select @intIndex=@intIndex-1
end
end
else if(@intIndex=1)
begin
if(@strNumber<>'0')
begin
Select @strRupees=@strRupees+dbo.fConvertDigit(@strNumber)
end
Select @intIndex=@intIndex-1
end
continue
end
if len(@strRupees)>0 Select @strRupees=@strRupees+ ' rupees '
IF(len(@strPaise)<>0)
BEGIN
if len(@strRupees)>0 Select @strRupees=@strRupees + ' and '
END
Select @strWords = IsNull(@strRupees, '') + IsNull(@strPaise, '')
select @strWords = @strWords + ' only'
Return @strWords
End
->> Create 1 UDF in Header on Requrie Documents (ex. Marketing Documents).
->> Create 3 Function in MSSQL Server Management.
->> Create 1 FMS in Query Generator and save as Query Manager then Assign to UDF for Amount in Words.
for example:
Create UDF in Header on Marketing Documents.
->> Choose Tools on Top menu.
->> User - Defined Fields. -> User Manage Fields.
->> Open the User Manage Fields Widnow.
->> Marketing Documents. -> Title.
->> Select Title and Click Add button in Bottom on User Manage Fields Window.
->> Create Amount in Words UDF(Code, Discription and Type - Character) and Add the UDF.
Create Function in MSSQL Server Management.
Check this Link, (have 3 Functions in Link).
http://techcreeze.blogspot.com/2008/11/convert-amount-into-words-according-to_15.html
1st Funciton - to Convert one Digit Number to words
2nd Funciton - to convert 2 digit number to words.
3rd Funciton - to convert amt in numbers to words.
->> Open the MSSQL Server Management Window.
->> Choose your Company database and Create NEW Query.
->> Create 3 Function Queries one by one.
->> Create 3 NEW Query Tab and 1st one put the 1st Function then Run the Function. and
2nd New Query tab put the 2nd Function then Run the Function.
3rd New Query tab put the 3rd Function then Run the Function.
Create FMS in Query Generator and Save as Query Manager.
->> Adminstration.
->> Reports. -> Query Generator.
->> Open the Query Generator and put the below FMS query.
for example : Purchase Order Doc. Toal(in wrods).
declare @Doc_total numeric (19,6)
set @Doc_total=$[OPOR.DocTotal]
select dbo.fNumToWords (@Doc_total)
->> Assign the FMS in UDF on Purchase Order.
->> Auto Refresh of Document Total.
Ex.
1. Goto the UDF and Clcik ShiftAltF2.
2. Select the SEARCH BY SAVED QUERY.
3. Assign the FMS Query.
4. Select the AUTO REFRESH WHEN FIELD CHENGES.
5. Select Document Total.
6. Check the Display Saved Values.Hi Neetu,
its not converting decimal values in paisa...
Regards
Deepak tyagi -
How to display amount in words in the last page
Hi,
I am very new to Oracle Report, but v.good experience in Crystal report.
How can i display amount in words for an invoice amount total in the last page of the invoice and after total amount. I created a new non repeating frame and put the amount in words inside that, and set the frames diplay property Print on Last Page, but the problem is already there is a repeating frame to print all the invoices item, and the total in figure. But the amount in words frame is not always coming after the total amount,either it should be at the bottom of the last page in fixed position, otherwise it should move just below the total amount.
I am using Oracle 11g.
Thanks in advance...
FslHi ,
Use This function
create or replace FUNCTION xxg4_zen_conv_words (p_amount IN Number) RETURN Varchar2 IS
--Creation Date : 11-DEC-2009
--Purpose : This Function returns amount in words.
--Parameters :
--1) p_amount : Only positive and negative values are allowed.
Precision can be entered upto 10 digits and only 2 scales
are allowed e.g 9999999999.99
-- Index by Tables to store word list
TYPE typ_word_list IS TABLE OF Varchar2(200) INDEX BY BINARY_INTEGER;
t_typ_word_list typ_word_list;
TYPE typ_word_gap IS TABLE OF Varchar2(200) INDEX BY BINARY_INTEGER;
t_typ_word_gap typ_word_gap;
-- Local Variables
v_amount Number := p_amount;
v_amount_length Number;
v_words Varchar2(10000);
v_point_found Varchar2(1) := 'N';
v_point_value Number;
BEGIN
/*Getting value after point if found */
v_point_value := SUBSTR(v_amount,(INSTR(v_amount,'.',1) + 1),2);
/*Checking whether amount has any scale value also */
v_point_found := CASE WHEN (INSTR(v_amount,'.',1)) = 0 THEN 'N'
WHEN (INSTR(v_amount,'.',1)) > 0 THEN 'Y'
END;
/*Converting amount into pure numeric format */
v_amount := FLOOR(ABS(v_amount));
v_amount_length := LENGTH(v_amount);
t_typ_word_gap(2) := 'and Paise';
t_typ_word_gap(3) := 'Hundred';
t_typ_word_gap(4) := 'Thousand';
t_typ_word_gap(6) := 'Lakh';
t_typ_word_gap(8) := 'Crore';
t_typ_word_gap(10) := 'Arab';
FOR i IN 1..99
LOOP
t_typ_word_list(i) := To_Char(To_Date(i,'J'),'Jsp');
END LOOP;
IF v_amount_length <= 2
THEN
/* Conversion 1 to 99 digits */
v_words := t_typ_word_list(v_amount);
ELSIF v_amount_length = 3
THEN
/* Conversion for 3 digits till 999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(3);
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2));
ELSIF v_amount_length = 4
THEN
/* Conversion for 4 digits till 9999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(4);
IF SUBSTR(v_amount,2,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,3,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,2));
END IF;
ELSIF v_amount_length = 5
THEN
/* Conversion for 5 digits till 99999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,2))||' '||t_typ_word_gap(4);
IF SUBSTR(v_amount,3,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,4,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,2));
END IF;
ELSIF v_amount_length = 6
THEN
/* Conversion for 6 digits till 999999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(6);
IF SUBSTR(v_amount,2,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2))||' '||t_typ_word_gap(4);
END IF;
IF SUBSTR(v_amount,4,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,5,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,5,2));
END IF;
ELSIF v_amount_length = 7
THEN
/* Conversion for 7 digits till 9999999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,2))||' '||t_typ_word_gap(6);
IF SUBSTR(v_amount,3,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,2))||' '||t_typ_word_gap(4);
END IF;
IF SUBSTR(v_amount,5,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,5,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,6,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,6,2));
END IF;
ELSIF v_amount_length = 8
THEN
/* Conversion for 8 digits till 99999999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(8);
IF SUBSTR(v_amount,2,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2))||' '||t_typ_word_gap(6);
END IF;
IF SUBSTR(v_amount,4,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,2))||' '||t_typ_word_gap(4);
END IF;
IF SUBSTR(v_amount,6,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,6,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,7,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,7,2));
END IF;
ELSIF v_amount_length = 9
THEN
/* Conversion for 9 digits till 999999999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,2))||' '||t_typ_word_gap(8);
IF SUBSTR(v_amount,3,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,2))||' '||t_typ_word_gap(6);
END IF;
IF SUBSTR(v_amount,5,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,5,2))||' '||t_typ_word_gap(4);
END IF;
IF SUBSTR(v_amount,7,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,7,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,8,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,8,2));
END IF;
ELSIF v_amount_length = 10
THEN
/* Conversion for 10 digits till 9999999999 */
v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(10);
IF SUBSTR(v_amount,2,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2))||' '||t_typ_word_gap(8);
END IF;
IF SUBSTR(v_amount,4,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,2))||' '||t_typ_word_gap(6);
END IF;
IF SUBSTR(v_amount,6,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,6,2))||' '||t_typ_word_gap(4);
END IF;
IF SUBSTR(v_amount,8,1) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,8,1))||' '||t_typ_word_gap(3);
END IF;
IF SUBSTR(v_amount,9,2) != 0
THEN
v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,9,2));
END IF;
END IF;
IF v_point_found = 'Y'
THEN
IF v_point_value != 0
THEN
v_words := v_words||' '||t_typ_word_gap(2)||' '||t_typ_word_list(CASE WHEN LENGTH(SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)) = 1 THEN SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)||'0'
WHEN LENGTH(SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)) = 2 THEN SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)
END);
END IF;
END IF;
IF p_amount < 0
THEN
v_words := 'Minus '||v_words;
ELSIF p_amount = 0
THEN
v_words := 'Zero';
END IF;
IF LENGTH(v_amount) > 10
THEN
v_words := 'Value larger than specified precision allowed to convert into words. Maximum 10 digits allowed for precision.';
END IF;
RETURN (v_words);
END xxg4_Zen_Conv_Words;
--Thanks
SAGAR SANKPAL -
Amount in Words (Indian Rupees)
Dear All,
I am using SAP 2007B PL 18.I have found out the below mentioned function for converting the amount to words in SDN only. But when i try and create the function it gives error "Incorrect Syntax near 00' . I think there is an incomplete syntax near the SubString function. Can someone please help me on the same and give the correct function.
Create function [dbo].[AmountToWords] ( @InNumber Numeric(18,2) )
--Returns the number as words.
returns VARCHAR(2000)
as
BEGIN
SET NoCount ON
Declare @Num Varchar(20)
Declare @Dec Varchar(3)
Declare @Return Varchar(2000)
Set @Dec = SubString(Convert(Varchar(20),@Innumber),Len(Convert(Varchar(20),@Innumber))-2,3)
Set @Num = SubString(Convert(Varchar(20),@Innumber),1, Len(Convert(Varchar(20),@Innumber))-3)
Declare @Hundred Char(8) Declare @HundredAnd Char(12) Declare @Thousand Char(9)
Declare @Lakh Char(5)
Declare @Lakhs Char(6)
Declare @Crore Char(6)
Declare @Crores Char(7)
Set @Hundred = 'Hundred '
Set @Thousand = 'Thousand '
Set @Lakh = 'Lakh '
Set @Lakhs = 'Lakhs '
Set @Crore = 'Crore '
Set @Crores = 'Crores '
Set @HundredAnd = 'Hundred and '
if Len(@Num) = 1
-- One
Begin
Set @Return = dbo.GetTextValue(@Num)
End
Else if Len(@Num) = 2
-- Ten
Begin
Set @Return = dbo.GetTextValue(@Num)
End
Else if Len(@Num) = 3
-- Hundred
Begin
Set @Return = dbo.GetTextValue(SubString(@Num,1,1)) + @Hundred
IF SubString(@num,2,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,2,2))
End
Else if Len(@Num) = 4
-- thousand
Begin
Set @Return = dbo.GetTextValue(SubString(@Num,1,1)) + @Thousand
If SubString(@Num,2,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,2,1)) + @Hundred
IF SubString(@num,3,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,3,2))
End
Else if Len(@Num) = 5
-- Ten Thousand
Begin
Set @Return = dbo.GetTextValue(SubString(@Num,1,2)) + @Thousand
If SubString(@Num,3,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,3,1)) + @Hundred
IF SubString(@num,4,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,4,2))
End
Else if Len(@Num) = 6
-- Lakh
Begin
If SubString(@Num,1,1) = '1'
Set @Return = dbo.GetTextValue(SubString(@Num,1,1)) + @Lakh
Else
Set @Return = dbo.GetTextValue(SubString(@Num,1,1)) + @Lakhs
If SubString(@Num,2,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,2,2)) + @Thousand
If SubString(@Num,4,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,4,1)) + @Hundred
IF SubString(@num,5,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,5,2))
End
Else if Len(@Num) = 7
-- Ten Lakhs
Begin
Set @Return = dbo.GetTextValue(SubString(@Num,1,2)) + @Lakhs
If SubString(@Num,3,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,3,2)) + @Thousand
If SubString(@Num,6,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,5,1)) + @Hundred
IF SubString(@num,6,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,6,2))
End
Else if Len(@Num) = 8
-- Crore
Begin
Set @Return = dbo.GetTextValue(SubString(@Num,1,1)) + @Crore
If SubString(@Num,2,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,2,2)) + @Lakhs
If SubString(@Num,4,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,4,2)) + @Thousand
If SubString(@Num,6,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,6,1)) + @Hundred
IF SubString(@num,7,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,7,2))
End
Else if Len(@Num) = 9
-- Ten Crore
Begin
Set @Return = dbo.GetTextValue(SubString(@Num,1,2)) + @Crores
If SubString(@Num,3,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,3,2)) + @Lakhs
If SubString(@Num,5,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,5,2)) + @Thousand
If SubString(@Num,7,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,7,1)) + @Hundred
IF SubString(@num,8,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,8,2))
End
Else if Len(@Num) = 10
-- Hundred Crore
Begin
Set @Return = dbo.GetTextValue(Substring(@Num,1,1)) + @Hundred
IF Substring(@Num,2,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,2,2))
Set @Return = @Return + @Crores
If SubString(@Num,4,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,4,2)) + @Lakhs
If SubString(@Num,6,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,6,2)) + @Thousand
If SubString(@Num,8,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,8,1)) + @Hundred
IF SubString(@num,9,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,9,2))
End
Else if Len(@Num) = 11
-- Thousand Crore
Begin Set @Return = dbo.GetTextValue(Substring(@Num,1,1)) + @Thousand
IF SubString(@Num,2,1) '0'
Set @Return = @Return + dbo.GetTextValue(Substring(@Num,2,1)) + @Hundred
IF Substring(@Num,3,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,3,2))
Set @Return = @Return + @Crores If SubString(@Num,5,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,5,2)) + @Lakhs
If SubString(@Num,7,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,7,2)) + @Thousand
If SubString(@Num,9,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,9,1)) + @Hundred
IF SubString(@num,10,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,10,2))
End
Else if Len(@Num) = 12
-- Ten thousand Crore
Begin Set @Return = dbo.GetTextValue(Substring(@Num,1,2)) + @Thousand
IF SubString(@Num,3,1) '0'
Set @Return = @Return + dbo.GetTextValue(Substring(@Num,3,1)) + @Hundred
IF Substring(@Num,4,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,4,2))
Set @Return = @Return + @Crores If SubString(@Num,6,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,6,2)) + @Lakhs
If SubString(@Num,8,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,8,2)) + @Thousand
If SubString(@Num,10,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,10,1)) + @Hundred
IF SubString(@num,11,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,11,2))
End
Else if Len(@Num) = 13
-- Lakh Crore
Begin Set @Return = dbo.GetTextValue(Substring(@Num,1,1)) + @Lakh
If Substring(@Num,2,2) '00'
Set @Return = @Return + dbo.GetTextValue(Substring(@Num,2,2)) + @Thousand
IF SubString(@Num,4,1) '0'
Set @Return = @Return + dbo.GetTextValue(Substring(@Num,4,1)) + @Hundred
IF Substring(@Num,5,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,5,2))
Set @Return = @Return + @Crores
If SubString(@Num,7,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,7,2)) + @Lakhs
If SubString(@Num,9,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,9,2)) + @Thousand
If SubString(@Num,11,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,11,1)) + @Hundred
IF SubString(@num,12,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,12,2))
End
Else if Len(@Num) = 14
-- Ten Lakh Crore
Begin Set @Return = dbo.GetTextValue(Substring(@Num,1,2)) + @Lakhs
If Substring(@Num,3,2) '00'
Set @Return = @Return + dbo.GetTextValue(Substring(@Num,3,2)) + @Thousand
IF SubString(@Num,5,1) '0'
Set @Return = @Return + dbo.GetTextValue(Substring(@Num,5,1)) + @Hundred
IF Substring(@Num,6,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,6,2))
Set @Return = @Return + @Crores If SubString(@Num,8,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,8,2)) + @Lakhs
If SubString(@Num,10,2) '00'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,10,2)) + @Thousand
If SubString(@Num,12,1) '0'
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,12,1)) + @Hundred
IF SubString(@num,13,2) '00'
Set @Return = @Return + 'And '
Set @Return = @Return + dbo.GetTextValue(SubString(@Num,13,2))
End
If @Dec '.00'
Set @Return = @Return + 'Rupees And ' + dbo.GetTextValue(SubString(@Dec,2,2)) + 'Paise Only'
ELSE
Set @Return =@Return+'Zero Rupees Only'
Return @return
End
CREATE Function [dbo].[GetTextValue] ( @dblNumber Numeric )
Returns Varchar(1000)
As
Begin
Declare @StrWord Varchar(400)
SET @strWord = Case @dblNumber
When 1 Then 'One '
When 2 Then 'Two '
When 3 Then 'Three '
When 4 Then 'Four '
When 5 Then 'Five '
When 6 Then 'Six '
When 7 Then 'Seven '
When 8 Then 'Eight '
When 9 Then 'Nine '
When 10 Then 'Ten '
When 11 Then 'Eleven '
When 12 Then 'Twelve '
When 13 Then 'Thirteen '
When 14 Then 'Fourteen '
When 15 Then 'Fifteen '
When 16 Then 'Sixteen '
When 17 Then 'Seventeen '
When 18 Then 'Eighteen '
When 19 Then 'Nineteen '
When 20 Then 'Twenty '
When 21 Then 'Twenty One '
When 22 Then 'Twenty Two '
When 23 Then 'Twenty Three '
When 24 Then 'Twenty Four '
When 25 Then 'Twenty Five '
When 26 Then 'Twenty Six '
When 27 Then 'Twenty Seven '
When 28 Then 'Twenty Eight '
When 29 Then 'Twenty Nine '
When 30 Then 'Thirty '
When 31 Then 'Thirty One '
When 32 Then 'Thirty Two '
When 33 Then 'Thirty Three '
When 34 Then 'Thirty Four '
When 35 Then 'Thirty Five '
When 36 Then 'Thirty Six '
When 37 Then 'Thirty Seven '
When 38 Then 'Thirty Eight '
When 39 Then 'Thirty Nine '
When 40 Then 'Fourty '
When 41 Then 'Fourty One '
When 42 Then 'Fourty Two '
When 43 Then 'Fourty Three '
When 44 Then 'Fourty Four '
When 45 Then 'Fourty Five '
When 46 Then 'Fourty Six '
When 47 Then 'Fourty Seven '
When 48 Then 'Fourty Eight '
When 49 Then 'Fourty Nine '
When 50 Then 'Fifty '
When 51 Then 'Fifty One '
When 52 Then 'Fifty Two '
When 53 Then 'Fifty Three '
When 54 Then 'Fifty Four '
When 55 Then 'Fifty Five '
When 56 Then 'Fifty Six '
When 57 Then 'Fifty Seven '
When 58 Then 'Fifty Eight '
When 59 Then 'Fifty Nine '
When 60 Then 'Sixty '
When 61 Then 'Sixty One '
When 62 Then 'Sixty Two '
When 63 Then 'Sixty Three '
When 64 Then 'Sixty Four '
When 65 Then 'Sixty Five '
When 66 Then 'Sixty Six '
When 67 Then 'Sixty Seven '
When 68 Then 'Sixty Eight '
When 69 Then 'Sixty Nine '
When 70 Then 'Seventy '
When 71 Then 'Seventy One '
When 72 Then 'Seventy Two '
When 73 Then 'Seventy Three '
When 74 Then 'Seventy Four '
When 75 Then 'Seventy Five '
When 76 Then 'Seventy Six '
When 77 Then 'Seventy Seven '
When 78 Then 'Seventy Eight '
When 79 Then 'Seventy Nine '
When 80 Then 'Eighty '
When 81 Then 'Eighty One '
When 82 Then 'Eighty Two '
When 83 Then 'Eighty Three '
When 84 Then 'Eighty Four '
When 85 Then 'Eighty Five '
When 86 Then 'Eighty Six '
When 87 Then 'Eighty Seven '
When 88 Then 'Eighty Eight '
When 89 Then 'Eighty Nine '
When 90 Then 'Ninety '
When 91 Then 'Ninety One '
When 92 Then 'Ninety Two '
When 93 Then 'Ninety Three '
When 94 Then 'Ninety Four '
When 95 Then 'Ninety Five '
When 96 Then 'Ninety Six '
When 97 Then 'Ninety Seven '
When 98 Then 'Ninety Eight '
When 99 Then 'Ninety Nine '
When 100 Then 'One hundred '
else ' '
End
Return @strWord
End
Regards,
RahulDear Rahul,
Try this,
->> Create 1 UDF in Header on Requrie Documents (ex. Marketing Documents).
->> Create 3 Function in MSSQL Server Management.
->> Create 1 FMS in Query Generator and save as Query Manager then Assign to UDF for Amount in Words.
for example:
Create UDF in Header on Marketing Documents.
->> Choose Tools on Top menu.
->> User - Defined Fields. -> User Manage Fields.
->> Open the User Manage Fields Widnow.
->> Marketing Documents. -> Title.
->> Select Title and Click Add button in Bottom on User Manage Fields Window.
->> Create Amount in Words UDF(Code, Discription and Type - Character) and Add the UDF.
Create Function in MSSQL Server Management.
Check this Link, (have 3 Functions in Link).
http://techcreeze.blogspot.com/2008/11/convert-amount-into-words-according-to_15.html
1st Funciton - to Convert one Digit Number to words
2nd Funciton - to convert 2 digit number to words.
3rd Funciton - to convert amt in numbers to words.
->> Open the MSSQL Server Management Window.
->> Choose your Company database and Create NEW Query.
->> Create 3 Function Queries one by one.
->> Create 3 NEW Query Tab and 1st one put the 1st Function then Run the Function. and
2nd New Query tab put the 2nd Function then Run the Function.
3rd New Query tab put the 3rd Function then Run the Function.
Create FMS in Query Generator and Save as Query Manager.
->> Adminstration.
->> Reports. -> Query Generator.
->> Open the Query Generator and put the below FMS query.
for example : Purchase Order Doc. Toal(in wrods).
declare @Doc_total numeric (19,6)
set @Doc_total=$[OPOR.DocTotal]
select dbo.fNumToWords (@Doc_total)
->> Assign the FMS in UDF on Purchase Order.
->> Auto Refresh of Document Total.
Ex.
1. Goto the UDF and Clcik ShiftAltF2.
2. Select the SEARCH BY SAVED QUERY.
3. Assign the FMS Query.
4. Select the AUTO REFRESH WHEN FIELD CHENGES.
5. Select Document Total.
6. Check the Display Saved Values. -
Good Day,
This is my first time to post here, Could you please help me about the printing on checks
Scenario, some of the checks has a value of 33,717.95 but when amount in words it printed "thrity - three thousand seven hundred and seventeen pesos and 95/100 only". Another one is 109,672.38 amount in words is "One hundred and nine thousand six hundred seventy - two pesos and 38/100 only"
Where can i also delete the pesos word on the amount in words?
Edited by: Carlito Go on Jun 23, 2011 9:57 AMHi
Try this,
->> Create 1 UDF in Header on Outgoing Payments.
->> Create 3 Function in MSSQL Server Management.
->> Create 1 FMS in Query Generator and save as Query Manager then Assign to UDF for Amount in Words.
Create UDF in Header on Outgoing Payments.
->> Choose Tools on Top menu.
->> User - Defined Fields. -> User Manage Fields.
->> Open the User Manage Fields Widnow.
->> Payments. -> Title.
->> Select Title and Click Add button in Bottom on User Manage Fields Window.
->> Create Amount in Words UDF(Code, Discription and Type - Character) and Add the UDF.
Create Function in MSSQL Server Management.
Check this Link, (have 3 Functions in Link).
http://techcreeze.blogspot.com/2008/11/convert-amount-into-words-according-to_15.html
1st Funciton - to Convert one Digit Number to words
2nd Funciton - to convert 2 digit number to words.
3rd Funciton - to convert amt in numbers to words.
->> Open the MSSQL Server Management Window.
->> Choose your Company database and Create NEW Query.
->> Create 3 Function Queries one by one.
->> Create 3 NEW Query Tab and 1st one put the 1st Function then Run the Function. and
2nd New Query tab put the 2nd Function then Run the Function.
3rd New Query tab put the 3rd Function then Run the Function.
Create FMS in Query Generator and Save as Query Manager.
->> Adminstration.
->> Reports. -> Query Generator.
->> Open the Query Generator and put the below FMS query.
SELECT dbo.fNumToWords($[OVPM.CheckSum])
->> Assign the FMS in UDF on Outgoing Payments.
->> Auto Refresh of REMARKS.
Ex.
1. Goto the UDF and Clcik ShiftAltF2.
2. Select the SEARCH BY SAVED QUERY.
3. Assign the FMS Query.
4. Select the AUTO REFRESH WHEN FIELD CHENGES.
5. Select REMARKS.
6. Check the Display Saved Values.
Note: Check Payments should need the Remarks in Comments field because Remarks field is AutoRefresh field.
IF You will not put the Remarks in Comments field. Amount in Words will not Retrieve(Display) in UDF
Regards,
Jenny
Maybe you are looking for
-
I can not load some websites/domain names through Firefox,Chrome & Safari. It seems like a DNS caching issue to me. I have tried flusing DNS cache and changing to to public nameservers with varying success. The domains will load on other versions of
-
Acrobat will not open any documents, HELP! Thank you!
Adobe Acrobat will not open any documents, it tells me it is a trial, I click on license product and get a thank you for your Adobe Cloud subscription... but then when I try to open a pdf I get the same message it just keeps looping from trial will r
-
My 8310 Curve has a 2GB Media Card in it. Up until about 4 days ago everything was fine and had been for 1-1/2 years. My new problem is that when I attach an Excel file from my media card to a pre-written memo and try to forward it as an e-mail, ulti
-
Trouble viewing Captivate 8 published output.
Trouble viewing Captivate 8 published output. I created a course for a client who also wants a video of it. I published and I can see it on my end, but when I send them the files using DropBox, they can't open the .SWF, the Chrome.HTML, or the AVI
-
Archiving Material Master Record
Hi Friends, I have marked few materials flagged for deletion by transaction code MM06. Then in transaction code MM71, I create a variant, then maintained the variant, then I gave the start date, spool request and execute. The system shows a message "