Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module

FredericGirod
Active Contributor
0 Likes
478

Hi,

I try to use the function : CAD_CONVERT_TO_INTERNAL

It convert a quantity / amount into internal SAP quantity, amount. But the abapor has forget to finish the function. For example, the function manage 2 type of decimals (but SAP have 3 type of decimals)

So, do you know another function that makes the same job ?

Rgd

Frédéric

4 REPLIES 4
Read only

Former Member
0 Likes
460

try BAPI <b>BAPI_CURRENCY_CONV_TO_EXTERNAL</b>

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
460

<i>

the function manage 2 type of decimals (but SAP have 3 type of decimals)

</i>

Do you mean the decimal notation that you see in the defaults of the user profile?

Which one is not working for you?

Regards,

Rich Heilman

Read only

0 Likes
460

This function module is working good in my system. It all depends on the user profile setting.



report zrich_0003.

data: in(20) type c,
      out(20) type c.


in = '1 351 984,65'.
call function 'CAD_CONVERT_TO_INTERNAL'
     exporting
          name           = 'MSEG-MENGE'
          value          = in
     importing
          value_internal = out.
write:/ in, out.


in = '1,351,984.65'.
call function 'CAD_CONVERT_TO_INTERNAL'
     exporting
          name           = 'MSEG-MENGE'
          value          = in
     importing
          value_internal = out.
write:/ in, out.


in = '1.351.984,65'.
call function 'CAD_CONVERT_TO_INTERNAL'
     exporting
          name           = 'MSEG-MENGE'
          value          = in
     importing
          value_internal = out.
write:/ in, out.

Regards,

Rich Heilman

Read only

0 Likes
460

Hi Rich,

If you go in SU3, you could set 3 types of decimals. This setting is save in the table USR01 field DCPFM.

The 3 values of the field could be : X, Y and nothing.

The function manage the X and nothing, but not the Y.

Fred