cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert amount data element to number data element

Former Member
0 Kudos

Dear Gurus,

I have a requirement to get the data by calling BRF+ and then pass them to BAPI 'BAPI_ASSET_ACQUISITION_POST', in the BRF+ export structure, there is a field 'AMOUNT', I bind it to DDIC element 'BF_ANBTR', the type is Number.

In BRF+, I call another global function to calculate the value, I define a local variant LV_VALUE to get export value from this function, this local variant's type is Amount, now I need to move this local variant value to the export field 'AMOUNT'.

But BRF+ doesn't allow to convert amount data element to number data element directly, and I find there is no formula function available. Only there is a function 'TO_AMOUNT' to convert number data element to amount data element.

Please help to get a solution for above solution.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

within the formula expression within the category "Mathematical functions" you will find the function "TONUMBER". This converts a data element of type currency to a number. According to the help of this function:

"The following conversion rules apply:

  • <Amount>: The number part is returned. The currency unit is omitted."

This is what you are looking for.

For the other way round you already mentioned the correct function "TO_AMOUNT"

BR

Christian

0 Kudos

Answer was one minute too late with respect to Carstens answer 😞

Former Member
0 Kudos

Thanks very much!

According to both of your suggestion, my issue has been solved

Answers (1)

Answers (1)

carsten_ziegler
Active Contributor
0 Kudos

What SAP_BASIS release?

There is a formula function TONUMBER. But I do not know when it was added.

You may also add a custom formula function. That is easily done in some minutes.

Former Member
0 Kudos

Thanks very much