Skip to Content

Open hub file - key figure rounding issue

Hi Guys

I'm facing a issue with open hub file. After the file is generated to the user , I see keyfigure values are rounding up. user wants to see with decimal values.

The bex report is working fine with decimal values. But when it comes to file the key figure values are getting roundup which should not be.

please suggest me to solve this.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 13, 2016 at 12:49 PM

    write field routine as following,

    data : lv_value type p length 16 DECIMALS 3.

    CLEAR LV_VALUE.

    IF SOURCE_FIELDS-IO IS NOT INITIAL.

    lv_value = SOURCE_FIELDS-IO.

    IF LV_VALUE IS NOT INITIAL.

    RESULT = LV_VALUE.

    IF LV_VALUE LT 0.

    SHIFT RESULT RIGHT DELETING TRAILING '-'.

    SHIFT RESULT LEFT DELETING LEADING ' '.

    CONCATENATE '-' RESULT INTO RESULT.

    ENDIF.

    ENDIF.

    else.

    RESULT = '0.000'.

    ENDIF.


    It will remove trailing space, add - sign to right and decimal places as you want you can define in the code.


    Just replace info object with your info object.


    Thanks,

    Bhavin Vyas

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Chaitanya

      Check the OpenHub file definition . Did you use InfoObject template in field definition of OpenHub ?

      Do you have decimal places defined ? Routine what Bhavin has provided is used to bring negative ( -1) sign to the front. In case of openhub , it normally goes after the number.

      Like in BEx if you see -100.12 in OpenHub it becomes 100.12- . Minus sign at the end.

      You can also make the target field in OpenHub as CHAR and see if that resolves the problem .

      Regards

      Anindya