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.

Similar Messages

  • Issue in Decimal value round off

    Hi All, I am facing an issue wherein Decimal value of 0.01 is getting converted to 0.00. Let me brief you about Source-target Types -  Source - Flat FileTarget - DB2Powercenter Version - 9.6.1 HF2 Issue -  Field in Source File is defined as Number(5,2).Corrosponding field from Db2 Target Table is defined as Decimal(5,2). Mapping is simple straight forward mapping with 1:1 loading from Source to target. Now, my Source File contain data as below -  0.010.020.0312.01 When I execute mapping, DB2 target Table gets loaded with all records.Value from corrosponding DB2 Target Table is -  0.000.020.0312.01 As you can see value of 0.01 is getting converted to 0.00 whereas all other values are working fine as expected. As a quick fix, I have applied to_decimal(source_field,2) before loading it to target. Could anyone please explain if this is an issue with Powercenter or there's some other issue. If I think it's a rounding issue then how come value of 0.02 is working fine? Please advise.

    Hi All,  I have one scenario to read the source file . The file delimiter is '|' . The no of pipeline for each line is 17. So if a line containing more than 17 , send an error email. For this first i am printing tota pipeline in ecah line to afile called pipelinecount.txt . Then i will read this file and send each value to while loop /for loop , where it will get > 17 , it will exit the process and send an email.  But here in script i am getting error at while line. Could anyone help.   #! /bin/kshset -x SOURCE_DIR=/vp01/SrcFilessed 's/[^|]//g' /vp01/SrcFiles/Test.txt | awk '{ print length }'> /vp01/SrcFiles/pipelinecount.txtcd $SOURCE_DIRwhile line in `cat pipelinecount.txt`; do if [ $line -eq 17 ];thenecho "No issue in pipeline"exit 0;fiif [ $line -gt 17 ];thenecho "No of pipelines exceeded the expected. Please verify the source file." | mailx -s "WKFS Load: Failed" [email protected]

  • Re: Issue in Decimal value round off in DB2

    Hi All, It is happening only only when the decimal separator of source is ',' and behaving normally when decimal separator is '.'. Some how ..we casted the incoming field to TO_DECIMAL(IN_FIELD,2) ..in that case it is working fine.  Regards,Srinivas

    Hi All, I am facing an issue wherein Decimal value of 0.01 is getting converted to 0.00. Let me brief you about Source-target Types -  Source - Flat FileTarget - DB2Powercenter Version - 9.6.1 HF2 Issue -  Field in Source File is defined as Number(5,2).Corrosponding field from Db2 Target Table is defined as Decimal(5,2). Mapping is simple straight forward mapping with 1:1 loading from Source to target. Now, my Source File contain data as below -  0.010.020.0312.01 When I execute mapping, DB2 target Table gets loaded with all records.Value from corrosponding DB2 Target Table is -  0.000.020.0312.01 As you can see value of 0.01 is getting converted to 0.00 whereas all other values are working fine as expected. As a quick fix, I have applied to_decimal(source_field,2) before loading it to target. Could anyone please explain if this is an issue with Powercenter or there's some other issue. If I think it's a rounding issue then how come value of 0.02 is working fine? Please advise.

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

  • Truncating Decimal Values

    Hi! Folks,
    I would like to ask for you kind assistance in figuring out my assignment, how to truncate a decimal value depending on the number of decimal places the user has specified.
    Your immediate assistance will be much appreciated.
    Cheers!

    // utility class
    public class Fraction{
       public static double digits(double d, int places){
          return (long)(d*Math.pow(10,places)+0.5)/Math.pow(10,places);
       public static double digits(double d, long places){
          return (long)(d*Math.pow(10,places)+0.5)/Math.pow(10,places);
       public static float digits(float d, int places){
          return (int)(d*Math.pow(10,places)+0.5)/(float)Math.pow(10,places);
       public static float digits(float d, long places){
          return (int)(d*Math.pow(10,places)+0.5)/(float)Math.pow(10,places);
    // testing class
    public class Dec {
        public static void main(String s[]) {
            int decimalPlaces = 3;     
            double d = 2343.12894132134;
            d = Fraction.digits(d, decimalPlaces);
            System.out.println(d);
    }

  • Editable alv not update with decimal values

    Friends.
    i have editable alv, there is a editable field is with 3 decimal places.
    my problem is when i changed there value as  15 its take 1.5 and if i change as 150 its take 15.
    can you please help me to solve my problem?
    thanks in advance!

    Hi Friend,
    This Problem will be solved in below method.
    Define Your filed type in currency.
    Eg. vnumber TYPE CE1SAS1-KWABLK (kwablk is a currency field).
    In FIELDCATALOG add currency.
    Eg:
    lw_fcat-fieldname = 'VNUMBER'.
    lw_fcat-edit = 'X'.
    lw_fcat-datatype = 'CURR'.

  • Integer values and decimal values in weblient UI - Display mode

    Hello,
    i have developed an custom assignmentblock with some custom fields.
    Some of this fields are integer values and text values.
    Some other fields are decimal values.
    I face the issue that this decimal values are in display mode  right-aligned all other fields are left-aligned.
    In edit mode all values are right-alligned.
    How can i change this behaviour? All values left-alligned in display mode!
    Otherwise this looks strange.
    Thank you
    Kind regards
    Manfred

    Hi,
    Decimal values will be displayed right-aligned. To change that you need to modify the GET_M method.
    In get_m method, you have to change the attr datatype to string.
    Data: attr type string.
    Data: dref type ref to data.
    Get reference of attr into dref.
    Regards,
    Arun
    Edited by: Arun Kumar on May 14, 2010 3:03 PM

  • 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

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

  • 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

  • Excel import rounding up decimal values

    In my excel file I have a column that contains dollars and cents (e.g. 49.95). When I run the import the values in this column are rounded up to the next integer (e.g. 49.95 is rounded up to 50). Is this a bug or am I doing something wrong?
    Thanks,
    Peter

    Hi All,
    I have already migrated lakhs of records and I am facing the same problem for decimal value migration. Shall I know whether anyone has fixed this problem? Is there any other free tool for SQL Server to ORACLE migration? Please do guide me as soon as possible.
    Thanks,
    Srinivasan.T

  • Rounding a decimal value to 3 digits

    I have opened a UDF and copied the value of Total (LC) column in that field. I want to round off the copied value to 2 digits.
    Below is the query written to copy the value.
    SELECT ($[$38.21.NUMBER] * $[$38.U_GST.1.11]) / 100
    Below is the query written to ROUND the value.
    SELECT ROUND(($[$38.21.NUMBER] * $[$38.U_GST.1.11]) / 100, 2)
    Thanks & Regards,

    Try: SELECT ROUND(($[$38.21.NUMBER\] * $[$38.U_GST.NUMBER\]) / 100, 3)
    However, I think it is probably not working because B1 has internal checking to make sure the decimal value follow your setting. If you setup your currency by 2 decimals, you may never get any additional decimal place.
    Thanks,
    Gordon

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

  • 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

  • Decimal Values getting truncated

    Hi,
    In my query results, the decimal values are getting truncated.  e.g.
    0.30 + 0.44 = 0.70  (expected result = 0.74)
    0.30 + 0.45 = 0.80  (expected result = 0.75)
    0.40 + 0.48 = 0.80  (expected result = 0.78)
    What am I supposed to do to make sure that the second decimal point is not truncted.
    Thanks,

    Hi,
    I do not have any conditions.  Except that I am just using the function NODIM to get the decimal values in my report.
    I did tried using the decimal places in the Key Figure properties.
    Are there any other possibilities to solve this?
    Thanks,

Maybe you are looking for

  • DVD's & CD's not reading, but the drive will open and close

    Hello, When I put the CD's or DVD's in, the drive tries for about 10 seconds, but then spits back out whatever the disk is. I searched other posts and I'm gathering I may have a failed superdrive. In there anything I can try before getting it repaire

  • Trouble with upgrade ITunes 11.1.4.62

    I upgrade iTunes with v11.1.4.62 and i have trouble to connect my iPod Touch to my computer. When i turn on my computer i receive this message: (MSVCR80.dll not found) How can i solution this problem ? I uninstall iTunes but the message is the same a

  • Link to other tab !

    Hi all ! I an beginner with OracleAS Portal. I have a problem need some guide ! I created three tab: TAB_A; TAB_B; TAB_C. Inside the TAB_A, I place a link: me.info.com*. And my purpose is when anyone click this link, other content page inside TAB_B a

  • Macpro intel is bugged if you use firewire audio card

    hi i need a solution but apple do nothing . i am boring . when i use my audio card FW Motu 828 MKII , the sound stopped after few minutes or few hours of work . with all the audio applications like itunes logic or quicktime . . . bus firewire don't w

  • Font compilation error

    So, in Flash Builder, my app compiles fine. But when I try to build it on my production server from the command line, it fails while compiling the fonts: /home/me/MyFlexProject/SomeModule/src/Fonts.as(29): Error: exception during transcoding: Font fo