Function Module to Convert Amount to the Right Decimal

Hi,
There is a function module that helps convert currency without decimals into the right format. For eg if the amount in BSEG table is in Taiwanese Dollars it will be displayed as 17.95 whereas the real amount is 1795.
So there is a function module which will convert the amount of 17.95 to 1795 (which can be used in a report for eg), once we pass the amount and the currency.
Any help would be greatly appreciated.
Thanks in advance.
Mick

Hello,
Make use of this sample:
REPORT ZV_CONVERT_CURR .
DATA : L_NETWR TYPE VBAP-NETWR.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
     EXPORTING
          DATE             = SY-DATUM
          FOREIGN_AMOUNT   = '10.00'
          FOREIGN_CURRENCY = 'INR'
          LOCAL_CURRENCY   = 'EUR'
     IMPORTING
          LOCAL_AMOUNT     = L_NETWR
     EXCEPTIONS
          NO_RATE_FOUND    = 1
          OVERFLOW         = 2
          NO_FACTORS_FOUND = 3
          NO_SPREAD_FOUND  = 4
          DERIVED_2_TIMES  = 5
          OTHERS           = 6.
WRITE: L_NETWR.
Cheers,
Vasanth

Similar Messages

  • Function Module to convert  amount to  amount in words

    Dear Guru ,
    I want to know is there any sap standard Function Module to convert  amount value   to  amount in words
    Thanks & Regards

    Hi..
    Use FM SPELL_AMOUNT.
    This function module converts an amount or number into words. It can be used as follows:
    Convert a number into words
    To do this, the transfer parameters LANGUAGE and AMOUNT have to be entered.
    Convert an amount into words
    To do this, the fields LANGUAGE, CURRENCY, and AMOUNT have to be entered.
    Program RF_SPELL contains a sample call of the function module. You can use it for test purposes.
    REPORT ZSPELL.
    TABLES SPELL.
    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
    DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.
    SY-TITLE = 'SPELLING NUMBER'.
    PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
    WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
    FORM SPELL_AMOUNT USING PWRBTR PWAERS.
      CALL FUNCTION 'SPELL_AMOUNT'
           EXPORTING
                AMOUNT    = PAMOUNT
                CURRENCY  = PWAERS
                FILLER    = SPACE
                LANGUAGE  = 'E'
           IMPORTING
                IN_WORDS  = T_SPELL
           EXCEPTIONS
                NOT_FOUND = 1
                TOO_LARGE = 2
                OTHERS    = 3.
    ENDFORM.                               " SPELL_AMOUNT
    I hope it helps.
    Reward pts if helpful
    Regards
    - Rishika Bawa

  • Is there any function module to convert hexadecimal format to normal decima

    Hi,
    is there any function module to convert hexadecimal format to normal decimals.
    Regards,
    Nandha.

    HI Naddy,
    simply do this..
    parameters  : num1(5) type x.
    data : dec type i.
    dec = num1.
    write : dec.
    remember to pad the input with zeros
    regards
    satesh

  • Need Function Module for convertion of  Foreign currency to Indian currency

    hi friends,
    i need function module for converting amount from
    Foreign currency to Indian currency
    thanks

    hi Venkat,
    Please use the function module CONVERT_TO_LOCAL_CURRENCY
    <b><u>Sample code:</u></b>
          call function 'CONVERT_TO_LOCAL_CURRENCY'
            exporting
              date             = p_alv_tab-begda
              foreign_amount   = p_alv_tab-kkost_p_person
              foreign_currency = p_alv_tab-kwaer                 " foreign currency
              local_currency   = l_ev_waer                           " Indian currency
            importing
              local_amount     = p_alv_tab-kkost_p_person
            exceptions
              no_rate_found    = 1
              overflow         = 2
              no_factors_found = 3
              no_spread_found  = 4
              others           = 5.
    Hope this helps,
    Sajan Joseph.

  • Function module for converting the foreign currency to words

    hi,
    can anybody tell me about the function module for converting the foreign currency to words format.
    Like 25.50 USD
    should be "Twenty Five Dollar & Fifty Sents."
    foreign currency can be anyone like USD, JPY, EUR etc.
    Regards
    Nitin Varshney

    Hi,
    Try using the FM SPELL_AMOUNT
    Check this wiki
    [SPELL_AMOUNT|https://wiki.sdn.sap.com/wiki/display/Snippets/SpelltheAmountenteredin+words]
    Regards
    Sarves

  • Is there any function module to convert the date format

    Dear ABAPers,
    Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
           I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
    Thanks & Regards,
    Ashok.

    hi,
    create custom function module or copy the below code in the report ..and use it
    the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
    FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(DATE) LIKE  SY-DATUM
    *"       EXPORTING
    *"             VALUE(FORMATTED_DATE)
    *"       EXCEPTIONS
    *"              INVALID_DATE
    TABLES: TTDTG.
    DATA: BEGIN OF T_DATE,
            YYYY(4) TYPE C,
            MM(2) TYPE C,
            DD(2) TYPE C,
          END OF T_DATE.
    DATA: DAY(3) TYPE N.
    DATA: VARNAME LIKE TTDTG-VARNAME.
    IF DATE IS INITIAL.
      CLEAR FORMATTED_DATE.
      EXIT.
    ENDIF.
    check document date format
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        DATE = DATE
      EXCEPTIONS
        PLAUSIBILITY_CHECK_FAILED = 1.
    IF SY-SUBRC NE 0.
      RAISE INVALID_DATE.
    ENDIF.
    MOVE DATE TO T_DATE.
    CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
    SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
    WRITE T_DATE-DD TO DAY.
    CONCATENATE DAY ',' INTO DAY.
    CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
      SEPARATED BY SPACE.
    ENDFUNCTION.
    the output is :--Convert a DATE field into a full format date eg. March 23, 2000
    Regards,
    Prabhudas

  • Function module to convert currency to USD

    Hi All,
                 I need the function module to convert the currency to USD and the mandatory fields to be passed to the function module.
    Thanks & Regards
    Suresh

    hi,
    Working With LSMW:
    Use TCODE LSMW
    Objects of LSMW:
    •Project – ID with max of 10 char to Name the data transfer project.
    • Subproject – Used as further structuring attribute.
    • Object – ID with max of 10 Characters, to name the Business object .
    • Project can have multiple sub projects and subprojects can have multiple objects.
    • Project documentation displays any documentation maintained for individual pop ups and processing steps
    User Guide: Clicking on Enter leads to interactive user guide which displays the Project name, sub project name and object to be created.
    Object type and import techniques:
    • Standard Batch / Direct input.
    • Batch Input Recording
    o If no standard programs available
    o To reduce number of target fields.
    o Only for fixed screen sequence.
    • BAPI
    • IDOC
    o Settings and preparations needed for each project
    Preparations for IDOC inbound processing:
    • Choose settings -> IDOC inbound processing in LSMW
    • Set up File port for file transfer, create port using WE21.
    • Additionally set up RFC port for submitting data packages directly to function module IDoc_Inbound_Asynchronous, without creating a file during data conversion.
    • Setup partner type (SAP recommended ‘US’) using WE44.
    • Maintain partner number using WE20.
    • Activate IDOC inbound processing.
    • Verify workflow customizing.
    Steps in creating LSMW Project:
    1) Maintain attributes – choose the import method.
    2)Maintain source structure/s with or without hierarchical relations. (Header, Detail)
    3) Maintain source fields for the source structures. Possible field types – C,N,X, date, amount and packed filed with decimal places.
    • Fields can be maintained individually or in table form or copy from other sources using upload from a text file
    4) Maintain relationship between source and target structures.
    5) Maintain Field mapping and conversion rules
    • For each Target field the following information is displayed:
    o Field description
    o Assigned source fields (if any)
    o Rule type (fixed value, translation etc.)
    o Coding.
    o Some fields are preset by the system & are marked with Default setting.
    6) Maintain Fixed values, translations, user defined routines – Here reusable rules can be processed like assigning fixed values, translation definition etc.
    6) Specify Files
    o Legacy data location on PC / application server
    o File for read data ( extension .lsm.read)
    o File for converted data (extension .lsm.conv)
    7) Assign Files – to defined source structures
    8) Read data – Can process all the data or part of data by specifying from / to transaction numbers.
    9) Display read data – To verify the input data being read
    10) Convert Data – Data conversion happens here, if data conversion program is not up to date, it gets regenerated automatically.
    11) Display converted data – To verify the converted data
    Import Data – Based on the object type selected
    • Standard Batch input or Recording
    o Generate Batch input session
    o Run Batch input session
    • Standard Direct input session
    o Direct input program or direct input transaction is called
    BAPI / IDOC Technique:
    • IDOC creation
    o Information packages from the converted data are stored on R/3 Database.
    o system assigns a number to every IDOC.
    o The file of converted data is deleted.
    • IDOC processing
    o IDOCS created are posted to the corresponding application program.
    o Application program checks data and posts in the application database.
    Finally Transport LSMW Projects:
    • R/3 Transport system
    o Extras ->Create change request
    o Change request can be exported/imported using CTS
    • Export Project
    o Select / Deselect part / entire project & export to another R/3 system
    • Import Project
    o Exported mapping / rules can be imported through PC file
    o Existing Project data gets overwritten
    o Prevent overwriting by using
    ‘Import under different name
    for more information follow this link.
    http://help.sap.com/saphelp_nw04s/helpdata/en/87/f3ae74e68111d1b3ff006094b944c8/content.htm

  • Need a function module to convert xstring to string in web dynpro applicati

    hi,
       need a function module to convert xstring to string in web dynpro application other than HR_KR_XSTRING_TO_STRING.
    Moderator message: please (re)search yourself first.
    Edited by: Thomas Zloch on Nov 17, 2010 5:31 PM

    Hi,
    Check the following link:
    FM to convert XString to String
    Regards,
    Bhaskar

  • Function module to convert date and time

    Hi ,
    Requirment is i want to create a file in the application server.So the file name should be in the following format.
    0XX-XXXX-YYYYMMDDHH.format.
    in this HH-hours.I need to take current date and time.so is there any function module to convert into this format.If it is not there how to create file name in this format.
    Thanks,
    MR

    REPORT  ZTEST_CONV.
    data:  time_stamp TYPE timestampl.
    GET TIME STAMP FIELD time_stamp.
    You can try with GET TIME STAMP
    But it will be in Different format.

  • Function module for converting weight unit to another unit.

    What is the function module for converting weight unit to another unit.
    I want to convert LB to KG.
    Tried with fm UNIT_CONVERSION_SIMPLE.
    INPUT                           100
    NO_TYPE_CHECK
    ROUND_SIGN                      X
    UNIT_IN                         LB
    UNIT_OUT                        KG
    But there is no output.
    Can some one help.

    The trick here is we need decalre input output with non-character data type like VBPLK-BRGEW.
    We can test using normal SE37.
    I tested and this program worked fine:
       data: UNIT_IN  LIKE T006-MSEHI,
           UNIT_OUT LIKE T006-MSEHI,
           output LIKE VBPLK-BRGEW,
           input LIKE VBPLK-BRGEW.
    input = 10.
      CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
           EXPORTING
                INPUT    = INPUT
                UNIT_IN  = 'LB' "UNIT_IN
                UNIT_OUT = 'KG' "UNIT_OUT
           IMPORTING
                OUTPUT   = OUTPUT.
      write: output.

  • Function module to convert to time stamp format

    Hi friends,
    can you tell me any function module to convert date and time to time stamp format?
    kind regards.

    Just use 
    CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.
    look at this example
    DATA:
    tstamp type timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    SET COUNTRY 'US'.
    CONVERT DATE d TIME t INTO
    TIME STAMP tstamp TIME ZONE 'UTC+12'.
    " tstamp : 19971224115500
    " (12/24/1997 11:55:00)
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
    DATE d TIME t.
    Also look at the blog..
    /people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
    Raja T
    Message was edited by:
            Raja Thangamani

  • Function module to convert value to caps ie capital

    hi
    please let me knwo function module to convert small lettter to upper case lettter
    regards
    arora

    Hi,
    Use the code below to convert into uppercase:
    Report YUPPER.
    DATA : smal1 TYPE char1 VALUE 'a',
           smal2 TYPE string VALUE 'abcdef'.
    TRANSLATE : smal1 TO UPPER CASE,
                smal2 TO UPPER CASE.
    WRITE:/ smal1,
          / smal2.
    Otherwise the FM's are:
    /SAPDII/SPP05_CONVERT_UPPERCAS
    2054_TRANSLATE_2_UPPERCASE
    AIPC_CONVERT_TO_UPPERCASE
    HR_99S_CONV_UPPER_CASE....So many
    Regds.
    Suman

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Function module to convert date format to yyyymmdd

    Hi All,
    Would like to seek for your advice. Is there any function module to convert the date format from mm/dd/yyyy to yyyy/mm/dd? Thanks in advance.
    Regards,
    Shawn
    Moderator Message: Basic date question. Thread locked.
    Edited by: Suhas Saha on Dec 30, 2011 12:44 PM

    Hi,
    Use the FM  CONVERT_DATE_TO_EXTERNAL.
    Edited by: emax nagu on Dec 30, 2011 7:53 AM

  • Need function module to convert system time to local time

    Hi Experts,
    Need function module to convert system time to local time.
    i.e country specific that to in HH:MM format.
    Thanks in advance.

    Dear Prince,
    Kindly check the following link which contains the list of function modules for date and time conversion.
    [http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm]
    Regards

Maybe you are looking for

  • Disk Utility on Time Capsule

    I have and older (non-dual band) Time Capsule and I want to reformat to extended journaled so I can use it for transferring Aperture 3.0 projects. I dimly recall using FAT32 format when I first got it (don't ask). However, the time capsule is not app

  • My iphone 4s has a box around one of the icons and i have to double click on an icon to get anything to work and it won't reset either?

    I'm no sure what to do with my phone.  I have an iphone 4s that has an outlined box around whatever icon i touch.  It won't reset either.  It also is working slow too.  I have to double click on whatever icon i'm trying to use just to get it to work.

  • IPhone 6 Plus screen rotate glitch

    Has anyone noticed that the home screen doesn't rotate and the native mail app doesn't switch to 2 columns IF you have the phone set on the "zoomed" view vs. the standard view? Try it... set your iPhone 6 Plus to zoomed view (Settings > Display & Bri

  • Apple TV and Marantz 7005 receiver

    I cannot get my ATV to show up when trying to run it through my Marantz 7005 receiver. I've tried different HDMI slots but nothing is working. Can anyone help?

  • "Demo: Order Entry Demo Application" failed to show up.

    I downloaded Wrokshop 8.1 JumpStart kit. and started Exercise#1. However, after copying demo-orderentry.zip to the target folder as directed, a File_New_Application did not see "Demo: Order Empty Demo Application" in the right-side pane. Any clue?