Currency field with Decimals in ALV

Hi,
Im having a problem with display of currency field wityh decimals.
My currency field is declared as type  dmbtr ( whis is currency field data element in standard).
I have some amount say 1589.00 which is Korean currency. But this Korean currency doesn’t have any decimals.
(My source field is always 2 decimals irrecpective of curency. It will store as below,
if value 100 JPY--> TABLE STORE 100.00
         200 SGD --.> 200.00
         500 KRW  --> 500.00
sO MY source field always maintained with 2 decimals)
In alv im using the  currency field so that it displays the correct decimals.
      wa_fcat-cfieldname  = 'WAERS'.
      wa_fcat-ctabname    = 'IT_FINAL_ALV'.
      wa_fcat-datatype = 'CURR'.
Now IN alv it displays 158,900 which is not correct.
My requirement is I have display this value as 1589 for Korean currency(as it doesn’t have any decimals)
( I observed that the value is always stored with 2 decimals in database field)
if value 1589.00 and output currency is JPY(japan) IT HAS TO Display 1589.000.
Can anybody give any hint..?
Message was edited by:
        agrud agrud

please  try like this  it should work..
fieldcatalog-fieldname   = 'NETPR'.
  fieldcatalog-seltext_m   = 'Net Price'.
  fieldcatalog-col_pos     = 7.
  fieldcatalog-outputlen   = 15. 
  fieldcatalog-do_sum      = 'X'.        "Display column total
  fieldcatalog-datatype     = 'CURR'.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
reward  points if it is usefull .....
Girish

Similar Messages

  • Display Currency symbol with value in ALV Report

    Hi Experts,
    I need to display currency symbol with value in ALV Report like if currency type is dollar then $200.
    Here I am using field catalog type slis_t_fieldcat_alv and suing field merge catalog FM: 'REUSE_ALV_FIELDCATALOG_MERGE'
    I tried like this
        IF <fs_fieldcat>-fieldname = 'STPRS'.
          <fs_fieldcat>-seltext_s = 'Std Cost '.
          <fs_fieldcat>-seltext_m = 'Std Cost'.
          <fs_fieldcat>-seltext_l = 'Std Cost '
           <fs_fieldcat>-tabname = 'MBEW'.
          <fs_fieldcat>-ctabname = 'T001'.
          <fs_fieldcat>-cfieldname ='WAERS'.
          <fs_fieldcat>-datatype = 'CURR'.
        ENDIF.
    Please any one can suggest the solution for this.
    Advance Thanks.
    Regards,
    Bala Achari

    Hİ,
    Check this link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=24379571
    Take care.
    Çağatay

  • How to add Currency field with dropdown on screen layout (module pool)

    I need to add a field called <b>Currency( field label )</b> with <b>dropdown (like SKB1-WAERS). </b>
    The <b>field label</b> and <b>input output field </b> should default as being hidden and
    sould be visible only when other field value ( on the same screen ) should match with the value in the database table . 
    Could you please suggest me how to create dropdown
    and give this functionality with coding ?
    Thanks in advance.

    Hi,
    In the field attributes of the SKB1-WAERS..in the group attributes..give a group name G1..Add the same G1 for the field lable also.
    Then in the PBO of the screen..
    ***Check the conditions..when other field value (on the same screen) matches
    ***with the value in the database table.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'G1'.
        SCREEN-INPUT = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    Thanks,
    Naren

  • Format Currency field with $ sign and condense

    I want to format the currency field output by appending '$' sign to it and removing the gaps so that the '$' sign occurs immediately before the amount. Can anyone tell me how to do it so that it displays like given below in ALV. Thanks.
    Before                    
       $____25.00           
      $__130.00        
    $___1000.00       
    After
    $25.00
    $130.00
    $1000.00
    Edited by: Sheetal on May 27, 2009 12:23 PM

    Hi Sheetal,
    You can try this-
    1) copy currency field to a text field.
    2) Append $ to the field. CONCATENATE can be used on text fields.
    3) Remove any spaces by using CONDENSE.
    Of course you can combine step 1 and 2 depending on the logic you choose.
    There are of course many other ways and you may have found out some yourself. The above steps can help.
    Regards,
    Nimish

  • Custom Table Currency field with 5 decimals

    Hello,
    I have created a custom table and it has a field for 'US Plan Cost'. The users wanted it with 5 Decimals. I have created a custom domain and custom data element of DEC Type with 5 Decimals.
    Domain: ZCOST: Data Type: DEC, No. of Characters: 11, Decimal Places: 5.
    However When I am trying to create entries in the table though, it's giving me error: Input must be in the format _____,_____,_____,_____~._____
    The entry that I am creating is: 1.23450.
    I dont know what went wrong? Can anybody please help me?
    Thanks Much.

    Are you doing this with SM30?  or from a program?  If a program, be sure your data value is precisely '1.23450'. It sounds like you're inputting something else...
    Or, post code?

  • Currency Conversion with Decimals

    Hi Experts,
    I want to convert an amount from USD to EUR in a routine.
    Therefore I am using the function module CONVERT_TO_LOCAL_CURRENCY.
    The result is always an integer, the decimals are missing.
    I also tried to use decimal values as input, 100.1 is interpreted as 1001000 and the function module dumps when I use 100,1
    Is there something wrong, or is there another function module I can use?
    Regards
    Markus

    Thank you both.
    Doing the calculation by myself might be a workaround, but I would like to use standard function modules, so that I don't have to implement the treatment for inverse exchange rates or factors by myself. There has to be something to use.
    The problem is not my key figure, since the result is the same if I directly debug the FM convert_to_local_currency.
    In this FM, the include lscunf02 is called, putting the result into euro_amount of type p, so no decimals.
    So any other idea for using an existing function module?
    Regards
    Markus

  • Decimal field prob on editable ALV

    Hello everyone,
    I have a field referring to standard data type TB_BZBETR which is currency field with CURR and 2 decimal places, is a editable one in ALV. When trying to enter any value first its displaying like 0.00 and then when i enter any value like 22 it is storing like 0.22 and when i try to enter like 22.22 it is not allowing me saying that decimal places not allowed. The only way i can enter is not giving point '.' in between like if  2224 is entered then it is storing like 22.24.
    What wud be the prob please help me.
    Thanks.

    as ABAP does not store decimals, the amount values are interpreted according to the decimals in the currency.
    I have a field referring to standard data type TB_BZBETR which is currency field with CURR and 2 decimal places,
    The default is 2 decimals, but some currencies like JPY, MEX are usually defined without decimals. So make sure your amount field is linked to a currency field via the ALV field catalog and maintain this field with the appropriate currency.
    regards,
    JNN

  • Currency field in Generic Data Source

    Hi All,
    I have a case here, where i have few Amount field in my Generic Extractor which is based on a table ZXXX.
    Now the key figures have 0currency appended in theie currency tab which is coming from table ZYYY, now while saving the data source is giving error that the extract structure is not proper, reason being the base table has no currency field and the kf's need to have one currency field to assign to it which is coming from some other table.
    One sloution is create an FM based extractor, but we dont want that.
    Can any one suggest any work around without any FM or View??
    Thanks,
    Neha.

    if your table have currency field with different reference table and field mean
    you have to create view
    Diagnosis
    You tried to generate an extract structure with the template structure eg:XXXX(table). This operation failed, because the template structure quantity fields or currency fields, for example, field XXXX(fileld) refer to a different table.
    Procedure
    Use the template structure to create a view or DDIC structure that does not contain the inadmissable fields.
    1.Create the view
    2.Add the currency field and currecy key field also
    3.Create the generic data source in RSO2
    Regards,
    G

  • Urgent : Problem with Editable  ALV Grid  for Quantity and Currency Fields

    Hi All,
    I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
    When user changes these values these values are not changing properly .
    For the quantity field the domain is MENG13 with 3 deciamal places and here  if we enter 500 it takes it as 0.500   .
    The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
    Here also it takes last 2 digits after decimal places by default.
    Please advice how to get proper values in this case from ALV editable fields.
    Thanks and Regards
    Harshad
    Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AM

    for all the currency field , it will display like that only.
    u have to manipulate uin program before displaying.
    if they are giving 500, in program multiply with 100 and move it to table.
    when u are getting from table, divinde and display.
    this is what I am doing.
    Reward if helpfull.

  • Problem with currency fields in alv while editing

    hi guys,
    while creating the editable fields and saving the data in database i have problem with currency(price fields),
    when iam entering 10000 it is storing as 100.00 in database but
    i want to store it as 10,000.00
    can any one help me ....
    it is urgent
    thanks..

    When populating the fieldcatalog for ur currency amount field then
    populate these additional fields with currency key and table name where this key field belongs.
             cfieldname     type slis_fieldname, " field with currency unit
             ctabname       type slis_tabname,   " and table
    May be then it will solve ur prob.
    Regards,
    Joy.

  • Problem of currency field in ALV grid

    Hi,
       Actually I am working on ALV gird editables. I have passed the CURR 17,2 type to the i_fcat table. But when I am trying to edit a new value to this field with a new value. i.e. '12345' it takes its value as '123.45'. and whenever I am entering a value '123.45' it gives error message that decimals 0 place. I am not able to make out this problem.
         Even while I am doing get_cell_value, I am getting its returning 0.00 as e_value.
          Any help in this regard will be helpful to me...
    regards,
    Brijesh Patel

    Hi Brijesh,
    Are you using the FM "REUSE_ALV_GRID_DISPLAY" to populate field catalogue? if so, define this in your field catalogue for that particular field.
    g_t_fieldcat-CFIELDNAME = 'X'
    where <b>g_t_fieldcat</b> is your custom defined field catalogue. CFIELDNAME here refers to that column in the field catalogue as currency field and SAP automatically adjusts the decimal places.
    Hope this helps and let me know if you need more details.
    Regards,
    Vicky
    PS: Award points if helpful

  • 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

  • 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

  • OOPs ALV report Fieldcatalog Editing a currency field

    Hi all,
    I have created an OOP's ALV report. I have made one of the currency field editable. when I am changing the value in any cell and go out of the cell(or move to other cell using arrow keys or click some were in the grid) it is taking '.' after 2 digits from the right.
    for example if I take 10 it is converting to 0.10, if I take 100 it is becomnig 1.00, if I take 100.00 it is becoming 1.00. If I take 123.45 I am getting a pop up box with message "Too many decimal places"
    the fieldcatalog values are as follows
      WA_FIELDCAT-FIELDNAME   = 'ORD_VAL'.
      WA_FIELDCAT-SCRTEXT_M   = 'Ord Value'.
      WA_FIELDCAT-COL_POS     = 11.
    wa_fieldcat-no_zero     = 'X'.
      WA_FIELDCAT-OUTPUTLEN = 14.
       WA_FIELDCAT-CURRENCY  = 'INR'.
      wa_fieldcat-decimals_o = '2'.
      wa_fieldcat-no_zero = 'X'.
      WA_FIELDCAT-EDIT   = 'X'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR  WA_FIELDCAT.
    Can anybody please help me. As If I edit the field it should take the values what I input.
    Thanks in Advance.

    Hi ,
    The CURR field is the currency unit field in the table ITAB.
    I am just confused with your answer. in my case the final internal table is T_CHKQTY1 shall I take that or anything else. I have taken WA_FIELDCAT-CTABNAME = 'CURR'. but the system is thrownig an error as The data object has no component with CTABNAME but there is a component called TABNAME.
    Can you please currect me.

  • Dump when changing the value for a field (of 13 decimals) in alv grid.

    Hi Group,
    Its giving a dump when user is trying to change the value.
    dump description: Unable to interpret "70,000 " as a number.
    what is happening here is, the original value is 50,000 and he is deleting 5 and replacing it with 7, here its throwing the dump.
    If he removes the complete number 50,000 and then gives 70000 its  taking the value.
    I tried to use, the decimals options in alv field catalog but to no joy.
    Please can you give me an advice on this.
    Many Thanks.

    the problem is the comma in the 70,000....that's an alpha character.... Normally, we expect SAP to display numeric fields in a appropriate format, based upon their numeric type, but trying to forcibly insert '70,000' into a true numeric-type field can generate an 'unable to interpret xxx,xxxx  as number' error.
    You could experiment with changing your ALV column to a char17 (or appropriate width) and putting your numeric value into that to display, then converting back to type P, or other field type in the table, in a column that is not displayed, when the user changes the value....  essentially two columns, one not displayed with a routine to copy/convert the numeric field into the alpha field and the reverse when the field is changed.
    But, the better solution is probably for the user to understand that they're seeing a formatted numeric field, and that they need to replace the entire value with the only possible punctuation being a decimal and (if necessary) a negative sign.

Maybe you are looking for

  • Crystal Report print to PCL file needs to contain searchable text

    Hi, I am using VS(2005) and Crystal Report XI R2 .net Service pack 4.  I need to be able to create a pcl file that contains text information on the first page that needs to be parsed and read by another application.  However, I am not able to use a g

  • Creative Cloud App just showing blank white box! Cannot install Photoshop

    I'm trying to install a Photoshop trial - have followed instructions to install the CC app. The icon appears on my desktop and a Creative Cloud folder appears in my Explorer folder but when I click on the CC app, all I see is a white box. Occasionall

  • Several ranges in a query

    Is it possible to allow the end user to specify several ranges in a query variable? Standard variable types are : single value, several values and range, so I think it could not be done directly. But maybe this problem is common and a good solution a

  • How to configure for CPU usage

    I installed two virtual servers in one host that installed VM Server, is there any way to assign only 30% at mot of cpu usage to the first virtual server while the left 70% cpu usage to the second virtual server

  • Do I need a newer Version

    I currently have DTS.NLM ZENWorks Transaction Server Version 2.02.06 January 31, 2005 I am getting abends on this. Is there a newer version and if so where can I get it. Thanks Scott pgator17