on 05-04-2009 7:23 AM
Hi,
I have done a report in WD4A, in which the final result is displayed in ALV. I have particular field in which the amount will displayed.
Currently the amount is display as below:
10,00000000000000
The actual amount is 10 $ . Can you please help me in truncating the trailing 0's in WD4A side itself, rather than changes in data element element.
Thanks,
Selvakumar M.
Hi,
You can use floor command.
Use following example
data: dec TYPE p DECIMALS 3 VALUE '10.000', " or if Value will be 10.999 will also return you 10
with_out_fp TYPE string.
with_out_fp = floor( dec ).
WRITE: with_out_fp.
Or just take another variable of type P
data : v_dec TYPE netpr value '10.000',
v_wit_dec(15) TYPE p decimals 0.
v_wit_dec = v_dec .
v_wit_dec will contain value without decimal.
output: 10
I hope it helps.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Selva,
You can use following code. So that you can removethe trailing zeroes.
lv_val = 10,00000000000000.
move this to another variable.
WRITE lv_val TO lv_string.
SHIFT lv_string RIGHT DELETING TRAILING '0'.
CONDENSE lv_string NO-GAPS.
Hope this will be Helpful.
Regards,
Anita Vizhi Arasi B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using SPLIT AT or SHIFT keywords.
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Selva,
As such there is no way to remove trailing zeroes in webdynpro abap. But you can try to use the data type with required no. of decimal places. You can create an attribute of this data type and bind it with the alv column.
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.