cancel
Showing results for 
Search instead for 
Did you mean: 

Infotype 0008 BET01 Decimal Out of Place

Former Member
0 Kudos

I'm trying to write a custom ABAP program that reads infotype 0008 and works with the "Wage Type Amount" field (BET01), but I am having trouble getting an accurate value out of it. When I view the data in PA20 or SE16 (looking at table PA0008), the value comes up properly as a value going out to 5 decimal places. In this case, the value is 2,688.10667, which is correct.

When I try and read this value in my program, however, it comes as 2,688,106.67, with the decimal place shifted over 3 places! I have tried reading it using HR_READ_INFOTYPE, direct SELECT statement, and with the decoupled framework, but I get the same result. It seems to be shifting the number over to fill in just 2 decimal places no matter what record I go after.

If it matters, this value is in USD, but I am having the same problem with EUR or any other currency where the value is stretched out past 2 decimal places. It does not appear to be currency-specific.

It seems the displays in SE16 and PA20 can handle it, so I'm guessing there must be some conversion routine, but I don't see one attached to the datatype. How do I get it to return this value correctly?

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Use FM 'CURRENCY_AMOUNT_SAP_TO_DISPLAY' to convert amount from sap internal format to display format.

former_member235056
Active Contributor
0 Kudos

HI,

Please check the data type of field that is holding this amount value as it may not have capacity to handle 5 decimal places and only 2 decimal places.

You need to use same datatype as being used for infotype field.

Thanks,

Ameet

Former Member
0 Kudos

That's the weird thing. The database field is itself a CURRENCY type with only 2 decimal places. I am using the same datatype in my program as the infotype. How it renders with a different number of decimal places is what I don't understand.

I just found out that someone in my company did find a solution to this problem and created a class method for it. It appears there is a table, TCURX, that lists how many decimal places each currency type is supposed to allow. So using this table we are able to convert the number that comes out of PA0008-BET01 to use the correct number of decimal places. This method should serve my purposes well enough.

This is still confusing, though, as this is a custom solution and I doubt it is being referenced by SE16 or PA20 when those transactions display the value. It behaves as if there is a conversion routine attached to the datatype, but the Data Dictionary does not show any. How are SAP programs doing this conversion?

former_member235056
Active Contributor
0 Kudos

Hi,

Check your system default under system parameters.

Thanks,

Ameet