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.

Similar Messages

  • 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

  • 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

  • How to delete trailing zeros after the decimal point in the ALV sum

    Hello Expert,
    In my alv output, I need to sum up one column, but in the sum result, I don't want to display zeros after the decimal point.
    for example,
    If the sum is 134.00, I only want to display 134 on the alv.
    Does any expert have idea about it?
    Thanks in advance,
    best regards, Johnny

    Hi ,
    Use following
    SHIFT variable RIGHT/LEFT DELETING TRAILING '0'.
    For more variations ,
    just write SHIFT and press f4 , it will show you the information you need.
    Hope this is helpful,
    Regards,
    Uma Dave

  • Problem with decimal point in Korea and Japan

    Hi all,
    I have one problem with decimal points.
    I need to change in my out put cuurency values as per japan or korea standards.
    Please help me is there any function module for this one.
    program using alv grid display.
    i use write statement but it is not working. Because
    data: L_AMT  type glpca-hsl,
             G_AMT  TYPE CHAR15.
    CURR this value is 'JPY'.
    WRITE L_AMT CURRENCY CURR TO G_AMT.
    here i need to do
    L_AMT = G_AMT.   "" going to runtime error.
    if i taken like
    data: L_AMT  TYPE CHAR15,
             G_AMT  TYPE CHAR15.
    CURR this value is 'JPY'.
    WRITE L_AMT CURRENCY CURR TO G_AMT.   "" it is not working
    Regards
    margani

    Hello,
    This is pretty basic, whenever you've currency & quantity fields you need to pass the corres. reference fields.
    In your case you need to populate the cfieldname & ctabname fields of the FieldCat.
    BR,
    Suhas

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

  • Lost decimal point after export to text file

    Dear All,
    I have problem which to beset me long long time. I haven't dug the cause yet. Actually, I have a program which will generate a text file in background everyday. The text file included po data which is create last day, such as po no, item, unit price etc. But sometimes, not every times, one of item data's unit price will lost the decimal point in the text file, for example, the po unit price is 18.80 stored in database. but the outcome is 1880 in the text file. Do you have encountered such kind of problem? Thanks!

    Hi
    sorry cant get you..
    need some more explanation
    can you send me the code
    Regards
    V.Balaji

  • How to delete decimal point and adding leading zeros....

    Hi,
    I have one requirement in the report   i.e.
            <b>Present Value    :</b>  44567.98
            <b>Expected Value  :</b> 0000004456798
    In the present Value how will I remove that decimal point and how to add those six ing zeros. I tried with CONVERSION_EXIT....but it is not giving. Help me...
    Thanks in advance.
    Regards,
    Kumar.

    Hi,
    Use SPLIT and COMCATENATE fnctions.
    Eg:  split l_v at '.' into l_v1 l_v2
            concatenate l_v1 l_v2 into l_v.
    For adding leading zeros
    Use FM CONVERSION_EXIT_ALPHA_INPUT.
    Eg:
    data: tknum type vttk-tknum value '99156'.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
         exporting
              input  = tknum
         importing
              output = tknum.
    Sri
    Message was edited by:
            Sri Tayi

  • Purchase price to have 4 digits after decimal point

    Hi Friends,
    Would you please help me out with this issue?
    The purchase price needs to have 4 digits after the decimal point, because the product/component would be packed and sold in other unit, which may give huge value difference.
    The price can be set for the product/component per 100, but is there any setting in SAP Reference IMG?
    Thanks for your help.
    Regards,
    JT

    Hi,
    In material Master (MM01) which unit you maintain for that material. Go to MM02 and keep Base Unit of Measure as storing unit as earlier and maintain Sales unit (unit of measure in which the material is sold) or Order Unit (Specifies the unit of measure in which the material is ordered) in the Purchase Order according to your requirement and Enter the factor for converting the alternative unit to the base unit. In your case product/component would be packed in a Different unit.
    OR
    In your case product/component would be packed in a Different unit.
    Maintain the (BOM) Bill of Material for the finished product you are selling and its component.Create Finished Product as material type as FERT and Components as material type as HALB or ROH.
    Now try your transaction with Finished Product only and sale.
    Hope the above  will help.
    Regards,
    Biju K

  • Rounding off during APP (f110) of decimal point

    Hi
    Can any one help me? When I run the T.Code f110 for automatic payment programme is generate cheque propaly, here my client want to rounding off for the decimal point in cheque amount as if coin adjastment.

    Hello Arup,
    I guess OB90 is helpful to you so pls check the same.
    Thanks & Regards,
    Lakshmi S

  • Convert the money datatype to a 2 decimal point format.

    Whats the best way to convert the money datatype to a 2 decimal point format in ms sql 2005 for use in my applications.
    this?
    CAST(tr.depositReceivedAmount AS decimal(10 , 2))

    I respectfully disagree with the notion that you should change the SQL column from a 'money' data-type to something else.
    In most database servers, 'money' is a data type that is designed to provide very consistent behavior with regard to arithmetic accuracy.  In Microsoft Access, the representation is a scaled-integer.  In MS SQL Server, it is obviously similar.  Ditto Oracle and all the others.
    You want the money data-type in the database to have this accuracy, because "hell hath no fury like an accountant in search of one lousy penny."   The database column storage-formats are designed to satisfy accountants, and that is a Good Thing.
    Meanwhile, you also want to take care as to exactly how you deal with the values.  There are several points where rounding could take place.  You do not have at your disposal the strongest possible handling of floating data-types in ColdFusion.  You are also somewhat at the mercy of whatever interface software may lie between you and whatever SQL server you may use.  "It's okay to round values once, but not multiple times."
    I suggest rounding the value right before display, and stipulating that the user's input must be two decimal places.
    Then, you might have to do some things at the SQL server's end.  For instance, when you update a value in the table, you may need to use server-side logic to explicitly truncate the value to two decimal-points, so that an update of "$34.56" explicitly updates the column to "$34.5600."  (This sort of thing has to happen within the SQL server context.)  You know that the user's input has exactly two significant digits, but maybe (maybe not...!) the SQL server might not know this.  You want to ensure that the server's internally-stored value represents exactly two significant digits, when the value originates from a user-input.
    Don't err on the side of "your convenience" or "what looks good on-screen."  (If you do, get ready to get phone-calls from the accountants, always at inopportune hours of the night.)

  • OBIEE 11.1.1.6 - Requirement is to show 3 digits after the decimal point.

    Hi,
    I have a requirement to concat 2 columns ( 1st column is a text column and 2nd column is a numeric column set as double in RPD). For the 2nd column, user wants to see 3 decimal digits all the time.
    For example, if the value is 2.4567 then I need to show round off value 2.457 and if the value if 3.4 , then I need to show 3.400 and if the value is 4 then I need add decimal point and show 4.000.
    Please let me know how I can achieve using OBIEE application without having to go through RPD.
    Thanks
    Swarna
    Edited by: 934460 on May 15, 2012 12:48 PM

    Try the following:
    In this example:
    Column 1: Month Name
    Column 2: Revenue
    Column 3: Month - Revenue
    Formula for Month - Revenue column will be:
    Month Name ||' - '|| cast(round(Revenue, 3) as char)Hope it helps.
    Regards,
    Kalyan Chukkapalli
    http://123obi.com

  • Can't figure out how to solve the decimal point bug in this calculator code

    Hi guys, I'm new in flash and is currently learning how to build a simple calculator with multipliers (plus,minus,multiple,divide,decimal point and change sign) but I'm stuck on the decimal point and change sign.
    var multiplier_old:Number = 10;
    var multiplier_new:Number = 1;
    // .: Sets the multipliers so that new input numbers become decimals of a lower unit column
    action_point.addEventListener(MouseEvent.MOUSE_DOWN, function():void {
              multiplier_old = 1;
              multiplier_new = 0.1;
              point = true;
    // Takes intput from the input_ buttons and adds it to the input after applying the multipliers.
    // If `point` is true then the multiplier_new is divided by 10, also as described.
    function inputNumber(n:Number):void {
              input = input * multiplier_old + n * multiplier_new;
                        if (point) {
                                        multiplier_new *= 0.1;
                       trace(multiplier_new);
              output_txt.text = input.toString();
    Decimal point
    The problem is that when I input 2.7 in the calculator, it will display the values in output_txt correctly. But then when I input 2.78, it will display 2.780000000000000000000000002. This will also happen to other numbers if the input is too big.
    What I want is just 2.78. How do I change the codings to make 2.780000000000000000000000002 become 2.78?
    Change sign
    Any tips on how to start on this one?
    Thanks for your time,
    Zainu

    I think you misunderstand what I mean. The weird decimal doesnt comes out after I press the 'equals' sign. It comes out when im just pressing on the caculator number buttons
    First I click the no.2 button and then the decimal point button.
    So the caculation output display will show
    2.
    after that I press the no.7 button
    2.7
    and then no.8 button. It appears like
    2.7800000000000000002
    This is the code I use when the user press the decimal point button.
    // .: Sets the multipliers so that new input numbers become decimals of a lower unit column
    action_point.addEventListener(MouseEvent.MOUSE_DOWN, function():void {
              multiplier_old = 1;
              multiplier_new = 0.1;
              point = true;
    // Takes intput from the input_ buttons and adds it to the input after applying the multipliers in the method described above.
    // If `point` is true then the multiplier_new is divided by 10, also as described.
    function inputNumber(n:Number):void {
              input = input * multiplier_old + n * multiplier_new;
                        if (point) {
                                 trace(multiplier_new.toFixed(3));
                                  multiplier_new *= 0.1;
                                  //trace(multiplier_new);
              output_txt.text = input.toString();
    I think there is some code wrong in this function that makes this weird problem. I tried putting toFixed method but it's still not working.
    Sorry for this long reply but I have to try my bestto explain with my bad english.

  • How can I get the float variable in 2 decimal point?

    after running the following simply manipulation program,
    14.85 should be returned, but in stead, 14.849999.
    how can i change the precision? i want the returned number in 2 decimal point.
    public class TestC {
    public static void main(String[] args) throws Exception {
                   float var = 0.00f;
                   var = (float)4.95 * 3;
                   System.out.println(var);

    There is absolutely no way that you can change the precision. It is fixed.
    If you want to display two decimals places (which is not the same as changing the precision) then you can use the following.
      float var = 0.00f;
      var = (float)4.95 * 3;
      java.text.DecimalFormat f = new java.text.DecimalFormat("0.00");
      System.out.println("var=" + f.format(var));

  • Mail adapter ignores decimal point

    Message going out from Mail adapter ignore decimal point. One of the attibutes in xml file has a value "1.0". When I check the message in SXI_MONITOR -> Call adapter -> Payloads -> MainDocument, attribute value is "1.0". But when file is received by receiver atribute value is "10". Can any one give some advice how to fix this issue?
    Thanks
    Ranji

    Hi,
    I hope , in general mail adapter may not ignore the decimal points , please check in mapping itself..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/content.htm
    Regards
    Chilla

Maybe you are looking for