Below is step by step procedure to write a custom function in BODS to remove special characters in a string using ASCII values.
Step 1: Create a custom function in BODS and name it as 'CF_REMOVE_SPECIAL_CHARS'
Step 2: Use the below code in your function.
Step 3: Declare Parameters and local variables as shown in left pane of the above function editor.
$input_field - parameter type is input (data type varchar(255) )
$L_Char - datatype varchar(255)
$L_Counter - datatype int
$L_String - datatype varchar(255)
$L_String_final - datatype varchar(255)
$L_String_Length - datatype int
Step 4: Save this function.
Step 5: Call this function while mapping any field in Query Editor where you want to remove special characters.
Ex: CF_REMOVE_SPECIAL_CHARS(Table1.INPUT_VAL)
Above function call shall remove all special characters from INPUT_VAL field in a table1 and output Value shall look like below table's data.