Application Development 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: 

HOW TO CORRECT CURRENCY FORMAT

Former Member
0 Kudos

Hi,

Is there anyone who can help me to find out what could be the most possible way to eliminate the decimals in the currency LIRA?

LIRA is a 0 decimal currency and it just so happened that the values being retrieved in LIRA has decimals.

I am not certain if the retrieval process is wrong but it works well with other currencies except LIRA.

Thanks!

1 ACCEPTED SOLUTION

former_member150733
Contributor
0 Kudos

The key is to populate the reference field for the currency Field with the Currency Key you want to populate. eg USDN or Curency key for LIRA

After populating the currency key field try to populate the Currency field.

Regards,

Anish Thomas

10 REPLIES 10

Former Member
0 Kudos

Hello,

Please have a look at this thzread.

Vasanth

former_member225631
Active Contributor
0 Kudos

Declare one integer variable and assign the value to this. You can elimiate the decimals values.

Former Member
0 Kudos

Hi

Specific currencies (like Italian lira, Spanish pesetas) are saved on the database in a particular way: all currency values are saved with two decimals. Currencies that are not used in that way are still saved with two decimals

Can you try moving that value into a variable of type p of suitable length and <b>decimals 0</b>.

Regards

Raj

0 Kudos

Hi,

Indeed it is.

That is actually my problem. The program I am working at displays values of Italian Lira with decimal. Say, 124.33. It has to be in whole numbers, right?

Can you tell me what could be the problem? and the probable solution aside from moving value into a variable type p?

thanks!

former_member150733
Contributor
0 Kudos

The key is to populate the reference field for the currency Field with the Currency Key you want to populate. eg USDN or Curency key for LIRA

After populating the currency key field try to populate the Currency field.

Regards,

Anish Thomas

Former Member
0 Kudos

Hi,

replace w_dmbtr = 0 with

write '0' to w_dmbtr currency 'Currency type'.

W_DMBTR defined as type C.

LIRA could be in the table T015Z or TCURT

<b>Reward points</b>

Regards

Message was edited by:

skk

Former Member
0 Kudos

hi,

Follow this logic.

<b>WRITE : / <variable> CURRENCY <currency-format>.</b>

regards,

Ashokreddy.

Clemenss
Active Contributor
0 Kudos

Hi Maria,

all currency fields (type CURR) are linked to a currency key field (type CUKY). The same applies to quantity fields (QUAN), they are linked to a quantity key (type unit).

This will control output of the fields values on a screen or list. If you have the data in a variable or structure of your own definition, you have to use the CURRENCY addition with WRITE statements or fill the reference fields infield catalog for ALV.

The simplest way is to use DDIC structures and take care that the corresponding curreny key fields (like WAERS) are filled when the value is output.

Don't care what it looks like in debugger, internally you will always see 2 decimals for currencies and 3 decimals for quantities although some currencies (like Jordanian pounds) have even 3 decimals.

Note: Important is input and output handling.

Regards,

Clemens

Former Member
0 Kudos

Hi Clemens,

Can you elaborate further? I mean, i don't actually know how to use the CURRENCY addition with WRITE statements.

Can you give me examples to that?

Thanks!

Clemenss
Active Contributor
0 Kudos

Hi Maria,

WRITE BSEG-DMBTR CURRENCY 'ITL'.

If you write a DDIC field with currency reference and the reference field is filled, then you don't need to use the addition.

In SE12, check BSEG fields. Double-click on BMBTR (Amount in Local Currency). This will show you the reference field is T001-WAERS. That means, before output you should have a select single * from t001 where bukrs = bseg-bukrs. This makes sure the referencce field is filled corectly and you can do a WRITE BSEG-DMBTR without CURRENCY addition.

Regards,

Clemens