Feature Request: Replace REPLACE with replace()
REPLACE ALL OCCURRENCES OF PCRE '<([^\/>]+)\/>' IN variable WITH '<$1></$1>'.
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapreplace.htm could be replaced with:
variable = replace(
val = variable
pcre = `<([^\/>]+)\/>`
with = `<$1></$1>`
occ = 0 ).
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenreplace_functions.htm
Similarly, I think there can be many new rules based on "old" and "new" string syntax. https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenstring_functions.htm
Hi Jan,
thanks for the idea! We'd have to take a close look on exactly which cases of REPLACE could be replaced with replace() :-), but the hint in the documentation on REPLACE sounds encouraging:
"To replace parts of a character string in an operand position, a replace function can be used that includes some of the functions of the statement REPLACE"
For more cleanup rules that introduce newer string syntax, see #36!
Kind regards, Jörg-Michael