2008 Dec 18 8:39 PM
Hi Guru's,
I've a requirement to display the 9 digits after the Decimal Point in some of my reports.
For example, suppose the value is 1234.24, it should display as 1234.243561234.
Is there any FM is available for do that??
Or should i change the Domain in the Standard SAP??
Or is there any RULE i can change in VOFM??
Please guide me on this.
Thanks in Advance.
Adi.
2008 Dec 18 8:45 PM
Or should i change the Domain in the Standard SAP??
Stop!No No Never do that.
Domain is Lower level of hierarchy at database level.it would impact your all standard objects where it domain is being used.
So look for either standard domain which gives you 9 decimal places or create Custom domain at data dictionary and use this domain in your report.
2008 Dec 18 9:05 PM
Hi there
If you want to show 9 decimals in the report .. change the attributes of the field in the structure you are sending data to the FM or the Class or method
data: lv_data type p decimal 9.
change to the sap standards DE or domain is modification for ever.. dont even think unless you rule out all the options available to test..and verify.
2008 Dec 18 9:31 PM
>
> data: lv_data type p decimal 9.
But this will store amount only upto 999999.999999999 which is really doesn't make any sense,and not sufficient(unless your turnover of business upto only some thousand Dollars ).
REPORT:test.
data: test TYPE p DECIMALS 9 VALUE '999999.999999999'.
test = test + 1 .
WRITE:test.
Result Dump.
if in any case amount exceeds you will get Dump(As Just discussed today,hope you remember),so better to get rid of this situation you should search for alternate standard domain if available, else go for Custom domain.
2008 Dec 18 10:24 PM
Hi,
Thanks for your suggestions.
But as per my requirement the value must be greather than 999999.999999999.
I need to display the value for ex:
12345678.999999999
Please suggest me the suitable solution.
Thanks in advance.
Adi.
2008 Dec 18 10:35 PM
>
> But as per my requirement the value must be greather than 999999.999999999.
I know,That's why i was not Convinced with Joy's suggestion.
REPORT:test.
data: test TYPE PSA_AMT_LIST VALUE '12345678.999999999'.
test = test + 1 .
WRITE:test.
Use Data element PSA_AMT_LIST
2008 Dec 18 11:26 PM
Hi there..
[... DECIMALS n|http://www.abapprogramming.net/2008/06/sap-abap-syntax-for-data-part-four.html]
Effect
Only makes sense with field type P . When you perform calculations and on output, the field has n decimal decimal places, where n is a number between 0 and 14.
In the case of newly generated programs, you normally activate fixed point arithmetic in the attributes. If it is not set, the DECIMALS specification is taken into account on output, but not when performing calculations. This means that the programmer must take care of any decimal point calculations by multiplying or dividing by powers of ten.
Fixed point arithmetic should always be active when you are performing calculations, since this enables intermediate results (for division) to be calculated as accurately as possible (in this case, to 31 decimal places).
To decide whether you should use the fixed point type P or the floating point type F , see "ABAP/4 number types ".
2009 Jan 12 9:28 PM
Thanks Guys for your help.
I've created a domain and data element with the required data type.
The problem is resolved.
2009 Jan 12 9:32 PM
Adi - rather than just marking your old posts as solved, you might also click the radio buttons next to the answers that helped you.
Rob