No decimals in ALV

Hi,
I am populating field quantity (13+3 decimals) in ALV.
I want it to appear without decimal places.
how should i get rid of it?
there is a field called 'decimals_out' in ALV field catalogue. How to use this..? I am passing '0' in that but its not working for me..
Reply quickly,
Regs,
Ags..

Here is code: 
PERFORM populate_fieldcat USING:
   'MOQ'           'GI_ALV_OUTPUT' text-038   ' '  '15' ' ',
   'AUMNG'         'GI_ALV_OUTPUT' text-039   ' '  '15' '0'.
*&      Form  populate_fieldcat
      Subroutine to populate the field catlogue
FORM populate_fieldcat  USING  fv_fnam
                               fv_tabnam
                               fv_headtxt
                               fv_nozero
                               fv_length
                               fv_decimals.
  CLEAR gw_afield.
  gw_afield-fieldname         = fv_fnam.
  gw_afield-tabname           = fv_tabnam.
  gw_afield-seltext_l         = fv_headtxt.
  gw_afield-no_zero           = fv_nozero.
  gw_afield-outputlen         = fv_length.
gw_afield-decimals_out      = fv_decimals.
IF fv_fnam = 'SCMNG' OR
    fv_fnam = 'AUMNG'.
    gw_afield-decimals_out = '0'.
   gw_afield-datatype     = 'QUAN'.
ENDIF.
  APPEND gw_afield TO gi_fieldcatalog.
ENDFORM.                    " populate_fieldcat
I am passing  gi_fieldcatalog to FUNCTION 'REUSE_ALV_GRID_DISPLAY':---
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_bypassing_buffer       = 'X'
      i_buffer_active          = ' '
      i_callback_program       = lv_report
      i_callback_pf_status_set = gc_status
      i_callback_user_command  = gc_user_command
      i_callback_top_of_page   = gc_top_of_page
      is_layout                = gw_layout
      it_fieldcat              = gi_fieldcatalog
      it_sort                  = gi_sort
      i_save                   = gc_save
      is_variant               = gw_variant
      it_events                = gi_events
    IMPORTING
      e_exit_caused_by_caller  = gv_exit_caused_by_caller
      es_exit_caused_by_user   = gw_exit_caused_by_user
    TABLES
      t_outtab                 = gi_output
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.
  IF sy-subrc <> 0.
    MESSAGE s010 DISPLAY LIKE gc_e.
    LEAVE LIST-PROCESSING.
  ENDIF.

Similar Messages

  • How to remove decimals in ALV

    How to remove displaying decimals in ALV report(using FM) ?

    HI Sri,
       Pass the values into a variable of type i.
    data : var type i,
             var1 type f value '2.111'.
        var = var1.
    or else
    change the field catalog this way ..
    <b>lv_cat-decimals_out = '0'.</b>
    Regards,
    Santosh

  • Problem in displaying decimals in ALV

    Hello Everyone,
    I am facing problem in displaying decimals in ALV
    Here i want to display 1.00000- but is displaying as 1,000.00-
    Is there any solution by not using REPLACE and changing the user settings. Please let me know. <removed by moderator>
    Thanks in advance.
    Radha.
    Edited by: Thomas Zloch on Dec 12, 2011 6:23 PM

    - If this is a currency amount or a quantity, did you correctly define the link to currency code or quantity unit of measure ?
    (Many available documents to read like [Value Display with Currency/Quantity Unit|http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649b1f17411d2b486006094192fe3/frameset.htm])
    - If this is not such a field, but a basic numeric type, did you try to fill DECIMALS_O in the field catalog ?
    Regards,
    Raymond

  • Hide decimals in ALV

    I want to hide decimals in ALV report. I have written next code.
    WHEN 'EXI_PP'.
            t_alv_fieldcat-col_pos   = 5.
           t_alv_fieldcat-datatype  = 'QUAN'.
            t_alv_fieldcat-decimals_out = 0.
            t_alv_fieldcat-reptext_ddic = 'Exis. GT'.
            t_alv_fieldcat-do_sum       = 'X'. "Realizar suma
          WHEN 'EXI_CUA'.
            t_alv_fieldcat-col_pos   = 6.
            t_alv_fieldcat-decimals_out = 0.
            t_alv_fieldcat-reptext_ddic = 'Exis. ZF'.
            t_alv_fieldcat-do_sum       = 'X'. "Realizar suma
             MODIFY t_alv_fieldcat .
    But report still showing decimals . some body could  help me please?????

    Hi,
    Try this way
    t_alv_fieldcat-datatype = 'QUAN'.
    t_alv_fieldcat-decimals_out = 0'.

  • 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

  • NO Decimals in ALV Using FM

    Hi,
    I want to Display Quantity fields (AFVV-LMNGA) with no decimals in ALV. I have used DECIMALS_OUT = 0.
    But it is not working.
    Can any one help me.
    Thanks,
    Kishore

    Hi Kishore,
    Have you added datatype along with your decimals_out.
    wa_fieldcat-datatype = 'INT4'.  "any data type that you are using.
    add the above in your field calalog and test.
    Cheers!!
    VEnk@

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

  • How to remove the display of DECIMALS in ALV? Any Falg?

    Hi Experts,
    One simle dount that, I am getting some values in some fields as 12.34; 11.22 etc - 2 decimals, but, am looking to hv as 12; 11 - NO DECIMALS.
    So, I looked any flag in Fileds catalog, Lay out in SLIS, but, did not find any flag?
    now, am getting it by moving to a P type field.
    But, pls.  let me know that How to get it done in ALV w/ SLIS? wht is the flag?
    thanq

    Check the field catalog, there is a field called  decimals_out,  set this to 0(zero).
    Regards,
    Rich Heilman

  • Problem in hiding decimals for ALV reprt

    I am trying to hide decimal in ALV report. following is  part of a code which I have written. I have checked gt_fieldcat in debug, fieldcat is updated with value for ls_ftcat-decimals_out. But somehow report is still showing decimals.Please help...?
    FORM modify_fieldcat .
      DATA: ls_ftcat TYPE slis_fieldcat_alv.
      IF gt_fieldcat[] IS NOT INITIAL.
        LOOP AT gt_fieldcat INTO ls_ftcat.
          CASE ls_ftcat-fieldname.
             WHEN 'TOT_COST'.
              ls_ftcat-seltext_l = 'TOTAL COST PER UNIT'.
              ls_ftcat-ddictxt   = 'L'.
              ls_ftcat-just = 'R'.
              ls_ftcat-decimals_out = '0'.
              MODIFY  gt_fieldcat FROM ls_ftcat.

    Hi prafulla,
    instead of giving
    <b>ls_ftcat-decimals_out = '0'.</b>
    Give this way
    <b>ls_ftcat-DECIMALS_O = '0'.</b>
    It will show you ALV control number of decimal places for output.
    regards,
    venu.

  • Require editable quantity value without Decimals in ALV display

    I'm displaying  the ALV with quantity in editable mode where the end user gives the quantity value.I need to restrict the user to give the value as a whole  number i.e without decimals. How can we do it in ALV. I tried the same by giving the field as type 'N' but still, i can give the value  with decimals. It is showing an error since this being an interactive ALV, on clicking the button,the proceess is taking value. Would you guide me
    Thanks
    Ravindra

    Hi,
    In the fieldcatalog you should have a field decimals_out, you can set the output decimals there, try setting it in 0.
    Hope it helps.

  • No decimals in ALV presentation

    Hello everyone,
    I have an ALV that shows 40 columns with quantities. The ALV is referenced to a specific structure created in SE11 that has all 40 fiels of type MENGE1.
    The quantities shown are allways going to be integers, so i don't need the 3 decimals that type quantity has. How can i hide them ?
    I tried field decimals_out in fieldcatalog, but probably i'm not doing it right...
                   Can anyone help me ?
                                  Thank you in advance,
                                             Nuno

    Hello Always Learner,
    So, that means i would have to add 40 new fields to my structure of type p decimals 0. Isn't there a way to just hide the decimals with a loop in the form that creates the field catalog?
    I'm trying to avoid to modify the structure created bu other developer and used in other programs.
    Edited by: Nuno Santos on Mar 12, 2009 12:07 PM

  • ALV column with variable number of decimals to be displayed

    Hi,
    I've an ALV where I need to display a numeric column with a variable number of decimal row-by-row, from 0 (no decimals) to 4.
    I've declared the numeric field as TYPE P DECIMALS 4.
    I've tried with DECMLFIELD in ALV catalog, and this works for 1 to n decimals, but when  I leave the field indicated in DECMLFIELD equal to 0, ALV shows the default number of decimals of the field (4 in that case).
    Any help will be very appreciated.
    Thanks.
    Jordi

    No, I didn't try EDIT_MASK.
    How should I use it to format output to display decimals or not depending on the row?
    I have 2 kinds of values, all stored in a TYPE P DECIMALS 4: Those that really are an integer (decimals should not be displayed for that ones) and the values that really have 4 decimals (which should be displayed with decimals in ALV).
    Example:
    13,0000 should be displayed as 13
    0,4567 should be displayed as 0,4567
    With EDIT_MASK could I do that?
    Thank you very much.

  • Decimals upto 2 in alv report

    Hi to all abapers,
    I have to show only upto 2 decimals in the field of an alv report but it is of type p and decimals 4.I dont want to change its type to 2 decimals due to some calculations.So can we show upto 2 decimals in the report?
    Thanks in Advance,
    Salish

    Hi,
    Here is the code
    <b>Here act_pckeff is of type p decimals 4 and i want it upto 2 decimals in the output.</b>
    PERFORM fldcat  USING i_fieldcat 'ACT_PCKEFF'       'DEC'       'Actual Efficiency "Packed"'    ''."13
    FORM fldcat USING p_ifieldcat TYPE lvc_t_fcat
                          value(p_name)
                          value(p_type)
                          value(p_desc)
                          value(p_key).
      DATA: w_fldcat TYPE LINE OF lvc_t_fcat.
      CLEAR w_fldcat.
      w_fldcat-fieldname = p_name.
      w_fldcat-datatype = p_type.
      w_fldcat-reptext = p_desc.
      w_fldcat-key     = p_key.
      IF w_fldcat-fieldname = 'AUFNR'.
        w_fldcat-no_zero = 'X'.
      ENDIF.
      IF p_type = 'CURR' OR p_type = 'QUAN'..
        w_fldcat-do_sum = 'X'.
      ENDIF.
      <b>IF p_name = 'ACT_PCKEFF'.
        w_fldcat-decimals = 2.
        w_fldcat-do_sum = 'C'.
      ENDIF</b>.
      APPEND w_fldcat TO p_ifieldcat.
    ENDFORM.                    " fldcat
    Regards,
    Salish.

  • ALV QUANTITY field Geting converted into decimals ?

    Hi All ,
    I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
    Best Regards,
    Sreeram

    Hi Sreeram,
    I am not gettin this issue. See below code :
    If you are gettiing the same issue with the below code then it has something to do with your user settings.
    Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
    Set it to 1,234,567.89 and save. Now try the program again.
    REPORT z_test.
    TYPE-POOLS: slis.
    TYPES : BEGIN OF ty_ekpo,
              ebeln TYPE ebeln,
              ebelp TYPE ebelp,
              ktmng TYPE ktmng,
              menge TYPE bstmg,
            END OF ty_ekpo.
    DATA: it_ekpo TYPE TABLE OF ty_ekpo,
          it_fieldcat TYPE slis_t_fieldcat_alv.
    SELECT ebeln ebelp ktmng menge
      FROM ekpo
      INTO TABLE it_ekpo
      UP TO 20 ROWS.
    PERFORM add_fieldcat USING 'EBELN'.
    PERFORM add_fieldcat USING 'EBELP'.
    PERFORM add_fieldcat USING 'KTMNG'.
    PERFORM add_fieldcat USING 'MENGE'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program                = sy-repid
       it_fieldcat                       = it_fieldcat
      TABLES
        t_outtab                          = it_ekpo
    EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    FORM add_fieldcat  USING  p_fieldname TYPE slis_fieldcat_alv-fieldname.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-tabname = 'IT_EKPO'.
      wa_fieldcat-ref_fieldname = p_fieldname.
      wa_fieldcat-ref_tabname = 'EKPO'.
      IF p_fieldname EQ 'KTMNG'.
        wa_fieldcat-edit = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    " ADD_FIELDCAT
    Regards,
    Jovito

  • Suppress Decimals for CURR field in ALV Grid based on condition

    Hello All,
    I am displaying records in ALV Grid. For a Company Code, I get the Currency Code from table T001.
    If the Currency is JPY, I want to display the value of CURR field without decimals.
    For example: if the value is 200.00, I want to display only 200
    But if the Currency is other than JPY, I want to display value with decimals.
    For example: if the value is 200.00, I want to display only 200.00
    Also I want the summation function to work on this column, so can't take the field as char field.
    Waiting for useful pointers.
    Thanks in advance,
    Regards,
    Tarun Gambhir

    Hi Keshav,
    Thanks for the reply.
    I have only one CompCode on the selection screen and for that CoCd I will have only one Currency.
    So either all records will be displayed with decimals or all records will be displayed without decimals.
    Can DECIMALS_OUT property of field catalog be helpful in this case.
    For reference you can check: http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm
    I am confused over the use of DECIMALS_OUT.
    Please suggest.
    Regards,
    Tarun

Maybe you are looking for

  • Cache lookup failed

    Dear Experts, I am stuck on the error :*' ERROR [HY000] ERROR: fmgr_info: function 0: cache lookup failed'* while calling a stored procedure(SP). The function in the SP run successfully but while calling the same SP from call function then it is exec

  • Itunes media on a shared drive causes freeze

    I use a LaCie 3TB drive to hold my media connected by Firewire to my Mac Mini.  I use home sharing to share the media and it works fine but every 12 hours or so Itunes will freeze on my mac mini.  I have to force quit Itunes, but even then, I cannot

  • PPR event getting previous value

    Hi There is a PPR event on a standard text box. I am handling PPR event in my custom CO. Whenever I change the value abd tab out of the text box I get the previous value not the current(changed) value. ExpenseReportLinesVORowImpl expensereportlinesvo

  • How can I "swap" text on re-load?

    Hola First to all, is this possible? Need you help to "guide" me to or help me find out how to swap text daily or on reload. For example, I have a div with a quote that I want to change daily (or on reload ) How can I do this? Thanks PS. I Google it

  • My widget secretnotepadplus wont open

    I have many things stored in the widget, many passwords and other information I did not want other people to be able to see. After installing snowleopard it will not open, anybody know how to make it happen? It also screwed up mail, but after about t