cancel
Showing results for 
Search instead for 
Did you mean: 

regular expression to remove garbled/incorrect characters in CDS view

07-18-2018 10:23 AM
1183 views 0 comments
0 Likes
SAP Managed Tags
Subscribe

Hi there,

I had a odp data source which is based on a cds view and found that there is a field in the source table containing garbled/incorrect characters.

e.g.

1. Pr㭃�nerfassung

2. Prüfdatenerfassung

I wrote a table function trying to replace these garbled with ''. see below the sql inside the table function.

e.g.

select replace_regexpr('([^[:ascii:]])' in zew_tran with '' occurrence all ) as ZEW_TRAN from sapf75.dctbw_transact_v where tmstmp = '20180702202450' and zew_date >= '20180601'

Besides this regular expression shown as above, I also tried below expressions:

[^\x00-\x7F]

[^[:ascii:]]

[^[:print:]]

[^[:graph:]]

[^[:alnum:]]

[^0-9a-zA-z\/\(\)\{\}]

however, none of them can handle the 1st example . the output result looks like below:

1. Pr㭃�nerfassung

2. Prfdatenerfassung

Can anyone help here?

0 Likes

Accepted Solutions (0)

Answers (0)