cancel
Showing results for 
Search instead for 
Did you mean: 

Referencing input schema field in DS search_replace custom SQL

brad_schroeter2
Explorer
0 Kudos

We are currently using the DS search_replace custom SQL via a function to call an external table to get the search_replace values for customer name. I'm wanting to reference an input schema field as a where filter in the custom SQL but this functionality isn't allowed per SAP Support when using the search_replace via a function or mapping. So then I built a custom function where I was able to build the custom SQL to reference an input schema field and then in the same custom function make the search_replace call. However, per SAP Support the search_replace only makes 1 call to the external table using the custom SQL which works for 1 customer record as the filter is correct but doesn't work for multiple customer records as the filter for the first customer record is only used. I could just read in the entire external table as a source but I'm not sure how I could filter the external table records for each customer record and then reference the external table record subset for each search_replace call. Any suggestions? Thanks...

Accepted Solutions (0)

Answers (1)

Answers (1)

denise_meyer
Contributor
0 Kudos

You are correct - whatever custom sql is used for a search replace table, we will load that in memory as a table. Have you tried using word as the search replace method instead of field? I tested that and it fixed what you were trying to avoid with the SQL.

brad_schroeter2
Explorer
0 Kudos

Hello Denise, thanks for replying. The issue is not the search replace type (field, word, or string) but how do I reference an input field schema when the search_replace makes 1 call to the external table using the custom SQL. For example, let's say I'm trying to standardize a customer to 'BRAD COOL CAFE' and I have a search replace table record with search replace type = string, search value = 'BRAD COOL', and replace value = 'BRAD COOL CAFE'. If my input customer is 'BRAD COOL' then the customer is correctly changed to 'BRAD COOL CAFE' (I want the search replace record applied). However, if my input customer is already 'BRAD COOL CAFE' then the customer is incorrectly changed to 'BRAD COOL CAFE CAFE' (I don't want the search replace record applied). There doesn't seem to be an easy way to do this.

By the way, can you tell me how in this new SCN that I can get notified when there is a reply on a question of mine?