Conversion of total amount in words

hi all,
i am using dev6i reports, and i have a problem that how i can convert the net amount(through formula column)in words.
for example
net amount is RS.277000/- (in words . two hundred & seventy seven only)..
thanks in advance

Hi,
By selecting the To_Char(....'JSP') will work only for the number's which have no fractional part. For that you have to use a function like below.
CREATE OR REPLACE FUNCTION Fn_Get_Num_To_Words (Num_Source NUMBER, Str_Cur_Code VARCHAR2, Str_Decimal_Code VARCHAR2) RETURN VARCHAR2 IS
      Str_Source  VARCHAR2(16);
      Str_Final   VARCHAR2(255);
BEGIN
      Str_Source := TO_CHAR(Num_Source, '099999999999.99');
      IF TO_NUMBER(SUBSTR(Str_Source, 1, 4)) <> 0 THEN
           Str_Final := Str_Final || TO_CHAR(TO_DATE(TO_NUMBER(SUBSTR(Str_Source, 1, 4)), 'J'), 'JSP') || ' BILLION ';
      END IF;
      IF TO_NUMBER(SUBSTR(Str_Source, 5, 3)) <> 0 THEN
           Str_Final := Str_Final || TO_CHAR(TO_DATE(TO_NUMBER(SUBSTR(Str_Source, 5, 3)), 'J'), 'JSP') || ' MILLION ';
      END IF;
      IF TO_NUMBER(SUBSTR(Str_Source, 8, 3)) <> 0 THEN
           Str_Final := Str_Final || TO_CHAR(TO_DATE(TO_NUMBER(SUBSTR(Str_Source, 8, 3)), 'J'), 'JSP')|| ' THOUSAND ';
      END IF;
      IF TO_NUMBER(SUBSTR(Str_Source, 11, 3)) <> 0 THEN
           Str_Final := Str_Final || TO_CHAR(TO_DATE(TO_NUMBER(SUBSTR(Str_Source, 11, 3)), 'J'), 'JSP')||' ';
      END IF;
      IF TO_NUMBER(SUBSTR(Str_Source, 15, 2)) <> 0 THEN
           Str_Final := Str_Final || ' & '|| TO_CHAR(TO_DATE(TO_NUMBER(SUBSTR(Str_Source, 15, 2)), 'J'), 'JSP') || ' ' || Str_Decimal_Code || '.';
      END IF;
      IF Str_Final IS NOT NULL THEN
           Str_Final := Str_Cur_Code || ' ' || Str_Final || 'ONLY';
      END IF;
      RETURN Str_Final;
EXCEPTION WHEN OTHERS THEN RETURN NULL;
END;Regards,
Manu.
If my response or the response of another was helpful, please mark it accordingly

Similar Messages

  • 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:

  • Alphanumeric conversion of total amount filed in Report

    Hi
    I have a requirement for an alpha numeric conversion of the total amount field in my report.Any pointers?
    Thanks in Advance
    Jyothis Varier

    Jyothis wrote:
    Any pointers?Sure.
    Please Provide sample data (With CRETAE table and INSERT statements) and expected output.
    Use {noformat}{noformat} tags for formatting your codes..
    {message:id=9360002}
    Help us to help you                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Spell amount in words

    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 Only

    Hi
    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-sap script

    hi all,
    i have one issue,
    in script the total amount in word is not comming complet
    ex. 18880
    In words-
    Eighten thousand eight hundred eight
    but in script it is printing --- Eighten thousand eight it is not piinting remaning text.
    suggest what to do,
    plz its urgent.
    Regards,
    Amit.

    Amit,
    There's no sapscript command to covert number to word, you've to do it in print program.
    In the sapscript form
    use
    /:PERFORM GET_DATA IN PROGRAM Ztest
    /:USING &amt&
    /:CHANGING &word&
    /:ENDPERFORM
    and in the Print Program
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    AMOUNT = amount
    CURRENCY = 'HKD'
    FILLER = ' '
    LANGUAGE = 'E'
    IMPORTING
    IN_WORDS = word
    EXCEPTIONS
    NOT_FOUND = 1
    TOO_LARGE = 2
    OTHERS = 3.
    Hope this helps
    VB

  • 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,
    Richard

    Dear,
    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

  • Smartform: total amount conversion to Japanese language

    Hi all,
    I am facing an issue in the smartform with the japanese language. The total amount which is calculated and dispalyed on the form is not translated to the japanese language. All the other quantity and value fields on which no manipulation is performed are successfully translated.
    Like for 1 item the value is 1,000 JPY
    2 item value is 1,000 JPY,
    The total value GV_TOTAL = value of item 1 + value of item 2
    Now this GV_TOTAL is displyed as 20.00 JPY
    Can anyone help as to how can we display the Total value correctly on the form in japanese?
    Thanks in advance.
    Regards,
    Pakhee

    Whatever the Curreny you can convert the amount to the corresponding currency by using
    WRITE <source>TO <dest>CURRENCY <currency field>.
    This will ensure you always you are printing the total value with appropriate currency.
    Thanks
    Mani

  • 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...
    Fsl

    Hi ,
    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

  • 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,
    Anitha

    Hi 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

  • Amount in words in PDF

    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

  • 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
    Steve

    Thanks 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

  • Total amount to be printed on the first page....

    Hi all,.. I have to print the total of all the line items on the first page o fthe cheque. The problem is when the line items exceed the main window of the first page , the total sum and the number in words in this case comes on the next page. What do i do????
    My Num 0971-501190837..

    Hi,
         Try to put the totals field in the BOTTOM and ENDBOTTOM.
    or
    Place Total tax and Total amount in separate footer window whose location is at the bottom of main window. Now write the code inside that window as given below.
    PF Total tax &<total_variable>.
    PF Total Amount &total_amount_variable&.
    Regards
    Krishna
    Edited by: Bala Krishna on Aug 7, 2008 5:29 PM

  • Convert Amount in Numbers into Amount in Words

    Hello everyone,
    I am tasked to draft format for our company's check printing layout using Numbers/Pages, I already did but since the existing format was just manual inputted by the users, it always resulting to typographical errors on our printed checks, particularly the 'amount in words'. May I please ask for anybody's help on how to to do this automatically:
    Amount in Figure
    Amount in Words
    1,500.50
    ONE THOUSAND FIVE HUNDRED AND 50/100
    Thanks and best regards,
    DirekRod

    Try this website I found:
    http://www.easysurf.cc/cnvert18.htm
    http://javascript.about.com/library/bltoword.htm?inum=345.76&rnum=
    I will look at how to use an Applescript to perform the conversion but I cannot get to it right now.

  • Adobe - How to make fix layout but the total amount in the main is flexible

    Hi to all,
    Need help, i am new with adobe forms and do some search but i didnt find one.
    the problem is this the main/content area is display with a box then a total at the end. Now when the document is only 1 page then the total will be display in the page 1. If document has 2 pages then the total will be shown in page 2. remeber that this total is diplay in fix postion. what i did right now is the total amount will be displayed both pages. please see details below.
    main / content area
    |   description     |         amount |.
    |   description     |         amount |.
    |   description     |         amount |.
    |                          |                     |.
    |                          |                     |.
    |                          |                     |.
    |                          |                     |.
    |                          |                     |.
    | total                   |        amount|   -
    > fix position. cant use flowed. if positioned the total will appear all pages
    thanks in advance
    regards,
    Etrafanob
    Edited by: Etrafanob on Dec 2, 2009 4:16 PM

    Hi,
      yes the layout and requirement sounds crazy thats why i have a problem on it.
    actually my master pages contains the fix box with TOTAL and TOTAL AMOUNT at the end.
    the spell word of the amount and the signatory.
    under design view i only flag the description and amount of line item flowed to trigger the second page.
    now hence the total and total amount is in fix position under master pages. it will appear on all pages.
    how will i make fix position but it will appear only on last page.
    thanks
    best regards,
    etrafanob
    Edited by: Etrafanob on Dec 2, 2009 5:17 PM

Maybe you are looking for

  • Need help in XSLT

    Hi all, I am working on xslt for the xml document which is similar to this :- <?xml version="1.0" encoding="UTF-8"?>      <soapenv:Envelope      xmlns:soapenv="peopledirectory">      *<soapenv:Header/>*      <soap-env:Body      xmlns:soap-env="prople

  • Help on searching file in a directory ??????????????????

    hi there let's say i have a directory C:/myFolder and in the folder there are several files, i need to find if "test.txt" is in this folder. should i use File class to create an instance first like the following File f = new File("C:/myFolder"); Stri

  • Design Studio : How can I expand all hierarchy at once in dimension filter

    Dear Colleagues. I am currently working on design studio. I need your advises to implement BW hierarchies in my dashboard. Is it possible to expand all hierarchy in Dimension Filter of Design Studio? I tried to expand hierarchy in data source api, li

  • Exchange Server 2013 Outlook Anywhere issue

    I am working on an issue with Outlook Anywhere in Exchange 2013 where external users cannot connect. This is a new server co-existing with an Exchange 2010 server that will soon be decommissioned. When I run an Outlook Connectivity test on testexchan

  • Power socket on logic board

    I've just put a new optical drive in a 12" 1ghz Powerbook and in the process have had a bit of a mishap...the power socket came undone from the logic board. This is the bit that connects the cable that runs from the power button to the logic board. T