SAP NetWeaver AS ABAP Release 752, ©Copyright 2017 SAP AG. All rights reserved.ABAP - Keyword Documentation → ABAP - Reference → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for String Processing → String Functions → Processing Functions for Character-Like Arguments →
translate - Translate Function
... translate( val = text from = from to = to ) ...
This function returns the character string from text with each character that occurs in from replaced by the character that occurs in the same place in to as in from. If to is shorter than from, the surplus characters from from are removed from the character string. If from is an empty string, the content of text is returned unchanged.
from and to are character-like expression positions. If they have a fixed length, trailing blanks are ignored.
The return code has the type string.
The return value of the following function call is "Horray!".
DATA(result) = translate( val = `---Hur-rah!---` from = `uh-` to = `oy` ).