‎2011 Apr 28 11:23 AM
Hello Colleagues,
My requirement is every amount field should display two decimal places.
I have an XML file and I have to parse through every tag and do it.
ex:
'<ABB>100.0</ABB>' shud become '<ABB>100.000</ABB>'
Am using the below :
REPLACE ALL OCCURRENCES OF REGEX '<ABB>(-?\d+)</ABB>' IN lv_result_file_temp
WITH '<ABB>$1.000</ABB>' IGNORING CASE. "#EC STRING_OK
But the above REGEX doesn't work. Please suggest.
Thanks,
Sri
‎2011 Apr 28 4:17 PM
Why are you using a Regex for this? If you want a fixed number of decimal places inside an XML file, then in ABAP I think you need to use a character type field and e.g. fill it using with WRITE ... TO ... DECIMALS ... statement.
Thomas