Decimal filed in ALV

Hi Abaper,
I am showing one field in ALV of likp LGMNG which is using refrence of data element LGMNG (QUAN     13     3). it is displaying with 3 decimal places.
I want to display the value of LGMNG with 2 decimal place, how?
Thanks,
Rajesh.

Hi,
Use 
ls_fieldcat-decimals    = '000003'.
in the fieldcatalog. please let me know if problem not solved.
Thanks

Similar Messages

  • Quantity column display upto 2 decimal places in ALV

    I've created an ALV for dynamic columns. For this i've first created the fieldcatalog and then the internal table.
    The problem that i'm facing in this is that the user wants the quantity column to be displayed upto 2 decimals. For this i tried the following:
    1.)     wa_fldcat-decimals_o = '2'
             wa_fldcat-decimals    = '3'.
             wa_fldcat-datatype     = 'QUAN'.
    with this i tried that let the calculation be to 3 decimal places but on output it should show 2 decimal places.
    But this doesnot gets reflected on ALV. It still shows 3 decimal places.
    eg:  3 decimal places: 16.667 + 16.667 + 66.667 = 100.001
    2.)     wa_fldcat-decimals_o = '2'
             wa_fldcat-decimals    = '2'.
             wa_fldcat-datatype     = 'CURR'.
    I also tried doing the calculation with 2 decimal places with datatype CURR but with this the last digit gets rounded.
    eg:  2 decimal places:  16.67  + 16.67   + 66.67   = 100.01
    Now we are taking total as 100 %. So tha calculative total cannot be more than 100.
    On seeing 100.001 user says show it to me to 2 decimal places  i.e. 100.00
    On seeing 100.01 user says  how can the total be more than 100 & this is .01 more than 100.
    Therefore how can the 1.) option be achieved.
    PLZ HELP!

    Hi,
    Can u check this one
    DATA: gv_packed TYPE p DECIMALS 2.
    CATCH SYSTEM-EXCEPTIONS conversion_errors = 6.
    MOVE char_field TO gv_packed.
    ENDCATCH.
    IF sy-subrc = 6.
    error handling
    ENDIF
    Try to move ur char field to a type p field. If char field is other than numeric then u will get error that can be handled in try...chatch..endtry block.
    data: l_val type p decimals 2.
    parameter my_val type char20.
    try .
    l_val = my_val.
    catch cx_root.
    Do ur error handling here
    endtry.
    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.
    Thanks.
    Ashok.

  • Decimal place in ALV

    Hi
    i have created an ALV for the excise department and the output is coming correctly,but the problem i face is that the value for the export goods(series 21) comes wrongly.for eg:it has to come 407952.60 it comes as 4,079,526.00.
    I like to know how to bring the decimal point one place in front
    thanks in advance

    HI,
    Try use the code as below while building fieldcatalog for that field.
    gs_fieldcat-datatype = 'DATATYPE'.
    Thanks,
    Sriram Ponna.

  • 2 decimal places in alv output

    Dear Experts,
    I need to display an quantity value with 2 decimals places in output. I have tried many options like,
    1.wa_fieldcat-decimals = '2'.
    2.wa_fieldcat-decimals_o = '2'.
    3.wa_fieldcat-ref_table = 'VBAP'.
      wa_fieldcat-ref_field = 'NETPR'.
    But its always coming with 3 decimal places. I have assigned a variable with type p & decimals 2.
    Also I searched sdn & found many threads. But still its coming as 3 places.
    Can you please guide me on the same.
    Bharath

    3.wa_fieldcat-ref_table = 'VBAP'.
    wa_fieldcat-ref_field = 'NETPR'.
    it's a currency field, you should give a column with currency to get the correct format
    wa_fieldcat-cfieldname = 'WAERS'.

  • No Decimal points in ALV

    Hi experts,
    I am displaying a Quan field in ALV grid which come like 123.000 requirment is to remove decimals
    it should display like 123.
    Fast response will be highly rewarded.
    Regards
    Bikas

    hi ,
    for that particular field in Field catalog..
    <ur field cat>-decimals_out = 0.
    see this sample code.
    type-pools: slis.
    DATA: begin of itab6 occurs 0,
    chk type c,
    a type p decimals 2,
    b type p decimals 2,
    c type c,
    end of itab6.
    data: ls_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    wa_layout TYPE slis_layout_alv.
    itab6-a = '1.12'.
    itab6-b = '2.25'.
    itab6-c = '+'.
    append itab6.
    append itab6.
    append itab6.
    append itab6.
    ls_fieldcat-fieldname = 'A'.
    ls_fieldcat-seltext_m = 'A'.
    append ls_fieldcat.
    ls_fieldcat-fieldname = 'B'.
    ls_fieldcat-seltext_m = 'B'.
    ls_fieldcat-decimals_out = 0.  "this ll do
    append ls_fieldcat.
    ls_fieldcat-fieldname = 'C'.
    ls_fieldcat-seltext_m = 'C'.
    append ls_fieldcat.
    wa_layout-box_tabname = 'ITAB6'.
    wa_layout-box_fieldname = 'CHK'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    it_fieldcat = ls_fieldcat[]
    IS_LAYOUT = wa_layout
    TABLES
    t_outtab = itab6[].
    regards,
    venkat.

  • Aligment of a filed in ALV Grid based on Longon language

    Hi,
      I have a Quantity field in my report which is getting displayed a right aligned whn I run my report in EN language. When I run the same report in JA i.e Japanese Lnaguage the Quantiy field is displyed as left aligned. Can anybody explain me ewhy this difference...........
    Thanks in advance.
    Regards,
    Vijayakumar V

    Hi..
         Try like this... I think u have Application number and date in ur table ... First get the total table data into internal table.. and to add the row
         *Declare the var1 as 0 and var2.
    loop at internal table
         *var1 = var1 +1
    when application number =var1
             concatenate : 'Appli. No.' (table- appli no field) 'Date:'  (table-date field) into var2.
    perform display(some name)
         *endloop.
         *form display...
              alv display part.. first give that var2 like eg.. wa_alv-field= 'var2'.
    end form.
        Hope this will help u .....
    Regards,
    Abaper

  • Displaying filed value or other table filed in ALV output table

    Hi,
      I have a vendor leadger report displaying vendor balance statement witj all line item details,  all data is present in One final table  this final table i hvae shown in output but along with this  in the first line in output  i want to display openig balance of that vendor  and in the last line i want to display closing balance of that vendor in the period for opening balance and closing balabce i have that amount in the diffrent tables or fileds  how to display that amount in output along with my Final table .
    regards,
    zafar

    hi ,
        Do this way 
    1) get the opening balance  
    2)   append that line to final table
    3) then append data from other table in final table where data for all line item
    4) then again get closing balance
    5) append that data in final table and you will get first line as opening balance ,then middle data and last closing data .
    regards
    Deepak .

  • Decimal Value display in ALV Field display

    Hi Expert,
    I need to dispaly one ALV Field "Routine Work Hour" value up to 2 decimal place in ALV output i.e if value is 2.5 then it should display as 2.50.The field which refers to this is ISMNW and the database table is AFRU.Now if this value is maintained in MINUTE unit, then code converts into HOUR unit and correctly outputs to ALV output up to 2 decimal after i changed the field decimal lenght.But for the value which is mainatined in HOUR unit, it correctlty populated into the final internal table upto 2 decimal and this table data while passing into FM " REUSE_GRID_DISPLAY" it only outputs upto 2 deciamal value for the value which is maintained as MINUTE unit in database table AFRU in ALV output, but for other value(Which are maintained in HOUR unit in table AFRU)  it still shows 1 decimal length.But the internal table correctly populates these values up to 2 decimal for all unit of work(MINUTE/HOUR) while passing though this above FM.
    Please advise where i need to look into.
    Thanks

    hi,
    pass these parameters to fieldcatlog.
    e.g.
    Fcat-ref_fieldname = 'ISMNW'.
    fcat-ref_tabname  = 'AFRU'.
    fcat-decimalsout = 2.
    Hope this will help you.
    Regards,
    Vijay

  • Decimal in alv

    how to use decimal values in alv? if i want to remove the decimals then how to do it in alv field catalog? are there any fld catalog attributes to suppress the decimal values in alv?
    Moderator message: please search for available information/documentation before asking.
    locked by: Thomas Zloch on Sep 30, 2010 12:31 PM

    Hello,
    Refer to the following thread and see if it helps:
    [Suppress Decimals for CURR field in ALV Grid based on condition;
    Regards,
    David

  • ALV: issue in truncating decimal values (rounding up)

    Hi,
    I have been receiving a problem truncating decimal values in alv environment using this abap code.
    WRITE gwa_komv-kwert TO gv_out_tax CURRENCY rte0143sf-currency
            DECIMALS l_decimals LEFT-JUSTIFIED.
    where l_decimals = 0.
    More exactly the value is rounded up but this is not my expectation.
    Any idea?
    Thanks.
        Giovanni

    Standard behaviour with DECIMALS 0: rounding up or own.
    And when you use the addition DECIMALS, then the CURRENCY addition is ignored as well.

  • Co41 enhancement for add field in ALV output

    I must add a custom filed to ALV output of transaction CO41 and i trying to use all the 25 enhancements provided (that i find in other post CO41- Enhancement ), but i haven't found any way to get the desired results.
    Can any body help me?
    Thanks in advance.

    Hi,
    I had the same requirement to add a custom field to ALV output of transaction CO41.
    1. I first added the custom field to an new append-structure to the structure SFC_POCO.
    2. Then i added this field to the Dynpro-Screen 200 in the function-group COUP (by choosing the table control, pressing F6 and then adding the custom field of SFC_POCO).
    3. At last i added an Enhancement to the function CO_UP_PLANNED_ORDERS_SELECT and filled my custom field with data there.
    Please reward if useful.
    Regards,
    Henry

  • Web dynpro + adobe form decimal field round off

    hello all,
    I am now developing an application which is based on the SAP WebDynpro and Adobe form, but the application has an error, if one can help me to resolve the error, I will be very thankful.
    The error is as follows, for a decimal filed on the Adobe form which is binded to a deicmal attribute of Webdynpro, if I get the value of the decimal field using the programming code as "context.nodexx.getAttribute("xx")", the decimal value is rounded off (e.g., 2.4 is changed to 2.0, 2.7 is changed to 3.0).
    for example:In Web Dynpro,  A node name is  "TestNode" which has a  type of decimalattribute named "TestAttr" ,  in  adobe form  a decimal field  bind to the TestAttr . when i input 2.3  in  adobe form,  i  click the button with code:
    this.wdComponentAPI.getMessageManager.reportSuccess(this.wdContext.nodeTestNode.getTestAttr()+"");
    the rusult is  :     2.0
    if  i  input  the  value  2.5   the result  will be  3.0
    Thanks All !

    Hi,
    there is a special display pattern to check for null values:
    null{pattern}
    Example:
    null{'please enter a value'}
    But I don't know if WDJ is really sending a null value. You can combine this with alternatives using '|' to separate alternatives.
    Regards,
    Juergen

  • Not geting BOM value in ALV

    Hi all,
    here i want to fetch BOM value for this i write code like below.
    SELECT abudat amblnr bmatnr bmenge bbwart didnrk
             INTO CORRESPONDING FIELDS OF TABLE it_rawmat
             FROM  ( ( mkpf as a inner join mseg as b on amblnr = bmblnr )
                     inner join mast as c on cmatnr = bmatnr )
                      inner join stpo as d on didnrk = bmatnr )
             where bbwart = '261' and bwerks in werks and bmatnr in matnr and abudat in budat. "and d~idnrk in idnrk.
      IF sy-subrc <> 0.
        MESSAGE ' No Data For This Selection' TYPE 'I'.
        SUBMIT ZPP_RAWMAT_CONSUMPTION VIA SELECTION-SCREEN.
      ENDIF.
      LOOP AT it_rawmat.
        select single maktx
          from makt
          into it_rawmat-maktx
          where matnr = it_rawmat-matnr.
        select single matnr menge
          from mseg
          into (it_rawmat-matnr1, it_rawmat-menge1)
          where mblnr = it_rawmat-mblnr AND bwart = '131'.
    Add By Keyur chauhan to where used material discription*************
          SELECT SINGLE maktx
            from makt
            into it_rawmat-maktx2
            where matnr = it_rawmat-matnr1.
         SELECT single matnr stlnr
          from mast
          INTO (it_rawmat-matnr3, it_rawmat-stlnr)
          where matnr = it_rawmat-matnr1.
           select SINGLE menge
             from stpo
             into it_rawmat-bomit
             where idnrk = it_rawmat-matnr.
    according to above code i get value of BOM filed in ALV  which is previous ALV field value.
    means BOM value and previous filed value both are same.
    So can u please kindly help me  out.
    Thanks in Advance.
    keyur

    data is getting but alv problem

  • Credit Management - T Code VKM1,2,3,4.

    Hi All ,
    I have issue in Credit management - VKM1 Transaction . The value in field " credit value in thousand (VBKRED-KWKKD)" is showding value in Thousand . We need to populate the values in this field same as that of "Credit Value VBKRED - KWKKC".The user wanted this field to be displayed in the out put   and does not wanted to HIDE/SUPRESS this filed in ALV Grid  and also looked into the OSS note no -413483.
    Please help me on this issue .
    Thanks in advance
    Veera
    Edited by: veera PV on Oct 24, 2009 3:39 PM

    Hi,
    As note 413483 suggests you, create a new field as a user-defined field and enhance VKM+. Check the note SAP Note 779389 - VKM*: Extend list with user-defined fields.
    I hope this helps you
    Regards,
    Eduardo

  • Not getting BOM value

    Hi all,
    here i want to fetch BOM value for this i write code like below.
    SELECT a~budat a~mblnr b~matnr b~menge b~bwart d~idnrk
    INTO CORRESPONDING FIELDS OF TABLE it_rawmat
    FROM ( ( mkpf as a inner join mseg as b on a~mblnr = b~mblnr )
    * inner join mast as c on c~matnr = b~matnr )
    inner join stpo as d on d~idnrk = b~matnr )
    where b~bwart = '261' and b~werks in werks and b~matnr in matnr and a~budat in budat. "and d~idnrk in idnrk.
    IF sy-subrc 0.
    MESSAGE ' No Data For This Selection' TYPE 'I'.
    SUBMIT ZPP_RAWMAT_CONSUMPTION VIA SELECTION-SCREEN.
    ENDIF.
    LOOP AT it_rawmat.
    select single maktx
    from makt
    into it_rawmat-maktx
    where matnr = it_rawmat-matnr.
    select single matnr menge
    from mseg
    into (it_rawmat-matnr1, it_rawmat-menge1)
    where mblnr = it_rawmat-mblnr AND bwart = '131'.
    SELECT SINGLE maktx
    from makt
    into it_rawmat-maktx2
    where matnr = it_rawmat-matnr1.
    * SELECT single matnr stlnr
    * from mast
    * INTO (it_rawmat-matnr3, it_rawmat-stlnr)
    * where matnr = it_rawmat-matnr1.
    select SINGLE menge
    from stpo
    into it_rawmat-bomit
    where idnrk = it_rawmat-matnr.
    according to above code i get value of BOM filed in ALV which is previous ALV field value.
    means BOM value and previous filed value both are same.
    So can u please kindly help me out.
    Thanks in Advance.
    keyur

    data is getting but ALV problem

Maybe you are looking for

  • How can I use bluetooth to send data to my mac book pro?

    I can connect my smartphone (nokia) to my Mac Book Pro, but if I try to send something from Nokya to my Mac using bluetooth, that's impossible. The only way is to search what I wanto to store in my Mac, using the Mac and browse my Nokia with Finder.

  • IPod Not recognized by XP, Slightly different from others

    I am having a similiar problem to many peoples. Early this morning I connected my iPod and there were no problems, later in the day I tried and for no apparent reason XP will not recognize it. Not only this but it will also not charge when connected

  • PB12.5 - Oracle 11g conenction issue - Failed to get local NLS_LANG charset ID

    Hi Everyone, We have recently migrated our OS to windows 7 and orcle client to 11g since then I am getting error "Failed to get local NLS_LANG charset ID" while connecting to Oracle using the IDE. I tried to connect using O10 Oracle 10g and ORA Oracl

  • Oracle Reports 6.x and Oracle Express Server

    What are the benefits of using Oracle Reports in conjunction with Oracle Express Server? We are currently using OFA for planning and forecasting, and are evaluating Oracle Reports as a tool to produce and publish key financial reports for a large use

  • Problems with rsh

    Hi Friends Im facing a typical problem , being new to solaris I want some help on rsh . Typically when we had solaris 8 in our network when we gave rsh Hostname we used to login without being prompted for password , now we have migrated to solaris 10