‎2010 Apr 01 7:12 AM
Hi,
I have declared a domain of datatype CURR no of character 13 & decimals 2.
My report is displaying like
120.88
80.30
56.83
0.00
but my requirement is it should display like
120.88
80.3
56.83
0
How can i achieve this.
Thanks in advance,
Abhijit
‎2010 Apr 01 7:18 AM
‎2010 Apr 01 7:41 AM
Hi,
I can't tell you the direct function module but you can write some code.
Move it to char15 field and now you can easily write logic to manupulate character field.
‎2010 Apr 01 7:44 AM
Hi,
You can try as my solution:
1. Create another column in output table with type c length 15.
2. Write a subroutine to move data from currency field to the character field
3. Display the character field in alv output instead of the currency field.
Sample code of the function module you can refer to my test prog as following:
REPORT Z_TEST_PROGRAM.
DATA: lv_test(13) type p DECIMALS 2.
DATA: lv_string(15) type c.
DATA: lv_dec(2) type c.
* Sample data initialization
lv_test = '123456789012.1'.
* Move to char field
lv_string = lv_test.
* Get the decimal part
lv_dec = lv_string+13(2).
* Check the 0 number at decimal part
IF lv_dec = '00'.
lv_string = lv_string+0(12).
ELSEIF lv_dec+1(1) = '0'.
lv_string = lv_string+0(14).
ENDIF.
WRITE lv_string.Hope this help U.
Regards,
Khanh