AMOUNT IN WORDS IN SMARTFORMS
HI All,
I need to convert the amount into words in my smartforms.
How is this achieved?
Thanks & Regards,
Murthy
Hi 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
Similar Messages
-
Amount in words in F110 (sapscript -indian format)
Hi Experts.
I have changed the F110_PRENUM_CHCK to Z110_PRENUM_CHCK .
I want the amount to be in word in indian format.
say Ten Lakh ninty thousand and fifty
But i am getting the output in "One millon .. " format
Pls give me the coding and also suggest me how to incorporate in sapscript .
Window CHECKSPL
545
Amount in words -
&'*** 'SPELL-WORD& &' and 'SPELL-DECWORD&***
Example for amount and decimal places in words
&'*** 'SPELL-WORD& ®UD-WAERS&&' and 'SPELL-DECWORD' Cents'& ***
Example for numbers in words
&SPELL-DIG06(6)&&SPELL-DIG05(6)&&SPELL-DIG04(6)&&SPELL-DIG03(6)&&SPELL-DIG02(6)&&SPELL-DIG01(7)&
Pls revert back its urgent
Thanks
Pravesh Deshbhratarsame code i used in smartform:
DATA : l_spell_a TYPE pc207-betrg,
l_local TYPE string,
w_len TYPE i.
* Internal Table Declaration
DATA : BEGIN OF t_char OCCURS 0,
char(80) TYPE c,
END OF t_char.
l_spell_a = l_amtsum.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = l_spell_a
IMPORTING
amt_in_words = l_spell
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc = 0. -
Hi,
I have a smartform based on the document type it should display the total amount in INR(Indian Ruppes) or USD(US dollars).Based on doc type how i can get the total amount in words.
If Doc.Type = 'X'
Rupees Hundred and Twenty Three Only
If Doc.TYpe = 'Y'
USD Hundred and Twenty Three OnlyHi
In the corresponding text element you have to place a alternative option in that make a condition that
doc number = 'x'.
If the condition is true means the system will go for a 'YES' Option and Place a text element and call a function module to spell the amount.
If the conditon is NO Means the system will execute the rest and as said for the above conditon here also u have incorporate the textelemt and call a function module as pass the detials as per your requirement.
Thanks and Regards
Arun Joseph -
Amount in Words using SPELL_Amount in Arabic Smart-forms
I am facing the difficulty during the step in smartform printing. Client is to have a printout in Bi-lingual (english+arabic), Arabic is printing fine. The maintenance language of smartform is arabic.
Problem arises:
I am using the function SPELL_AMOUNT to get the "Amount in Words" of Gross Value. In the print preview and printout, "Amount is words" are appearing as jumbled. for example,
Gross Value 238,476.00 SAR
Expected Amount in Words Two Hundred Thirty-Eight Thousand Four hundred Seventy-Six.
Appearing Amount in Words Seventy-Six Two Hundred Thirty-Eight Thousand Four Hundred.
Waiting for your valuable inputs.Hi,
Try the below code:
Pass the amount after Decimal to the Spell amount seperately and then concatenate the two parts of the amount.
For example : 30.60 USD
Store the amount in a character string. Split the string at decimal point using a SPLIT statement.
DATA: amount_total(10),
round(7),
dec_part(3).
DATA: dec(1) TYPE c VALUE '.',
amount_total = '30.69'.
SPLIT amount_total AT dec INTO round dec_part.
First pass variable 'round' to Spell_amount and then in the second call pass variable 'Dec_PART' and concatenate the two results.
Regards,
sirisha. -
Print Layout : Amount in Words
Hai To All,
I customize print layout of A/P Invoice on that i have some problem:
1) there iam calculating total amount.At the bottom of my page that amount should display in words.How to do that???
2) In between repetitive Area and End of Report there is no border while taking print its not looking good.
Anyone have idea about this????
Regards,
AnithaHi Ani,
For 1st question:
1. select the that field. goto Properties
2. In General Tab u can find Link to Textbox
3. In that textbox select the field-id of the Total Amount
4. Now goto Format tab, select the Amount in words check box
This is the way u can print Amount in words.
For 2nd Question:
1. select the repetitive area in Field Index window
2. Now goto Properties Window, select the Border Tab
3. there, in low textbox, put 1.
Thanks,
Suresh Yerra -
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 -
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 -
Wrong Conversion of Amount in Words in Purchase Order print out
Hi,
Please help me with the problem in printing of Purchase Order, there is an error in amount in words. For example the total amount in numbers is 93,311.30 however the amount in words will be nine million three hundred thirty-one thousand one hundred thirty.As per my understanding the amount in number was multiply by 100. Please help what i should check.
Thanks,
RichardDear,
Take the help of the ABAPER guy and check what he written in the program of the PO layout & printout.
http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
This will solve your problem
Thanks & regards.
Varun Bisaria
Edited by: Varun Bisaria on Oct 21, 2011 2:10 PM -
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 -
hi all,
I have a requirement where in i have to print amount in words. The user enters the amount in table rows, and the total in amount gets printed in another text field. I have put the code for sum in the exit event of the rows(cell) this is done through formcalc.
Now i have requirement to print the amount in words
1. Is there any function like SPELL in form calc? (i doubt there would be one...!!)
2. If there is no such funcrion, then how to implement this functionality? Can i some how call the FM SPELL in the interactive form or may be generate a event that would call FM SPELL in my WD componentand then print the result back in my interactive form?
All help will be appreciated.Hey Runal,
I haven't had much experience with Interactive forms inside WDJ, but I think this will work...
In the Submit To SAP button, this code exists...
// DO NOT MODIFY THE CODE BEYOND THIS POINT - 710.20060821084622.325745.280724 - SubmitToSAP.xfo
ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");
// END OF DO NOT MODIFY
This code triggers an event call to the backend.
What I would do is have a variable in your form that you set just before you click the button so you know what "event" you want to trigger, then of course, set it to null inside the method... when it goes back into the method in your web dynpro, you could then take the number, call the function module, and return the value to the screen.
In theory, this should work.
Hope this helps...
Cheers,
Kevin -
Check printing: Amount in words is getting jumbled
Hi,
I have a problem in displaying amount in words in check.
I am getting the amount in words through functuion module SPELL_AMOUNT correctly,i.e,(for example,110,002 ) ONE HUNDRED TEN THOUSAND TWO.
After getting the amount,i am concatenating the words 'ONLY' amount 'RIYALS'.In program it is concatenated correctly.Expected output is RIYALS ONE HUNDRED TEN THOUSAND ONLY.
But when seen on screen,the words are getting jumbled.
It is getting displayed as TWO RIYALS ONLY ONE HUNDRED TEN THOUSAND.
(Note: My form is in arabic,since i want to display vendor name in arabic,and rest of the check in english).
Please help me with some solution.
Thanks & Regards
Seshagiri.Hi Dishant,
Sorry for the delay.I am pasting the code below:
Code in print program:
Global data:
data: gv_riyals(6) value 'RIYALS', "RIYALS
gv_only(4) value 'ONLY',
gv_halalas(7) value 'HALALAS',
gv_and(3) value 'AND'.
Local data:
data: lw_dummy(25),
lw_fraction(2), "for fraction part of amount in HALALAS
lw_integer type i.
if spell-decimal is initial.
clear: spell-decimal, dg_100.
else.
lw_integer = spell-decimal / 10.
lw_fraction = lw_integer.
concatenate '(' lw_fraction '/100)'
into lw_dummy. " SEPARATED BY space.
condense lw_dummy.
clear dg_100.
dg_100 = lw_dummy.
if not spell-word is initial.
condense spell-word.
gv_spell_word(50) = spell-word. "Amount in RIYALS
endif.
endif.
call function 'WRITE_FORM'
exporting
window = 'PAY_DOC'
element = 'PAY_DOC'
exceptions
window = 1
element = 2.
if sy-subrc eq 2 and
( err_element-fname ne t042e-zforn
or err_element-fenst ne 'PAY_DOC'
or err_element-elemt ne 'PAY_DOC' ).
err_element-fname = t042e-zforn.
err_element-fenst = 'PAY_DOC'.
err_element-elemt = 'PAY_DOC'.
err_element-text = text_530.
*--Code in the script:
/: IF &DG_100& EQ ' '
L1 &gv_only(C)&,,&gv_riyals(C)&,,&spell-word&
/: ELSE
L1 &gv_riyals(C)&,,&gv_spell_word(C)&
L1 &gv_only(C)&,,&gv_halalas(C)&,,&dg_100(C)&,,&gv_and(C)&
/: ENDIF
Thanks & Regards
Seshagiri. -
I just updated pages, I can't count the amount of words with space anymore. Can anybody help me?
Yes me too, tried re setting and enabling changes but no agree button anywhere?
-
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 -
How to display amount in words for subtotal value?
Hi All,
I am diplaying a amount in words for sub-total value after each document number.
Can any one suggest how to display text for sub-total value not for Grand total?
I want subtotal at each material for each document number and want to display that subtotal amount in words.
Thanks and Regards
SteveThanks Jorge ,
Is it possible in ALV printing Sut-total text by adding a new line .?
And where to insert At new or on-chane ?
Sub-total calculating automatically not programaticall..
Regards
Steve -
Excise duty payable amount in words
hi kings
I show the tax amount split in pld's .but our customers need to show the amount in words when Excise duty comes.but when using group the value store in single variable how i show the amount in words excise duty only
Thanks & Best Regards
B.Lakshmi NarayananBy grouping u can't get excise duty,which can be displayed in words using PLD,
Better use Crystal reports to acheive this.
Maybe you are looking for
-
IMovie 09: How to export one single project
When I export as an mp4 or m4v, it actually exports ALL my projects. While viewing, if I click on the back button, it will switch to another video project. Only in QT can I export one at a time. I want to distribute only the one project not my whole
-
Firefox is taking 20+ minutes to load a page, why?
This morning, when launching Firefox, I was asked to update to the latest version of Firefox. I accepted, and everything appeared to be fine. Then it tried to update my extensions, when I noticed it got "stuck" at about halfway through. I left it for
-
Real Mess with Total Broadband Package installatio...
I ordered BT Total Broadband and Vision package in July 2012, including Home Install for the BT Vision, which I paid for. The telephone engineer and Vision engineer appointments were arranged to take place on the same day - 20/8/12. However, BT inexp
-
Update to 10.6.6 - 1GB disk space?
Hey I was wondering if every time I update to a new version of (Mac OS X 10.6.6 or 10.6.7), will this update take 1GB of my free disk space or will the update replace the current version? I have limited disk space so I dont want to update if it takes
-
I had to reinstall my operating system to fix some errors in some system files. Now I am trying to get my Final Cut Studio Apps updated to the most current versions. I can't seem to get any of them past the first update. For example my Motion was upd