2009 Nov 09 10:21 AM
Hi All,
I have developed a module pool program where i enter currency and related currency key in a table control. My currency field is standard one with 2 decimals. Its working fine for all currency with 2 decimals but when it comes to egypt pound which has 3 decimals its giving error as input should be in the form -
. Please help me how to resolve this issue.
Thanks
Srini
Hi All,
I have developed a module pool program where i enter currency and related currency key in a table control. My currency field is standard one with 2 decimals. Its working fine for all currency with 2 decimals but when it comes to egypt pound which has 3 decimals its giving error as input should be in the form -
. Please help me how to resolve this issue.
Thanks
Srini
2009 Nov 09 11:10 AM
Dear ,
See the error is beacuse the declaration which u have taken for that text field is of 2 decimals .
and When the value of 3 decimals come its throw error .
either u declare one more text element and make it visible on the basis of Currency .
Or u can use higher decimal places this might solve .
Rgds Aryan
2009 Nov 09 11:16 AM
Hi,
Just declare one more field with 3 decimal places.
And in case of egypt populate this field.
Regards,
Dhan
2009 Nov 09 11:42 AM
I guess what you guys say wont work out. Because its a currency field which is refered to a standard reference field and apart from that japanese currency wont have any decimals what i will do in that case? apart from that its a table control where i can give only one reference field for a field
Thanks
Srini
2009 Nov 10 11:10 AM
Hi,
The currency is stored always with two decimals in the database. But while displaying, it will automatically take the number of decimals configured, if the currency key is specified.
In the screen attributes, in the table control, define the the format as 'Currency' for the amount field & reference field as the variable, you are using to display the currency key in the table control. Defining a variable with different decimal points will not help.
Suppose, currency LYDN has been configured for 3 decimal places. In database table, the value is stored as 56.36. Even in the ABAP program it will be stored as 56.36 in the variable.
But, while displaying, it will refer to no of decimals configured, if currency key is specified.
DATA: wf_currency TYPE netpr.
wf_currency = '56.36'.
WRITE wf_currency CURRENCY 'LYDN'.
The above statement will display the amount as 5.636 and not 56.36.
1. If the currency needs to be displayed in ALV, then we need to refer currency key along with the value in the field catalog.
2. In screens, the type should be specified as currency and currency key should be referred as well.
3. In case, some internal conversions need to be done in the ABAP program itself, a set of BAPIs starting with BAPI_CURRENCY* can be used.
The no of decimals for a currency can be configured in SPRO or transaction OY04.
2013 Sep 09 9:02 AM
Is the actual issue resolved? I am facing the same problem.. Please help me out.
Thanks in advance. Harish
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |