Amount into Words in PE51
Hi,
Using PE51, net salary amount can display in words as,
pe51--> form name-->Betrg(double click)--->select RT
Table field : Betrg
Identifier: /560
Output length: 30
Convertion: 23
Eg:17,714.44 (Net Salary)
While i was doing like this i am getting the amount in words as
SEVENTEEN THOUSAND SEVEN HUNDRED FOURTEEN
But i want the output like this SEVENTEEN THOUSAND SEVEN HUNDRED FOURTEEN AND 44/100 DOLLARS
Thanks in Advance.
hi,
data: AMOUNT(20),
CURRENCY(3)
FILLER(1)
LANGUAGE(2),
IN_WORDS(900).
DESCRIBE FIELD AMOUNT TYPE TYPE DECIMALS DECIMALS.
IF TYPE EQ 'P'.
INT_AMOUNT = AMOUNT * ( 10 ** DECIMALS ).
ELSE.
INT_AMOUNT = AMOUNT.
ENDIF.
INT_DECIMAL = 0.
INT_FILLER = SPACE.
INT_FILLER+1 = FILLER.
INT_LANGUAGE = LANGUAGE.
IF CURRENCY NE SPACE.
IF CURRENCY EQ '0'. "Sicherheitsabfrage (sonst Loop
TCURX-CURRDEC = 0. "bei fehlendem Eintrag 0)
ELSE.
SELECT SINGLE * FROM TCURX
WHERE CURRKEY EQ CURRENCY.
IF SY-SUBRC NE 0.
TCURX-CURRDEC = 2.
ENDIF.
ENDIF.
INT_DIVISOR = 1.
INT_CURRENCY = CURRENCY.
DO TCURX-CURRDEC TIMES.
INT_DIVISOR = INT_DIVISOR * 10.
ENDDO.
INT_DECIMAL = INT_AMOUNT MOD INT_DIVISOR.
INT_AMOUNT = INT_AMOUNT DIV INT_DIVISOR.
INT_DIVISOR = 1000000000.
DO TCURX-CURRDEC TIMES.
INT_DIVISOR = INT_DIVISOR / 10.
ENDDO.
INT_DECIMAL = INT_DECIMAL * INT_DIVISOR.
ENDIF.
IF LANGUAGE CA 'PS'.
IF CURRENCY EQ SPACE.
INT_GENUS = 'M'.
ELSE.
IF TCURC-WAERS NE CURRENCY.
CLEAR TCURC.
SELECT SINGLE * FROM TCURC WHERE WAERS EQ CURRENCY.
ENDIF.
IF ( 'ADP/CYL/CZK/DKK/EEK/EGP/ESP/GBL/GBP/IDR' CS TCURC-ISOCD OR
'IEP/INR/ITL/LBP/LKR/MTL/MUR/NOK/NPR/PKR' CS TCURC-ISOCD OR
'SCR/SDP/SEK/SKK/SYP/TRL' CS TCURC-ISOCD )
AND TCURC-ISOCD NE SPACE.
INT_GENUS = 'F'.
ELSE.
INT_GENUS = 'M'.
ENDIF.
ENDIF.
ENDIF.
IF LANGUAGE EQ 'R'.
CLEAR TCURC.
SELECT SINGLE * FROM TCURC WHERE WAERS EQ CURRENCY.
ENDIF.
IF INT_AMOUNT(5) NE '00000'.
MESSAGE E074 WITH INT_AMOUNT RAISING TOO_LARGE.
ELSE.
INT_ZAHL = INT_AMOUNT+5.
ENDIF.
PERFORM ZIFFERN_IN_WORTEN.
PERFORM BETRAG_IN_WORTEN.
PERFORM NACHKOMMA_IN_WORTEN.
IN_WORDS = SPELL.
Similar Messages
-
Converting the amount into words in different languages
Hi All,
Is there any FM to convert the amount into words in a specific language.
SPELL_AMOUNT FM is not working for some of the languages like portuguese, etc..
Any idea on this.
Thanks in Advance.Hi,
Use the FM:
CALL FUNCTION <b>'Y_AMOUNT_IN_WORDS'</b>
Hope it helps.
Reward if helpful.
Regards,
Sipra -
Convert total amount into words
Hi
My requirement is to convert total amount into words.
For this i used function module SPELL_AMOUNT.
But its giving wrong (i.e. problem is in the paise).
I tried with other function module also, its not giving output.
how i can get exactly correct output.
Reward points if helpful.Hi
execute this code .
REPORT ZCOVERTION.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '23.45'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD ,'and', 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. " SPELL_AMOUNT
Hope this will solve ur problem
Thanks
Krushna
oputput: -
Amount into Word (i.e. 1001 one thousand one)
can some body help me to tell me that any function in Oracle which can translate any given amount into words.
regards
Zahidselect to_char(to_date(873,'J'), 'JSP') as converted_form from dual;
CONVERTED_FORM
EIGHT HUNDRED SEVENTY-THREESource:http://www.oracle.com/technology/oramag/code/tips2005/011705.html
2.Convert amount in words to amount in numbers
HTH
Girish Sharma -
Function for amount into words
hi friends,
can any one tell from which function module we can convert amount in figures into words.
input -> 50,000
output -> fifty thousands
plz. help.
it's urgentHI
use SPELL_AMOUNT
data: words type spell.
call function 'SPELL_AMOUNT'
exporting
amount = '100000'
* CURRENCY = ' '
* FILLER = ' '
* LANGUAGE = SY-LANGU
importing
in_words = words.
if words-word = 'ONE HUNDRED THOUSAND'.
words-word = '1 LAKH'.
endif.
write:/ words-word.
display amount in words (USD) including cents
convert amount in no's to words
/community [original link is broken]
<b>Reward if usefull</b> -
Converting USD amount into word
Hi,
I want to convert amount which is in USD into word i am using below FM
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = dmbtr
currency = waers
FILLER = ' '
language = langu
IMPORTING
in_words = spell
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
IF sy-subrc = 0.
now my DMBTR amount is 21960.00 which is atually 219.60 USD but in dmbtr initially amount is coming as 21960.00 and when i convert it to word it is coming as USD : TWO HUNDRED NINETEEN, AND CENTS AS SIX THOUSAND, but acutally it should be USD DOLLAR TWO HUNDRED NINETEEN AND CENTS SIXTY ONLY, it is not coming peoprly so is there any other functionn module for this to convert USD , JPY into word.
regards,
zafarHi,
Assign dmbtr to type PAYR_FI-RWBTR.
PARAMETERS: dmbtr type PAYR_FI-RWBTR.
OR
If you didnt get from this try by using type P
PARAMETERS: dmbtr type P.
Regards,
kalandar
Edited by: kalandar on Jun 16, 2010 9:48 AM -
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. -
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 -
Function Module to convert amount to amount in words
Dear Guru ,
I want to know is there any sap standard Function Module to convert amount value to amount in words
Thanks & RegardsHi..
Use FM SPELL_AMOUNT.
This function module converts an amount or number into words. It can be used as follows:
Convert a number into words
To do this, the transfer parameters LANGUAGE and AMOUNT have to be entered.
Convert an amount into words
To do this, the fields LANGUAGE, CURRENCY, and AMOUNT have to be entered.
Program RF_SPELL contains a sample call of the function module. You can use it for test purposes.
REPORT ZSPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.
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. " SPELL_AMOUNT
I hope it helps.
Reward pts if helpful
Regards
- Rishika Bawa -
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 -
HI All,
I need to convert the amount into words in my smartforms.
How is this achieved?
Thanks & Regards,
MurthyHi kan murthy ,
let say in sf the amount is sf_amt...
*Declare varibles in SF like this in global
data: v_word type spell, "structure
v_amt type string.
*Calling Function SPELL_AMOUNT in Program Lines
and Import parameters are V_AMT and Export Parameters are
*V_WORD
call function 'SPELL_AMOUNT'
exporting
amount = v_amt
currency = 'INR'
language = sy-langu
importing
in_words = v_word
exceptions
not_found = 1
too_large = 2
others = 3.
Use V_WORD Where need to print
Regards,
sg -
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 -
hi all,
i have one requirement that how can we convert
USD amount into words.
Regards
Rami ReddyUse function module
data: wa_words type spell.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = wrk_sum
currency = 'USD'
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
in_words = wa_words
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.
ENDIF.
In that form give the following coding
&WA_WORDS-WORD& ®UD-WAERS&&' and 'WA_WORDS-DECWORD' Cents'& -
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
-
Problem with printing logo in smartform.
Hi guys, We have a logo in a window, its working fine in print preview, however while printing the page data ,other than logo is comming fine on printout , but logo is not comming fine. Logo is comming like one black vertical strip on left side of pa
-
My Preview app unexpectedly quits since installing OS Lion
I recently installed OS Lion (10.7) and since this installation, I cannot open any PDF files. When I attempt to download PDFs, Preview app opens and then says it unexpectedly quit. Any suggestions?
-
Install requires applications be closed
I'm trying to install a downloaded version of Photoshop Elements 11. The installer is asking me to close applications (ElementsAutoAnalyser, PhotoshopServer, dynamiclinkmanager) that I can't locate to close. As far as I can see, they aren't open.
-
After months of working OK Time Machine is reporting "The backup was not performed because an error occurred while copying files to the backup disk". Anyone have any idea what's gone wrong?
-
Specify in exporting dump that it will not be able to have any privileges
Dears,, I need to implement the below steps and need your help 1- export hr dump file from DB1 and keep in mind that this dump after importing to a new user , must be not able to have any privileges. 2- Connect to DB2 and create user hr_test 3- If SY