Dynamic displaying of decimal points for currency field in ALV

Hi,
        In ALV output there is a currency field and displaying data of different countries. It should display decimal point according to the country's currency. But at a time it can display data of different countries.

Hi Dilip,
I think your question is about currencies with different number of digits after decimal point. If you have the currency field in the ALV row, you have to give it's name as currency reference for the value field in the field catalog.
After creating the field catalog, call a form and do something like this (change fielnames accordingly).
<pre>
*&      Form  alv_fieldcat_enhance
      Individual Enrichment of field catalog
FORM alv_fieldcat_enhance
  CHANGING pt_alv_fieldcat TYPE slis_t_fieldcat_alv.
  FIELD-SYMBOLS:
    <alv_fieldcat> TYPE slis_fieldcat_alv.
  LOOP AT pt_alv_fieldcat ASSIGNING <alv_fieldcat>.
    IF <alv_fieldcat>-fieldname(5) = 'KBETR' OR
       <alv_fieldcat>-fieldname(5) = 'SKBTR' OR
       <alv_fieldcat>-fieldname(5) = 'DMBTR'.
Company code currency
      <alv_fieldcat>-cfieldname = 'BWAER'.
Document Currency for conditions, net value and taxes
    ELSEIF  <alv_fieldcat>-fieldname(5) = 'KWERT' OR
            <alv_fieldcat>-fieldname    = 'NETWR' OR
            <alv_fieldcat>-fieldname    = 'NPAX_MWST_AMNT'.
Document Currency
      <alv_fieldcat>-cfieldname = 'WAERK'.
    ENDIF." <alv_fieldcat>-fieldname(5) = 'KBETR' or
  ENDLOOP." at pt_alv_fieldcat assigning <fieldcat_alv>.
ENDFORM.                    " alv_fieldcat_enhance
</pre>
Regards,
Clemens

Similar Messages

  • HOW to remove the decimal points for particaular field

    hi friends,
    Iam printing the quntity in decimal mode like 2.000.
      but i want to print this as only 2.
      How can i remove the the decimal in smart form..
    Iam  printing  amount as 1234.00000.
    But i have to print two zeros after decimal point..how can i remove zeros .
    appricioate for u r answers..
    regards,
    sampath kumar

    You may use the option
    field(.0) for printing the quantity
    field(.2) for printing the amount..
    Go through SAP help given below..
    <b>Number of Decimal Places
    A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
    Syntax
    &symbol(.N)&
    The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
    &EKPO-MENGE& -> 1,234.560
    &EKPO-MENGE(.1) -> 1,234.6
    &EKPO-MENGE&(.4) -> 1,234.5600
    &EKPO-MENGE&(.0) -> 1,235</b>

  • Decimal point  for Price value in  ALV Report

    HI,
    I have created ALV report,
    I have 2 price fields in ALV report
    For first field i have to display  in the below format.
    If the value of the field is 3601152 then I have to display it as 36011.52 
    For second field I have to display in the below format
    if the  value is 2494 then I have to display it as 2495.00
    else if the value is 3498.73,then I need not to do anything.
    that means If there is no decimal point, then I have to keep decimal point.
    Thanks&Regards
    RamaDevi

    HI,
    you can work with search and concatenate.
    value1 = 3601152
    search value1 for '.' .
    if sy-subrc eq 0.
      concatenate value1(5) '.' value1(2)+5 into text.
    Or value1 = value1 / 100.
    endif.
    Regards
    Nicole

  • Decimal  values for a field in ALV

    Hi,
    I created an ALV report.
    It has a field which will display the calculated value as '103,839,389'. This should be dispalyed as '103,839,389.00' with decimal value, I mean with 2 decimal places, how can this be achieved?
    Thanks,
    Kumar

    hi check this..
    use these in populating the fieldcat..
    it_fieldcat-decimalsfieldname = fieldname
    it_fieldcat-decimalstabname   = tabname
    it_fieldcat- decimals_out   = 2.
    regards,
    venkat

  • Question about decimal places for currencies

    hi ,experts ,
       here is the problem , when i use mb5s, i found the net price has been enlarged 1000 times . I  also found the data of the table EKPO has been enlarged 1000 times. So ,i check the decimal places for currencies , i found there are five decimal places , the standard system is two decimal places . 
       Does this mean that we cann't  change the decimal places in SAP?  If we can change , what should we do for configuration ? 
    Jarod

    When running OY04, you are receivingin the following message:
    Before you continue, please read the following        
    text carefully.                                       
    If you do not heed this note, you can cause
    irreparable damage to the system with this            
    transacton.                                           
    In the R/3 System tables currency fields are          
    stored as decimal figures with a variable number      
    of decimal places. The decimal point is not           
    stored in the field in the database. Instead,         
    each currency field refers to a currency key          
    field. In this transaction you assign the number      
    of decimal places to this currency key uniquely.      
    Example: If you have set currency USD to have         
    two decimal places and you post an amount of 100      
    USD, an amount of 10000 USD is stored in the          
    Do you want to change the decimal places despite      
    all recommendations?

  • Changing Decimal Places for Currencies (Table V_TCURX)

    The instance is ECC 6.0
    We need to change the decimal places for a currency from 0 to 2 decimal places. Is there any impacts of doing that?
    Also need to add some currencies which are not in the table. Is there anything need to be careful while doing this. If this table is updated, do we need to update any other tables also which may be impacted?

    Hi,
    It is not recommended that when postings have already been made, that a change in the currency be done, as amounts posted can become invalid or incorrect as a result (ie USD 100->1.00), which is most critical in production environment Please go through the note 137626 When you made changes via OY04, the effect of which is across all clients.
    To change the number of decimal places for a currency already in use, you must convert all the tables in the R/3 System that contain currency fields, so that the data integrity remains. This cannot, however, for both organizational reasons and under the runtime aspect, in a productive system.
    You must never change decimal places in a productive system if you have documents posted with this currency. Such a change could lead to inconsistencies in these documents already posted.
    In case you really decide to use decimals you may consider to use SAP conversion services for them to convert all documents aready posted as explained in note 434349.
    Additional inforamtion:
    Note No.  137626 - FAQ: Decimal places for currency codes
                     126857 - Display of amts with correct decimal places in SE16
                       53206 - Processing of currency fields
                         9574 - Currency fields on selection screens
    Regards
    Ravinagh Boni

  • Removing the decimal places of currency field

    Hi Gurus,
    I have a currency type field ( to be more specific a field like BSEG-WRBTR) .
    How do i eliminate the decimal places for this field.
    ie if the value is 345678.91, i need to make it 345678.
    Is there a standard keyword or something for this?
    Points will be given to all the helpful answers.
    Thanks,
    Nobin.

    You can use the FLOOR function to get the largest integer value without decimal.
    Like:
    DATA: W_RESULT TYPE I.
    W_RESULT = FLOOR( P_AMT ).
    Regards,
    Naimesh Patel

  • To calculate average for a currency field in alv

    Hi,
    I have a requirement in which i need to find the average of a currency field in alv. For the particular field, i'm passing the value of DO_SUM = 'C' in thr field catalog(as suggested in many threads); but I'm not able to calculate the average. it still shows me summation when i click on summation button.
    What could be the possible error??? Is there any other method we can do the same??
    Thanks in Advance.
    Jaspreet

    Hi
    U can try this way.
    *& Report  Z_DEMO_JG
    *& Display average in ALV report
    REPORT  z_demo_jg LINE-SIZE 80 LINE-COUNT 50
                                         NO STANDARD PAGE HEADING.
    TABLES: sflight.
    TYPE-POOLS: slis.
    * Data declaration
    DATA: i_flight TYPE STANDARD TABLE OF sflight,
          i_catalog TYPE slis_t_fieldcat_alv,
          w_flight TYPE sflight,
          w_catalog TYPE slis_fieldcat_alv.
    DATA: v_repid TYPE syrepid.
    * Selection screen
    SELECT-OPTIONS: s_carrid FOR sflight-carrid.
    START-OF-SELECTION.
    * Fetch data from sflight table
      SELECT *
       FROM sflight
      INTO TABLE i_flight
      WHERE carrid IN s_carrid.
      CHECK sy-subrc = 0.
      v_repid = sy-repid.
    * Build field catalog for ALV report
      PERFORM build_catalog.
    * Display ALV report
      PERFORM display_report.
    *&      Form  build_catalog
    *       Build field catalog for ALV report
    *       None
    FORM build_catalog .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = v_repid
          i_structure_name       = 'SFLIGHT'
        CHANGING
          ct_fieldcat            = i_catalog
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc = 0.
    *   For average populate 'C' as value in
    *   field DO_SUM
        w_catalog-do_sum = 'C'. " C = Average
    *   Modify record with new value
        MODIFY i_catalog FROM w_catalog TRANSPORTING
        do_sum WHERE fieldname = 'PRICE'.
      ENDIF.
    ENDFORM.                    " build_catalog
    *&      Form  display_report
    *       Display ALV report
    *       None
    FORM display_report .
      IF i_catalog[] IS NOT INITIAL.
    *   Call ALV grid
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = v_repid
            it_fieldcat        = i_catalog
          TABLES
            t_outtab           = i_flight
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
        IF sy-subrc = 0.
        ENDIF.
      ENDIF.
    ENDFORM.                    " display_report
    Edited by: meetjoe on Sep 15, 2009 7:17 PM

  • Currency field in alv grid display

    Hi,
    I am using alv grid display.I am having one currency field netprice.I want it to be displayed as blank when i am not passing any value.But it gives 0.00 when it is not having any value.How to make it blank instead of 0.00.
    Points will be rewarded.
    Regards,
    Sowmya.

    HI,
    If itab-curr  = '0.00' .
    itab-curr = ''.
    modify itab.
    endif.

  • Changing decimal places for currencies

    Hi everyone,
    I'm a complete begginer to SAP BI and I need to change a value in SPRO > General Settings > Currencies > Set Decimal Places for Currencies, but the option that I want doesn't exist.
    I need to add a new entry with the value: currency - EUR6 and decimals 6, but there is no 6 available. Can anyone tell me where can I add this or what is the table where this information is???
    Thanks in advance!
    Rogério Brá

    ok I think it works - just try and play
    This is what I did (sort of same scenario - if you get my drift)
    Currency Key MGF - translation ratio 1000:1
    Exchange rate is : 11:02750 to the Euro
    Invoice entered for 1,000,000.00
    Currency calculated as 90.68 eur
    (ie 1,000,000/(11.02750 * 1000))
    You can play aroudn with direct/indirect to ge the factors right
    But it works (I thought it did - I am qualified FICO honest!!)
    This wont get you around displaying 6 decimals - BUT it will help with currency conversion

  • Search help for currency field

    I am not able any search help for currency field , CUKY of lenght 5
    If anyone knows it please tell

    You can use the data element WAERS / refer to field BKPF-WAERS.  The search help will show up automatically as the field BKPF-WAERS, has check table TCURC.
    Also see the "Origin of Input help" column in "Entry help/ check" tab in SE11 for table BKPF, it says - "Input help implemented with check table".
    For example in tcode FB01, the currency field on the selection screen is BKPF-WAERS. The search help is displayed
    Hope it helps

  • CP7 - Show 4 (or more) decimal points for User Variable?

    Is there a way to show 4 or more decimal points for user variables?
    For some reason, I'm only showing two decimal points for user variables in Captivate 7.
    Micky

    Yeah, I was afraid of that.
    Right now, I have am dividing the values of two separate text box entry fields.  I have to calculate the values to determine if they are getting a promotion, lateral transfer or lower pay range.
    I'll figure out a workaround or just use java.

  • Negative sign for Currency fields

    Hello experts,
    If a currency field containt -Ve sign (86.47-) then, i have to move it this sign to Left sinde. I have do this as follow by moving the currency field value to Charractor field
    DATA:  w_total1 (18).
                 MOVE w_total To w_total1.
                 IF w_total1 CA '-'.
                   SHIFT w_total1 RIGHT CIRCULAR.
                 ENDIF.
                 CONDENSE w_total1 NO-GAPS.
    But don't want to move this to Chanddacter field for other pupepose. Now how can i **** the -Ve sign to left side for currency field, IF bsid-shkzg EQ 'H'.
    Thanks.

    Hi sandhya ,
    Try this :
    DATA:  w_total type string ,
          w_total1 type string.
    w_total = '1,4567.7-'.
                 MOVE w_total To w_total1.
                 IF w_total1 CA '-'.
                   SHIFT w_total1 RIGHT CIRCULAR.
                 ENDIF.
    *             CONDENSE w_total1 NO-GAPS.
                 write : / w_total1.
    Hope all your issues are fixed now .
    Regards ,
    lokesh
    Edited by: Lokesh Pattnayak on Oct 11, 2010 10:23 AM

  • Upto 4 decimal point for unit of measure

    hi,
    We have requirement to maintain upto 4 decimal point in PO and sales order quantity for unit of measure M3. Example PO quanity 0.3902 m3, sales order quantity 2.3212 m3,   SAP allow upto 3 decimal point, how to handle this 4 decimal point for unit of measure and any impact to do so ?
    best rgds,

    Dear Eric,
    To change decimal places of Materials follow this:
    IMG - SAP NetWeaver - General Settings - Check Units of Measurement
    select Units of Measurement & select required Unit of Measure & set decimal places.
    Hope this helps...
    Give points if useful...
    Thanks,
    Jignesh Mehta

  • How to increase Decimal Points for the BOM Component Quantity

    Hi All,
    While creating BOM:
    Can anyone help me to know how i can increase the Decimal points for the BOM components quantity.
    I can able to give only upto 3 decimal points, but the requirement is more than that.
    I have increased the Decimal point value to 5 in transaction Code CUNI. but still it is allowing me to enter only upto three decimal places.
    Thanks and Regards
    Khadeer

    Khadeer,
    You would be better off changing the base quantity of the parent part.  Instead of "1 EA  parent contains .00003MG of  component" you could say "100 EA parents contain .003MG of component".
    Alternately, you could use different units of measure for your parent or component parts, which would be more suitable for the 3 place decimal limitation.
    I agree with Anil in that if you elect to change the decimals from standard, you could end up with huge changes that will propagate through every module in the ERP.  In my view, there is no need of this kind of headache.
    Best Regards,
    DB49

Maybe you are looking for

  • Troubles deleting files from external hard drive!!

    I had my external hard drive plugged into my Macbook but i cannot delete any folder or file in it! There is not 'Move to Trash' option from the drop-down menu! Does this have anything to do with 'Folder Action' thing? please help! sorry i jst switche

  • Discoverer 4i Plus returns no data when using views with db link references

    I am using Discoverer 41 Plus to view reports online. When I create a worksheet based on a view, that only references local tables, everything is OK and Disco plus shows the output OK. When I create a worksheet based on a view, that references a Data

  • Ssrs 2008 export to excel and csv file

    In a ssrs 2008 report, the user will export data to PDF, excel, and CSV files. When the report is exported to excel or csv file, the user wants me to hide some tablixes. Thus can you show me code on how to export the reports to csv or excel file with

  • Balance issues

    I just discovered that when i plug in my headphones, or connect my iPod to my stereo using the headphone jack, the channels are not balanced, one side is much louder then the other. When I plug in my iPod to my roadtrip, or my altec lansing speakers,

  • Budget - K022  - PROBLEM IN CURRENT BUDGET

    Hi guys, i have an issue while entering the over all budget in KO22. When i enter over all budget the "current budget  column "is having an impact. (it is adjusting the variance amount  , but not over writing it) but my requirment is it shoudl overwr