SAP Script ~ Put Amount in words & amounts

HI guys: Please help me... I have a requirement where the client wants to put the amount in words on a check sap script as follows:
If the amount is 27,150.95 USD
they want "27,150 DOLLARS AND 95 CENTS"
this is a combination of amounts and words in the "amounts in words" window of the sap script
please help
thanks
Brian

Hi,
In the window where the amount is displayed in words,
add the following code:
Script:
Say you have the amt in &amt&
/: DEFINE &DOLLARS& = SPACE
/: DEFINE &CENTS& = SPACE
/: PERFORM split_amount USING &AMT(T)&
/:                                     CHANGING &DOLLARS&
/:                                     CHANGING &CENTS&
P &DOLLARS& Dollars &CENTS& Cents Only
( P can be any paragraph format you want to use.
  (T) in the AMT while passing will get your amount rid of thousand seperators)
Code should be put as follows in the Routine program:
DATA: amt(10) TYPE C, (Length specified should correspond to the total length of the amount field including the decimal)
           p_dollar(7) TYPE c,
           p_cents(2) TYPE c.
FORM split_amount USING in_tab STRUCTURE itcsy
                              CHANGING out_tab1 STRUCTURE itcsy
                              CHANGING out_tab2 STRUCTURE itcsy.
READ TABLE in_tab INDEX 1.
MOVE in_tab-value TO amt.
CHECK sy-subrc EQ 0.
    SPLIT amt AT '.' INTO p_dollar p_cents.
    IF sy-subrc NE 0.
       SPLIT amt AT ',' INTO p_dollar p_cents.
   ENDIF.  (We have two SPLIT cos we may either have dot OR comma for decimal notation. This will cover both the cases)
READ TABLE out_tab1 INDEX 1.
CHECK sy-subrc EQ 0.
   MOVE p_dollars INTO out_tab1-value.
   MODIFY out_tab INDEX sy-tabix.
READ TABLE out_tab2 INDEX 1.
CHECK sy-subrc EQ 0.
   MOVE p_cents INTO out_tab1-value.
   MODIFY out_tab INDEX sy-tabix.
Plz let me know if you have questions.
Thanks
Geetha

Similar Messages

  • Sap Script - putting dynamic height value in box command

    Hello All,
    In SAP scirpt I have to display a table which might have variable number of line items. So in box command I cannot mention the height statically.
    Is it possible to specify that dynamically like by using a variable and incrementing it every time the element is called from the loop?
    Thanks
    Indrajit

    no in SAP-SCRIPT this aint possible. But you could do this in an external perform, and have your incremented value back, tho since a external perform is beeing called from the form, the box statement might already have been interpreted.
    this again would mean that this way wouldnt work as well then.

  • Output Format for Amount in SAP Script PO

    Hi,
    In my Standard SAP Script PO Form 'MEDRUCK', all amount values are getting printed in the form 1.234.567,89 but I want them to be in the Form 1,234,567.89 .
    For doing this I have gone in T-Code SU3 and set the default decimal notation as
    X 1,234,567.89 . 
    I have also tried by giving the command
    /: SET COUNTRY 'IN'
    But still the amounts in the ouput format is coming in the same way 1.234.567,89 .
    If anyone has faced similar situation, plz tell how to change the output format of amount in SAP Script.
    Thanks and Regards,
    Nitin Gupta

    I have tried using SU3 but it's not worknig. Is their any other method also of which maybe I am not aware of?

  • Can we download SAP Script to a word document  ?

    Is it possible to download the SAP Script to a local Word documnet . and then is it possible to upload the Wrd Doc back to SAP SCript with a new Script name ..?

    Hi
    Hope it will help you.
    <REMOVED BY MODERATOR>
    want to Insert SAP ICONS into from SAP into Word document (OLE) .
    (1) Copy program DD_ADD_PICTURE into your own version called ZDD_ADD_PICTURE. Make sure
    you select all the checkboxes (including GUI Status and screens).
    (2) Paste the modified code at the end of this reply into your ZZ_ADD_PICTURE program.
    (3) Run ZZ_ADD_PICTURE for a range of Icons (e.g. enter Icon name ICON_IN* on the selection screen)
    (4) When you get the result list, type in ok-code EXPO directly in the ok-code
    field (you could also add a button for this function in the GUI status).
    (5) Download all the displayed icons as .gif files into a Windows folder
    that you have created to hold the icon .gif files (e.g. C:SAPICONS)
    (6) Now you can work with the icon files as you would any .gif file. (e.g. In a Word doc, use menu path
    Insert -> Picture -> From file.)
    Here is the code:
    REPORT dd_add_picture.
    TYPE-POOLS: sdydo.
    DATA: do TYPE REF TO cl_dd_document.
    DATA: is_displayed.
    TABLES: icont.
    DATA: BEGIN OF icontab OCCURS 0.
            INCLUDE STRUCTURE icon.
    DATA: END OF icontab.
    select-options: s_icon for icontab-name obligatory.
    SELECT * FROM icon INTO TABLE icontab WHERE locked NE 'X'
                        AND name in s_icon.
    Event Handler Definition, handling changes of GUI fonts, colors,...
    CLASS cl_my_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
          use_new_resources FOR EVENT resources_changed OF cl_gui_resources.
    ENDCLASS.
    DATA: my_handler TYPE REF TO cl_my_event_handler.
    CREATE OBJECT my_handler.
    Call Screen
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
      IF is_displayed IS INITIAL.
        SET PF-STATUS 'BRP'.
        SET HANDLER my_handler->use_new_resources.
    create document
        CREATE OBJECT do.
    fill document
        PERFORM dd_add_icon USING do.
    merge document
        CALL METHOD do->merge_document.
    display document .
        CALL METHOD do->display_document
                           EXPORTING  container          = 'HTML'
                           EXCEPTIONS html_display_error = 1.
                                           " do some exception handling ...
        is_displayed = 'X'.
      ENDIF.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.                       "Beenden
          LEAVE PROGRAM.
        WHEN 'PRN'.
          CALL METHOD do->print_document
                  EXPORTING reuse_control = 'X'.
        WHEN 'PRN_NEW'.
          DATA text TYPE sdydo_text_element.
          CALL METHOD do->initialize_document.
          text = 'Dies Dokument wurde speziell fürs Drucken erstellt!' &
                            ' Druckdatum: '(500).
          CALL METHOD do->add_text EXPORTING
                               text         = text
                               sap_fontsize = cl_dd_area=>large.
          WRITE sy-datum TO text DD/MM/YYYY.
          CALL METHOD do->add_text EXPORTING text = text .
          CALL METHOD do->new_line EXPORTING repeat = 2.
          PERFORM dd_add_icon USING do.
          CALL METHOD do->merge_document.
          CALL METHOD do->print_document.
        WHEN 'EXPO'.
          CALL METHOD do->export_document EXPORTING to_filesystem = 'X'.
      ENDCASE.
      CLEAR sy-ucomm.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Form  DD_ADD_ICON
          text
    FORM dd_add_icon USING p_do TYPE REF TO cl_dd_document.
      DATA ta TYPE REF TO cl_dd_table_element.
      DATA col1 TYPE REF TO cl_dd_area.
      DATA col2 TYPE REF TO cl_dd_area.
      DATA col3 TYPE REF TO cl_dd_area.
      DATA text TYPE sdydo_text_element.
    set Heading
      text = ' Bilder in Dynamischen Dokumenten'(001).
      CALL METHOD p_do->add_text EXPORTING text = text
                                      sap_style = 'heading'.
      CALL METHOD p_do->new_line.
      CALL METHOD p_do->new_line.
      CALL METHOD p_do->add_table EXPORTING with_heading    = 'X'
                                          no_of_columns     = 3
                                          width             = '100%'
                                          IMPORTING table   = ta.
    set columns
      text = 'Ikone'(011).
      CALL METHOD ta->add_column EXPORTING heading  = text
                                 IMPORTING column   = col1.
    fill table
      LOOP AT icontab.
        SELECT SINGLE * FROM icont WHERE langu = sy-langu
                                   AND   id    = icontab-id.
        CALL METHOD col1->add_icon EXPORTING sap_icon = icontab-name
                                             sap_color = 'LIST_GROUP'.
      ENDLOOP.
    ENDFORM.                               " DD_ADD_ICON
    CLASS cl_my_event_handler IMPLEMENTATION.
    CLASS cl_my_event_handler IMPLEMENTATION.
      METHOD use_new_resources.
        IF is_displayed EQ 'X'.
    initialize document
          CALL METHOD do->initialize_document.
    fill document
          PERFORM dd_add_icon USING do.
    merge document
          CALL METHOD do->merge_document.
    display document
          CALL METHOD do->display_document
                              EXPORTING reuse_control        = 'X'
                                        reuse_registration   = 'X'.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    Edited by: Alvaro Tejada Galindo on Feb 18, 2008 6:22 PM

  • Problem in form output(sap script)

    hi all ,
    iam not getting vertical line in a box in the sap script put even thuogh i have declared it in the main window
    for the first only iam not getting the verical lines in the  main window  n getting the  vertical lines in the pages other than page1 in the  main window.

    Hi,
    You can get a Vertical Line using the foll eg in the Script:
    /: BOX XPOS '12' CM YPOS '10' CM WIDTH '0' CM HEIGHT '18' CM FRAME 10 TW
    keeping the Width as 0 will create a box with width 0 which will be a vertical Line,
    when you will use this code it will automatically appear in the other pages as weel when you use this main window.
    Regards,
    Sunil

  • SAP Script Wrod template

    I am trying to add a couple of new columns to a grid being output in SAP script.  The particular SAP script is using the word editor and there appears to be some default tabs included in the word template.  So I am unable to add new tabs to this grid.
    The template includes 4 tabs positioned on the word editors ruler and anything I add is simply ignored and it returns to the 4 tabs postions already there.
    Does anyone know how this is maintained?

    It turned out the tabs were linked to the paragragh format, I was looking at the worng one.  Doh!

  • 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

  • SAP Script(calling FM to spell the amount in words)

    Hi Friends,
        I am getting error in calling a function module(HR_IN_CHG_INR_WRDS : To spell the amount in words) to a script form.It is giving a dump message : "Conversion type error".
    Could you guide me with small example ?
    I will reward for usefull responses.
    Pls. treat it as urgent.
    Thx in Adv.
    Bobby

    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
    sreelakshmi

  • SAP Script : Amount in Words

    Dear All,
    I am working on bank Check, I need to print the amount value in Words. Amount field  &REGUD-SWNES&, I need to print this amount in words.
    I mean to say that, regud-swnes = 1000.69, I have to print this as One Thousand and 69/100. please advice me, how Can I do that.
    Thanking you.
    with kind Regards
    Venkat.

    hi venkat,
    split the command at decimal and u can design ur code for 69/1000.for displaying 1000 u can use the fm 'SPELL_AMOUNT'.
    sample:
    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.              
    reward if helpful.
    regards,
    keerthi.

  • 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

  • Struggling with Comma for an amount in sap script

    Hi Experts
    I am strugling with comma for an amount in sap script .
    For ex: 1234.56  and i need 1,234.56
    I tried  system->userprofile->owndata->Default(Tab)->Decima Notation 1,234,567..89(Selected)
    and i did use /:Edit Mask Field name  but i am not getting comma.
    Thanks & Regards
    Reddy

    Hello,
    In the driver program, assign the amount to a variable of type P and use that variable to display in the script. You will get the commas.
    Vikranth

  • Comma not seen in the amount value in SAp Script

    Hi,
    I am printing the folllowing values which contain amounts in SAP Script.
    <Z>Sum total,,,,,,&REGUD-SWRBT(13)&,,&REGUD-SWABZ(9)&,, &regud-swnet(13)&</>
    Both the values are printed as the following
    REGUD-SWRBT  = 20000,000.00
    regud-swnet         = 20000,000.00
    I want the same to be printed as below.
    (ie the comma seperator to be printed in the second set of 3 zeroes as well)
    REGUD-SWRBT  = 20,000,000.00
    regud-swnet         = 20,000,000.00
    Can any one suggest me please.
    Thanks !!
    Regards

    Hi Adarsh,
    Actually the problem here is that the field length of the field SWRBT is only 13 and the extra comma you want, can not be accommodated there.
    You will have to declare a variable of about 14-15 field length and then
    pass this value in it. Definitely the comma will appear.
    Hope this is Useful.
    Thanks,
    Daya.

  • Reduce decimals in amount in sap script

    User wants to limit the number of zeros in the decimal places, e.g., if the number is 352.0000 he wants it to print only 352.00. 
      Is there some kind of special code that can be used to accomplish this in sap script, please help me with this.
    Thank you so much for your time.

    hi thanvi,
    use &VALUE(Z)& for suppressing zeros. pass  as &VALUE(.2)& to set decimals two only
    check this link.
    To suppress zero after thousand separater in SAP Script

  • 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

  • Amount in words with 'AND' in between.

    Hi All,
    I have a requiremnt where in i neeed to convert my amount to words and display in SAP script.
    I can use the FM SPELL_AMOUNT.This will give the result in words.I need to have the AND in b/w these.
    eg:123456789
    result:ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND SEVEN HUNDRED EIGHTY-NINE.
    My requirement:ONE HUNDRED AND TWENTY-THREE MILLION FOUR HUNDRED AND FIFTY-SIX THOUSAND SEVEN HUNDRED AND EIGHTY-NINE.
    Any pointers would be appreciated.

    Hi,
    DATA: w_words(200).
    After calling FM USe: Concatenate IN_WORDS-WORD 'AND' IN_WORDS-DECWORD into W_WORDS. Now W_Words Will contain the string you required.
    Regards
    Raju Chitale

Maybe you are looking for

  • InDesign CC Server 2014 app.open() File does not exist.

    I've set up InDesign CC Server 2014 trial on a Windows Server 2008 R2 and trying to run a simple script that converts a idml to PDF. Here's the code document = app.open(File("C:\inetpub\wwwroot\presentation\Documents\Resumes.idml")); document.exportF

  • A Non english  music store in Itnues

    Hello, I don't know how, but somehome my Itunes is taking me to a non english music store. How can I change it? Tanks Pentium   Windows XP Pro  

  • BAPI Error in creating quotation

    Hi all, In BAPI ' BAPI_QUOTATION_CREATEFROMDATA2', I given all manditory parameters ( QUOTATION_HEADER_IN -import parameter and QUOTATION_PARTNERS - tables ). But If I execute, its returning below messages. Please enter sold-to party or ship-to party

  • HT1296 i'm using a new computer to sync my iphone, will i lost all my data?

    Hi Sir/Mdm, I bought a new computer, and i wanted to sync my iphone4 to my new computer. However i realized it never sync like how it used to be with the old computer that i had. My concern is how to keep my datas and sync to my new computer? Thank y

  • FAN event on OCI (11.2.0.2) on Win32

    Hello guys, We are developing OCI 11.2.0.2 based client with FAN event handler on Win32 (in C not C++). Some how when we compile our code on windows the callback doesn't get any FAN event. The same code complied on linux gets FAN events we expect. Wh