‎2008 Dec 08 11:06 AM
Hi,
I have a bespoke program which picks up lines from bsis and displays them on a screen, the user then selects a few lines and the program posts them using program RFBIBL00.
Currently this program is working perfectly but I have a few countries which work with 3 decimal places instead of 2 and the program isn't picking this up.
I've found that table TCURX holds currencies which have 3 decimal places but I want to know how I change all my internal tables and screen fields to suddenly have 3 decimal places instead of 2? My internal tables and screen fields are all based on fields from BSIS and I have ALV grids and individual screen fields. Do I need to duplicate all of the amount fields, one set to have 2 decimal places and the other to have 3?
Any suggestions welcome.
Gill
‎2008 Dec 08 11:24 AM
Hi,
Best would be to have all variables with 3 decimal places. That would serve for all scenarions.
Since you are not making any changes in the amounts you need not do any rounding anywhere.
‎2008 Dec 08 11:11 AM
If it is only the display that you are concerned about - carry out a P to C conversion and use string concatenation and then a C to P conversion if required
‎2008 Dec 08 11:12 AM
Hi,
You can have your curr fields in the internal table with 3 char.
Use FM ROUND to round off for the countries which have 2 -decimal digits.
Hope it helps,
Raj
‎2008 Dec 08 11:18 AM
hi
just try to pass your value to var,it will take care of it.
data: var type p decimals 3.
hope this helps
regards
Aakash Banga
‎2008 Dec 08 11:24 AM
Hi,
Best would be to have all variables with 3 decimal places. That would serve for all scenarions.
Since you are not making any changes in the amounts you need not do any rounding anywhere.
‎2008 Dec 08 11:30 AM
I would prefer to just have one set of variables, but my users don't want to see 3 decimal places if the currency they are dealing with only has 2. How can I use the same variables but display 2 and 3 decimal places at runtime?
‎2008 Dec 08 11:38 AM
At the time of display you can very well limit the noumber of decimal places.
Have 3 decimal places variables that should work internally and at the time of display depending on country you could display 2 or 3 decimals.
decimals_out(6) type c, " decimals in write statement For ALV output.
There is option in case of WRITE statement too.
‎2008 Dec 08 11:42 AM
OK, I've figured this out.
If you define your screen fields (on the screen not in your data declarations) as CURR not DEC as mine were then you can put in a field as a reference. I defined a new field (not a screen one) which held the currency for the screen. If I define all my currency amount fields with 3 decimal places but refer them all to the currency field then they appear as 2 or 3 decimals places depending on the currency.
Thanks for all your suggestions, they got me thinking on the right track.
‎2008 Dec 08 11:51 AM
‎2008 Dec 08 11:27 AM
OK, I think I have 2 issues:
1. Displaying 2 and 3 decimal places using the same fields.
2. Processing 2 and 3 decimal places using those fields.
Do I need to define 2 sets of fields, one with 2 decimal places and one with 3? Or can I change the display and the processing at runtime?
My program needs to work with 2 and 3 decimal places, although not at the same time on the same screen (hopefully!).
‎2008 Dec 08 11:29 AM
Hi Gill,
Yes you would have to declare 2 variables with 2 & 3 decimal places respectively.
Best regards,
Prashant