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

Currency problem

former_member116198
Discoverer
0 Likes
1,929

Hi, Everyone, I´m working for a Colombian Company and I've some problems with de currency.

Look, when I post a document with amount for COP 1.000.000 in the document is ok, but in the table is 100.000,00 when I access this table with a ABAP program it show me 100.000,00 but when I saw a SAP standar report the amount is OK.

Have someone fix this problem?.

Thanks.

6 REPLIES 6
Read only

Former Member
0 Likes
1,255

Hi

That currency doesn't have decimals, try to check the table TCURX: here you can see how many decimals are used by a currency.

If a currency is not in that table it means it uses 2 decimals by default.

Now in generally the field for amount is a numeric with 2 decimals, so if a currency doesn't need decimals, the amount is stored divided by 100, in this way SAP can also use the decimal part for this kind of amount and save the space.

When an amount has to be displayed, its value is multiplied for 100.

A convertion routine for input/output does the action above

Max

Read only

0 Likes
1,255

Thanks, is there any function to convert all amounts to format * 100, something like SET COUNTRY?

Read only

0 Likes
1,255

No

Why do you want to convert the format?

Max

Read only

0 Likes
1,255

Hi:

Use de BAPI BAPI_CURRENCY_CONV_TO_EXTERNAL:

CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'

EXPORTING

currency = lc_waers (In your case: COP)

amount_internal = ln_internal_amount (Internal amount)

IMPORTING

amount_external = ln_external_amount

In your case, with the currency COP, this BAPI convert the value X into X*100.

Read only

0 Likes
1,255

Hi José,

in all dictionary structure and table fields you can double-clicj on any currency field and it will show you what is the related currency key CUKY field. The same applies for quantity and unit.

This is used for correct display with right number of decimals.

In ALV use dictionary structure or give reference in field catalog. With WRITE use CURRENCY addition.

Regards,

Clemens

Read only

0 Likes
1,255

Hi Max,

I have the same issue like below.

Scenario1: here we read data from data base. so for some currencies value stored as 1.23. then we are calling BAPI, which will convert to 123. this is fine

Scenario2: here we are not reading data from data base. means until here we entered value in excel (for example) 123. then this case also BAPI will be called and which is converting into 12300. which is wrong. because calling of BAPI is in same place for both scenarios and at the same time we don't want to distinguish whether this BAPI is calling for Scenario1 or 2. and at the same time we don't want to change decimal places in currnecy table TCURX.

can you please confirm is there anyway to achieve it. Thanks.

Regards,

Venkat