ALV - No Decimals

Dear All Expert,
I am implementing a ALV Report, but I have a uncertian issues.
In the ALV report, some fields are defined field type (mard-labst and quan 13,3)
However, we need to display output 123.333 -> 123 (no decimals)
I try to add the following code in the program to reduce Decimals Place. It doesn't work.
lw_fieldcat-scrtext_s = text-e07.
lw_fieldcat-scrtext_m = text-e08.
lw_fieldcat-scrtext_l = text-e09.
lw_fieldcat-decimals_o = 0.
How can I solve it ?
Please help and Thanks in advance.
Best Regards,
Leo

Dear K.P.N. / Gautham
Thank you for your suggestions.
I have tried your suggetions. It doesn't work
I can't activate the program and some syntax errors occured
I use ALV structure "lvc_s_fcat" and the syntax errors - has no compoented called "no_decimals" and "DECIMALS_OUT"
Thanks in advance
Best Regards,
Leo
Dear Max
Thank you for your suggestions.
The requirement for my report is that I need to change all quantity value base on Unit of Measure (in a same row)
E.g. Unit of Measure = EA (each). I need to change quantity value  2.00 -> 2
Thanks in advance
Best Regards,
Leo

Similar Messages

  • FLTP field in ALV Grid

    Dear collegues,
    I would like to use a FLTP field of a database in an ALV grid. How can I influence, how the field is shown in the ALV grid (decimals, comma instead of point etc.)?
    Thank you.
    Regards
    Martin

    Hi Martin,
    You can use the EDIT_MASK field of the field catalog to define the layout of this field.
    Regard,
    John.

  • 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

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

  • 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

  • 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

  • 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

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

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

  • How to control the DECIMALS in the ALV?

    dear all ,i want to control the display of the decimals of a field in the alv .
    and i find one  attribute"decimals" in the structure of LVC_S_FCAT .
    the relatived code  is :
    ls_fcat4004-fieldname = 'TARGET' .
      ls_fcat4004-ref_table = '' .
      ls_fcat4004-ref_field = ''.
      ls_fcat4004-coltext = '&#30446;&#26631;&#37327;&#65288;&#21544;&#65289;' .
      ls_fcat4004-datatype = 'QUAN' .
      ls_fcat4004-intlen = 13 .
      ls_fcat4004-dd_outlen = 17 .
      ls_fcat4004-outputlen = 13 .
      ls_fcat4004-inttype = 'P'.
      ls_fcat4004-no_zero = 'X'.
      ls_fcat4004-decimals = 1 .
      APPEND ls_fcat4004 TO i_fcato4004 .
    but it doesn't work .
    can somebody give some help?
    thank you in advance!

    Hi Niuniu,
    Please try the following codes:
    TYPE-POOLS: slis.
    DATA : BEGIN OF t1 OCCURS 0,
             amt   LIKE   vbap-ntgew,
           END OF t1.
    DATA it_fieldcat              TYPE slis_t_fieldcat_alv.
    DATA xfield                   TYPE slis_fieldcat_alv.
    DATA is_layout                TYPE  slis_layout_alv.
    START-OF-SELECTION.
      t1-amt = '1000'.
      APPEND t1.
      xfield-fieldname = 'AMT'.
      xfield-inttype   =     'P'.
      xfield-intlen    =     15.
      xfield-decimals_out = 1. "this is to control how many decimal number will be displayed
      APPEND xfield TO it_fieldcat.
      is_layout-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat   = it_fieldcat
          is_layout     = is_layout
        TABLES
          t_outtab      = t1
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    Regards,
    Hendy

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

  • How to truncate the decimals in the ALV report for the quantity field

    Hi All,
    I have to display a quantity field and units of measure in the ALV output. If the units of measure eq 'PC' i should not display the decimal places for quantity in the alv output, otherwise i have to display the decimals in the output. How to do this....any help would be highly rewarded. I knew that for this type of cases decimal_o will not work.

    Hi,
    Declare one more Internal table same as output table. In that intead of that quantity field, declare field_name(15) type c.
    data temp type i.
    Loop at itab.
    if field = 'PC'.
    temp = qunantity field.
    field_name =temp.
    else.
    field_name = quantity field.
    endif.
    endif.
    endloop.

  • 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

Maybe you are looking for

  • T60p Win7 LCD sometimes off when resume from sleep

    T60p Win7 - Sometimes when returning from sleep the LCD does not come on.  When this happens sleeping and awaking again has no effect.  Only solution is to hard power down. Latest BIOS, system up to date.  Any ideas?

  • Business process monitoring such as POs and inbound webservices

    What is the best way to monitor a business process for error conditions to automaticall.report status. I would like to monitor across components and would like to be able to monitoring it realtime. Thanks Weyland Yutani

  • Skype crashing every 4 to 6 hours

    System (Key components):  - Windows 7 Home Premium 64bit  - i5 2310 Quad Core 2.9GHz  - 8GB Ram  - 1TB HDD So, just as the subject says, my skype crashes every 4 to 6 hours. i get 3 different kind of errors: "Thread creation error: Not enough storage

  • Polygon and Star Tool Draw Only from Center?

    Adobe Illustrator 15.1.0 (CS 5.5) on Windows 7. I was attempting to draw a polygon shape with an upper left origin point, when I noticed that the polygon and star tools only draw out from the center. Modifier keys have no effect. Rectangle and Ellips

  • My iPod can't find my network ever since we got a new router

    I have recently got a Linksys E 2000 router but ever since I got it my iPod will not find it. How can I fix it??? ;(