ALV removal of decimal values

Hi All,
I want to remove the decimal values of report output based on certain condition I am using code like this
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[].
But still it is not removing the decimal value.
What could be the reason?
Regards
Sagar.

Thanks Florian,
Issue resolve
Regards
Sagar

Similar Messages

  • ALV report - remove of decimal values

    Hi experts,
    In my ALV report, output table having decimal values, ex:90000.50, i want to display only 90000,
    can help any one inthis.
    Thanks in advance.
    Regards
    Rams

    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[].
    Cheers,
    jose.

  • Decimal  values for a field in ALV

    Hi,
    I created an ALV report.
    It has a field which will display the calculated value as '103,839,389'. This should be dispalyed as '103,839,389.00' with decimal value, I mean with 2 decimal places, how can this be achieved?
    Thanks,
    Kumar

    hi check this..
    use these in populating the fieldcat..
    it_fieldcat-decimalsfieldname = fieldname
    it_fieldcat-decimalstabname   = tabname
    it_fieldcat- decimals_out   = 2.
    regards,
    venkat

  • How to remove the decimal points at the end of the value????

    hi,
    we are using crystal reports 9.0. we have some reports which contains group by field.  we have one field like address. if we select group by as address "The data is displayed grouped by the Address. But the address is shown in decimal points". for example if we have 55 as address field value, it shows 55.00. 
    the formula has written like as follows
    if lowercase({?GroupBy}) = 'Address' then totext({rsp_GetDevMicro.Address})
    now, i want to remove zeros which comes along with address field values.
    can anyone help me in this?

    Not sure about Crystal 9 but on 11 I would convert it to a number to remove the leading zeroes then back to text again which allows you to remove the decimal point and any thousand seperators, ie:
    CStr(ToNumber(),0,"")

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

  • How to delete decimal values zeros

    Hi experts,
    i am using mseg-menge field ( lenth13 and decimals 3) in my alv grid report.
    eg: 2.3456.000
    user wants only  2.3456 no decimals.
    how we can aviod decimals 0 s in report.
    thanks in advance.
    mahahe

    I search this ways in the forums:
    Shift
    SHIFT varb1 RIGHT DELETING TRAILING '0'.
    write: gv_variable decimals 0.
    SHIFT VALUE LEFT DELETING LEADING '0'.
    Shift2
    DATA: T(14) VALUE ' abcdefghij',
    STRING LIKE T,
    STR(6) VALUE 'ghijkl'.
    STRING = T.
    WRITE STRING.
    SHIFT STRING LEFT DELETING LEADING SPACE (or use 0 to detete 0).
    WRITE / STRING.
    STRING = T.
    SHIFT STRING RIGHT DELETING TRAILING STR or 0.
    WRITE / STRING.
    Shift3
    data amt(6) type p decimals 3 value '123.450'.
    data amt1(6) type p decimals 2.
    data amt_c(6) type c.
    unpack amt to amt_c.
    shift amt_c right deleting trailing '0'.
    pack amt_c to amt1.
    write amt1.
    use FM
    FTR_CORR_SWIFT_DELETE_ENDZERO
    this FM will remove all the zeros from decimal values like
    value - 234.8000000
    output - 234.8
    IF
    data: var1 type p decimals 3,
          var2 type p decimals 2,
          var3 type p decimals 1.
    move '12345.100' to var1.
    move var1 to var2.
    move var1 to var3.
    if var2 = var1.
      if var3 = var1.
        write var3.
      else.
        write var2.
      endif.
    else.
      write var1.
    endif.
    I hope that this solve your problem.
    Cordial greetings.

  • Round Decimal value based on last digit

    Hi Experts,
    I'm trying to round the decimal value based on its last digit. If the last digit is >5 then add +1 to the digit before that and remove the last digit else just remove.
    ie.
    -59664.15000000005 should become -59664.15
    -21308625.00000002 should become -21308625
    -85234500.00000006 should become -85234500.0000001
    18288102.85714287 should become 18288102.8571429I tried with Round Function but it did not help,
    Pls assist.
    Thanks!

    Got it done just took the length and did the change.. sorry for this lame question.. should have tried before posting the question. Tx for your time...

  • My ITunes got corrupted and I kept getting a message when updating iTunes64msi missing so I uninstalled all files and I thought I removed all registry values but  when reinstalling I get an older version is installed and cannot be removed. I need a soluti

    My ITunes got corrupted and I kept getting a message when updating iTunes64msi missing so I uninstalled all files and I thought I removed all registry values but  when reinstalling I get an older version is installed and cannot be removed. I need a solution.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • How do I convert an alpha character from a text string to its decimal value

    I am trying to find out the actual decimal value of a character in a string. So far the code below is as far as I got. I am able to get what I guess is a byte value.
    This is for a school assignment:
    The idea behind what I am trying to do is to design a hash function to store dictionary words into a bucket array hash table, without using the existing Hashtable.class
    so far this is what I can come up with to get some kind of value for each character in the string, however, what I am trying to get is the decimal value for each character.
    public static void main(String args[]){
         String word = "abcdefghijklmnopqrstuvwxyz";
         for (int i=0 ; i < word.length(); i++){
         System.out.print((word.substring(i,i+1)));
         System.out.print("\t : "+((word.substring(i,i+1))).getBytes());
    Thankyou for any replies.

    I'm not sure I completly understand your goal- what you mean by "decimal value", but, if you simply want to find the byte value of each character in a String, you would probably be better off using getBytes() in a way like this,
    byte [] bytes = string.getBytes();
    Then, if you need to map that to a charcter, you could use a for loop like
    for (int x = 0; x < bytes.length; x++) {
    table.put((char)bytes[x], bytes[x]);
    which assummes this bucket class of yours allows primitive data types like so (in Hashtable or HashMap, you would have to use a wrapper Object). I guess, my point reduces to, don't use substring and string search methods (like indexOf()), unless you have to because they are more expensive then just maping the array of bytes and chars, which seems to be what you are interested in doing.

  • How to convert a number to FLOAT with 9 decimal values.

    Hi all,
    I need to convert a number like '10.02' to a floating point number with 9 decimal values like '10.022111221'. I think that the right function is TO_BINARY_FLOAT, but how can I obtain 9 decimal values? If I use the following syntax:
    select TO_BINARY_FLOAT(num) from table
    I obtain a floating point values with a variable number of decimal numbers after the ".", instead I need 9 number after ".".
    Regards,
    Maurizio.

    Hi,
    the number I need to select is the result of a product, for example:
    select (Num_A * Num_B) from Table;
    Num_A has 2 decimal numbers, like 12.01 and Num_B could be: 12.111111111.
    Now, Num_A * Num_B = 653.999999994
    but I issue:
    select TO_BINARY_FLOAT(54.00 * 12.111111111) from Table
    I obtain:
    654, a rounded value, but I need 653.999999994.

  • Want to remove the default value of a column in a table

    HI
    I have a table called User_ind. This table columns have default values as 'n' like
    create table user_ind(
    ind_num varchar2(1)
    ,group_allowed varchar2(1) default 'y'
    ,view_allowed varchar2(1) default 'y'
    now i want to remove the default values How can i procede with this.
    Urgent .
    Thanks in advance.
    Chaitanya.

    In Oracle 9i you cannot remove the DEFAULT, you can only change it to null:
    alter table user_ind modify group_allowed varchar2(1) default null
    You can check it using this one:
    select table_name,column_name,data_default
    from user_tab_columns
    where table_name = 'USER_IND'
    Best Regards
    Krystian Zieja / mob

  • Rounding off to a variable value to 4 decimal values in sap script ouput

    Hi All,
    I have a value getting displayed in sap script output as 235.6789 i want to Round off this variable value to 4 decimal values!
    What is the formatting option need to be used & how!
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    1.In layout just call that variable, where you need like:
    &variable(.4)&.
    Just see these:
    &symbol(Z)&  Omit Leading Zeros 
    &symbol(S)&  Omit Leading Sign 
    &symbol(<)&  Display Leading Sign to the Left 
    &symbol(>)&  Display Leading Sign to the Right 
    &symbol(C)&  Compress Spaces 
    &symbol(.N)&  Display upto N decimal places 
    &symbol(T)&  Omit thousands separator 
    &symbol(R)&  Right justified 
    &symbol(I)&  Suppress output of the initial value
    Regards,
    If helpful reward with points(Don't forget).

  • Loading decimal  value to an infoobject of type char

    I have an extract structure with field timestamp, which is of type dec and length 15. Now i want to load this value to an infoobject in ODS. But this infoobject is of type char and length 18. when infopackage loading is scheduled it is giving the following error. Record 1 :InfoObject /BIC/IFITMSTMP does not contain alpa-conforming value 20061206084944.
    Is it because i tried to move a dec valu into a char field with a different length? If so  how will i load a decimal value of length 15 to a char of length 18. Can anyone please help me with this?
    Thanks in advance.

    if u r using BI7.0
    go to the datasource of the cube
    in the general info tab of the datasource
    there is a check box with PSA not typed
    check it
    if u check it all the values from the external source will be converted into character format irrespective of their data type

  • Loading a decimal value to an infoobject of type char

    I have an extract structure with field timestamp, which is of type dec and length 15. Now i want to load this value to an infoobject in ODS. But this infoobject is of type char and length 18. when infopackage loading is scheduled it is giving the following error. Record 1 :InfoObject /BIC/IFITMSTMP does not contain alpa-conforming value 20061206084944.
    Is it because i tried to move a dec valu into a char field with a different length? If so  how will i load a decimal value of length 15 to a char of length 18. Can anyone please help me with this?
    Thanks in advance.

    if u r using BI7.0
    go to the datasource of the cube
    in the general info tab of the datasource
    there is a check box with PSA not typed
    check it
    if u check it all the values from the external source will be converted into character format irrespective of their data type

  • Decimal values are not flowing to Excise Invoice created in J1IIN

    Dear Sap Gurus,
    Please help me with the problem. After creation of invoice in VF01 when i am creaing outgoing excise invoice decimal values for BED, ECS and SEC. ECess( AT1) are not coming instead values are rounded of to nearest whole number.
    for ex.
    if invoice values are as below
    BED= 16
    ECS= 3.2
    HSC= 1.6
    when excise iinvoice is created values are changes as below
    BED= 16
    ECS= 3
    HSC= 2
    please give propeer solution
    reg.
    suresh

    Check in Logistics - General -> Tax on Goods Movements -> India -> Basic Settings -> Maintain Company Code Settings. 
    Also ensure that in V/06, for the respective excise condition types, rounding is not activated.
    thanks
    G. Lakshmipathi

Maybe you are looking for