cancel
Showing results for 
Search instead for 
Did you mean: 

Open hub file - key figure rounding issue

0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

bhavinvyas
Active Contributor
0 Kudos

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

0 Kudos

Thanks Bhavin

Could you pls explain why i need to write routine. I have bex report on multiprovider where keyfigure values are as expected eg 4863.78.

I have open hub on multiprovider and data goes to file, here in the file keyfigures are seen as eg.4864.

The values are rounding up. could you pls give solution for this.

anindya_bose
Active Contributor
0 Kudos

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

Answers (0)